NoClassDefFoundError in Websphere — JARs are present

佐手、 提交于 2019-12-06 07:32:10

Turn on Class Loading trace. This would tell you what classes are loaded and from which Jar. As Sajan mentioned chances are that there are duplicate jars in the classpath and the classloader that you expect has not loaded this class (and a parent class loader has likely loaded a class).

NoClassDefFoundError (NCDFE) does mean it could not locate the class that it is looking for. Errors in static initialization would explicitly turn out as a "java.lang.ExceptionInInitializerError" (EIIE) "

Both NCDFE and EIIE extend from Linkage error.

In general all these errors can easily be troubleshooted by turning on the class loading for the Server. Also use the Class Loader Viewer available in the admin console to aid in your troubleshooting activities.

HTH Manglu

This is a sticky and common exception. Remember, that NoClassDefFoundError doesn't mean the class was not found, rather it means:

NoClassDefFoundError: The given class could be found, but something went wrong when initializing it (an interface it implemented could not be found, something went wrong in a static initializer etc.).

From here.

Please check that you don't have the same class in any other possible jar

Please check if you have added the dependencies in pom.xml file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!