java - Get more detailed Spring Bean Initialization Exceptions -
i getting exception when starting tomcat:
java.lang.noclassdeffounderror: com/mycompany/mypackage/someclass @ java.lang.class.getdeclaredmethods0(native method) @ java.lang.class.privategetdeclaredmethods(unknown source) @ java.lang.class.getdeclaredmethods(unknown source) @ org.springframework.beans.factory.annotation.initdestroyannotationbeanpostprocessor.buildlifecyclemetadata(initdestroyannotationbeanpostprocessor.java:194) @ org.springframework.beans.factory.annotation.initdestroyannotationbeanpostprocessor.findlifecyclemetadata(initdestroyannotationbeanpostprocessor.java:176) @ org.springframework.beans.factory.annotation.initdestroyannotationbeanpostprocessor.postprocessmergedbeandefinition(initdestroyannotationbeanpostprocessor.java:122) @ org.springframework.context.annotation.commonannotationbeanpostprocessor.postprocessmergedbeandefinition(commonannotationbeanpostprocessor.java:283) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applymergedbeandefinitionpostprocessors(abstractautowirecapablebeanfactory.java:870) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:495) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:458) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:296) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:223) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:293) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:628) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:932) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:479) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:410) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:112) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:5003) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5517) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:901) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:877) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:652) @ org.apache.catalina.startup.hostconfig.deploydirectory(hostconfig.java:1263) @ org.apache.catalina.startup.hostconfig$deploydirectory.run(hostconfig.java:1948) @ java.util.concurrent.executors$runnableadapter.call(unknown source) @ java.util.concurrent.futuretask.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown source) caused by: java.lang.classnotfoundexception: com.mycompany.mypackage.someclass @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1858) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1709) ... 33 more
so, means, bean not initialized spring because directly (or worse, indirectly) references class com.mycompany.mypackage.someclass
i find stacktrace quite bad, tells symptom, not root cause. need know bean not being initialized, can talk person responsible bean can decide wether "someclass" should in classpath or not.
is there trick find out bean not being initialized?
set logging level debug
on org.springframework
, more detailed log of exception occurring.
Comments
Post a Comment