aspose file tools*
The moose likes BEA/Weblogic and the fly likes OpenSAML runtime exception java.lang.NoClassDefFoundError: org/apache/xml/security/Init Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "OpenSAML runtime exception java.lang.NoClassDefFoundError: org/apache/xml/security/Init" Watch "OpenSAML runtime exception java.lang.NoClassDefFoundError: org/apache/xml/security/Init" New topic
Author

OpenSAML runtime exception java.lang.NoClassDefFoundError: org/apache/xml/security/Init

Michael Sideln
Greenhorn

Joined: Sep 01, 2006
Posts: 5
I am running into a problem when trying to sign the SAML assertion on WebLogic 10.3. The application deployes as a war file.
Here is the exception:
java.lang.NoClassDefFoundError: org/apache/xml/security/Init
at org.opensaml.DefaultBootstrap.initializeXMLSecurity(DefaultBootstrap.java:103)
at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:79)
at servlets.CreateRequestServlet.(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
.........
This exception occurs when DefaultBootstrap attempts to load a default configuration:
// OpenSAML 2.3
DefaultBootstrap.bootstrap();
I did some home work - I tried all fixes that were mentioned on forums:
I created endorsed directories under the jre/lib and copied there the following jares:
log4j-1.2.14.jar
opensaml-2.2.3.jar
resolver-2.9.1.jar
serializer-2.7.1.jar
slf4j-api-1.5.6.jar
slf4j-jdk14-1.5.6.jar
slf4j-nop-1.5.6.jar
xalan-2.7.1.jar
xercesImpl-2.9.1.jar
xml-apis-2.9.1.jar
xmlsec-2.0.jar

I attached these jares to the classpath in the startWeblogic script and have added the weblogic.class.path property with all nessessary jars attached to it.
Also I added the following jars to the WEB-INF/lib folder:
catalina-root.jar
commons-codec-1.3.jar
jdom.jar
opensaml-2.2.3.jar
xmldsig.jar
xmlsec-2.0.jar
xmltooling-1.2.0.jar
and updated weblogic.xml with the following part:

<wls:container-descriptor>

<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>

All these attempts led me to the same result - runtime exception.
At this point I think that I need help to resolve this issue. And I'll continue researching it.

iAsk Engineer
Greenhorn

Joined: Jan 21, 2011
Posts: 4
can you try setting prefer-web-inf-classes to true in your weblogic.xml?

see http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/classloading.html#wp1082452 for details.
 
 
subject: OpenSAML runtime exception java.lang.NoClassDefFoundError: org/apache/xml/security/Init
 
Similar Threads
Strange Persistence Unit deployment error in JBoss 6
Unable to load primefaces-2.0.0.jar on Weblogic Start Up.
OpenEJB + JUnit + Ant
WebLogic 9.2 clustering problem
Unable to load jar on Weblogic11g server startup.