问题
I'm deploying my web application to Weblogic 10.3.6 on localhost and everything works as it should. But when i deploy it to the same version of weblogic which is runnig on a remote server, it throws this:
JDOMException: java.lang.NoClassDefFoundError: org/jdom/Parent: org/jdom/Parent
The application is packed in a war file, and i upload the same file to both of the servers, but it works only on my local weblogic. Jdom.jar is located in WEB-ING/lib. I searched for jdom.jar in the directory where the remote weblogic is installed, and there is no other instance of it.
回答1:
possibly class loading conflict issue, please try configure WEB-INF\weblogic.xml
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
prefer-web-inf-classes
The element, if set to true, will cause classes located in the WEB-INF directory of a Web application to be loaded in preference to classes loaded in the application or system classloader. The default value is false. A value specified in the console will take precedence over a value set manually
回答2:
NoClassDefFoundError
means that the class which is required by org.jdom.Parent
is not found, not org.jdom.Parent
itself. Some dependency is missing from your WEB-INF/lib folder.
If you are building this using maven, make sure that you include all the required optional library as well.
来源:https://stackoverflow.com/questions/12351097/weblogic-jdom-noclassdeffoundexception