What SAAJ package is used by WebLogic

Sonny Benavides picture Sonny Benavides · Apr 26, 2012 · Viewed 7.8k times · Source

I have had many problems because there are different SAAJ packages with SOAP classes:

  • com/sun/xml/internal/messaging/saaj/soap/ in rt.jar
  • com/sun/xml/messaging/saaj/soap/ in saaj-impl.jar

When WebLogic uses classes from com/sun/xml/internal/messaging/saaj/soap/ and an application is created using classes from com/sun/xml/messaging/saaj/soap/, it throws exceptions like these when the app is deployed:

com.sun.xml.internal.messaging.saaj.soap.LocalStrings != com.sun.xml.messaging.saaj.soap.LocalStrings

or

java.lang.NoClassDefFoundError: com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl

My solution was create a weblogic.xml descriptor with saaj reference and including saaj-impl.jar into the war. Question is: Can I know what SAAJ package is used in WebLogic Server?

Answer

Furqan Hameedi picture Furqan Hameedi · Oct 7, 2012

If you use weblogic 10.3.3(or i think even any other version) , the SAAJ implementation used by is of the JDK runtime installed since the web server initializes the CLASSPATH to the JDK jars first. So you need to override it with your jar file so it can find your desired implementation first. The only solution with weblogic that worked for me was to set PRE_CLASSPATH in weblogic setDomainEnv.cmd file like this,

          set PRE_CLASSPATH=%DOMAIN_HOME%\lib\endorsed\saaj-impl-1.3.18.jar

whereby DOMAIN_HOME represents Weblogic domain, but it can be any other absolute path as well to point the jar. A bit about the issue is also described Here