File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes NoClassDefinition found exception even when the jar file is in WEB-INF/lib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "NoClassDefinition found exception even when the jar file is in WEB-INF/lib" Watch "NoClassDefinition found exception even when the jar file is in WEB-INF/lib" New topic

NoClassDefinition found exception even when the jar file is in WEB-INF/lib

ravi cccc

Joined: Feb 01, 2011
Posts: 2

i get the NoClassDefinitionFoundException even when the relevant jar (spring-beans3.0.0.jar) exists in WEB-INF/lib folder. No new jars are added to tomcat lib. I reran with verbose:class as the jvm option and initially the logs say it has loaded the class InitializingBean; but still it throws NoClassDefinitionFoundException

When i put the spring-beans-3.0.0.jar in tomcat/lib then the exception goes off. But this is not a clean solution as i have to move all its dependencies into this.

How do we debug such issues (i use apache tomcat 6.0)? any ideas?

Below is the stack trace

g.config.admin.actions.BasicViewAction.operations; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class
[] for bean with name 'configConfi' defined in class path resource [META-INF/spring/config-common-beans.xml]: problem
with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/beans/factory/InitializingBean
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcesso
at org.springframework.web.context.ContextLoader.createWebApplicationContext(
at org.springframework.web.context.ContextLoader.initWebApplicationContext(
at org.springframework.web.context.ContextLoaderListener.contextInitialized(
at org.apache.catalina.core.StandardContext.listenerStart(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.addChildInternal(
at org.apache.catalina.core.ContainerBase.addChild(
at org.apache.catalina.core.StandardHost.addChild(
at org.apache.catalina.startup.HostConfig.deployDirectory(
at org.apache.catalina.startup.HostConfig.deployDirectories(
at org.apache.catalina.startup.HostConfig.deployApps(
at org.apache.catalina.startup.HostConfig.start(
at org.apache.catalina.startup.HostConfig.lifecycleEvent(
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardHost.start(
at org.apache.catalina.core.ContainerBase.start(
at org.apache.catalina.core.StandardEngine.start(
at org.apache.catalina.core.StandardService.start(
at org.apache.catalina.core.StandardServer.start(
at org.apache.catalina.startup.Catalina.start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.catalina.startup.Bootstrap.start(
at org.apache.catalina.startup.Bootstrap.main(
Sunny Bhandari
Ranch Hand

Joined: Dec 06, 2010
Posts: 448

When are you getting this exception....I mean while the server starts up or when you start using the application.

Check that no other application has been deployed which requires Spring library...

There is no hard and fast rule to debug these issues. It comes by experience.

Java Experience
ravi cccc

Joined: Feb 01, 2011
Posts: 2
WE get the exception during the server statup

only 1 context is in the webapp and it is this
Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

check out the option of clean and build, and try running again.

check your web.xml too if there are any specific mappings , and packages that are not properly defined.

Regards, Atul.
I came to this world on a Learner's License
I agree. Here's the link:
subject: NoClassDefinition found exception even when the jar file is in WEB-INF/lib
It's not a secret anymore!