简体   繁体   中英

java.lang.NoClassDefFoundError: org/json/JSONObject eventhough jar present WEB-INF/lib directory

00000ab ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause /api/getDataWAX.jsp: com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoClassDefFoundError: org/json/JSONObject.

I am using java-json.jar to convert an JSON to XML. It works fine in all environment but in Production it gives java.lang.NoClassDefFoundError. I don't have access to Production environment. The jar is present in .ear file in xyz.ear/xyz.war/WEB-INF/lib/java-json.jar

A java.lang.NoClassDefFoundError is not the same as a java.lang.ClassNotFoundException . In some cases, it is possible that the class loader locates the file but couldn't instantiate the class, for example, a missing class in a hierarchy or a fail during static initialization.

So, although you have java-json.jar in your production environment, maybe you are missing some dependencies for this package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM