NoClassDefFoundError, Xerces package in Weblogic Managed Server

I have spent 4-5 days including probably 10 hours this weekend to this tailspinning problem. We have this ear file deployed to WLS adminsevers w/o any problem. As soon as it is deployed to a managed server, we have this ClassDefNotFoundError each time we do an unmarshall from an XML soap msg to an object. This Object has a data type impl of Duration. To make long story short, the xerces always complained about unable to load this DurationImpl class in xerces. I use the latest xerces 2.9.1 and the class is obviously in APP-INF/lib. When all said and done, we semi-incidentally found by deploying to another instance of managed server. This worked on that instance. It turns out the problematic instance has this WILY management system in system classpath. So we think that must have some spoiler xerces packages which maybe of 2.6 or earlier for xerces. It is almost impossible to fix it by tuning CP config. in our ear file (with all those prefered CP options in weblogic or weblogic-application descriptors).

Not saying Wily is bad, but any package (JMX etc) that in the systm classpath is potentially a CP hell for us developers. WLS tends to include lots of open source packs or other 3rd party stuff, all could be sources of wasting precious times of ours.


  1. java.lang.NoClassDefFoundError: Could not initialize class org.apache.xerces.jaxp.datatype.DurationImpl
  2. at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newDuration(Unknown Source)
  3. at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$25.parse(
  4. at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$25.parse(
  5. at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(
  6. at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(
  7. at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(
  8. at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.processText(
  9. at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.endElement(
  10. at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
  11. at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
  12. at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
  13. at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
  14. at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  15. at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  16. at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
  17. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
  18. at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
  19. at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
  20. at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(
  21. at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(
  22. at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(

One thought on “NoClassDefFoundError, Xerces package in Weblogic Managed Server

  1. I am just fed up with this problem. It reappears today after moving code to another platform. What I wound up fixing is by cheating. I got all the relevant xerces javasource and re-package them into my own src. And set system property javax.xml.datatype.DatatypeFactory to the new package/class. This way, no more contamination with different versions of classes.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s