简体   繁体   中英

Glassfish: NoClassDefFoundError while deploying the application

Not sure how to fix this issue. I have all the required jars declared under Ant's build.xml and added to the app's classpath.

ERROR ContextLoader                  - Context initialization failed
java.lang.NoClassDefFoundError: com/google/api/client/json/JsonFactory
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
    at java.lang.Class.getDeclaredConstructors(Class.java:1906)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:229)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:962)

Caused by: java.lang.ClassNotFoundException: com.google.api.client.json.JsonFactory
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)

Could not find any specific compile-time or runtime settings in the build.xml? Would it make sense to move runtime jars to ${GLASSFISH_HOME}/modules/ folder

NoClassDefFoundError is thrown when the definition of class in not available during runtime. This error also indicates that the definition of the class was found during the compilation of the application, but it is not available in the application's classpath during runtime

Look for differences in your build time and runtime classpaths.

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