Skip to content

Ensure Metro SAAJ-RI is used by default

Compare
Choose a tag to compare
@runeflobakk runeflobakk released this 03 Jul 10:04

Ensuring that the EE4J Metro SAAJ-RI (SOAP with attachments reference implementation) is explicitly initialized by default instead of relying on the JDK standard discovery mechanism using javax.xml.soap.MessageFactory.newInstance(..), which may result in using the SAAJ provided by the JDK even though EE4J Metro SAAJ-RI is provided on classpath, depending on how the runtime is configured. This is problematic as the implementation provided by JDK has performance and concurrency issues.

It is still possible to configure to use the JDK standard discovery mechanism using MessageFactorySupplier.jdkFactory(). com.sun.xml.messaging.saaj:saaj-impl may even be excluded as a (transitive) dependency if you prefer to configure your own implementation returned by javax.xml.soap.MessageFactory.newInstance(..).