Solved

java.lang.ClassNotFoundException   error

Posted on 2014-03-01
6
2,260 Views
Last Modified: 2014-03-07
Here is the  error message I get in a Struts 2 - Spring integration  project:



22:21:44,334 INFO  [STDOUT] Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

22:21:44,335 INFO  [STDOUT]       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)

22:21:44,335 INFO  [STDOUT]       at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)

22:21:44,335 INFO  [STDOUT]       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)

22:21:44,336 INFO  [STDOUT]       ... 122 more

22:21:44,336 INFO  [STDOUT] Caused by: java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

22:21:44,336 INFO  [STDOUT]       at org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry.<init>(DefaultAdvisorAdapterRegistry.java:49)

22:21:44,339 INFO  [STDOUT]       at org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry.<clinit>(GlobalAdvisorAdapterRegistry.java:31)

22:21:44,339 INFO  [STDOUT]       at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.<init>(AbstractAutoProxyCreator.java:118)

22:21:44,339 INFO  [STDOUT]       at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.<init>(AbstractAdvisorAutoProxyCreator.java:47)

22:21:44,339 INFO  [STDOUT]       at org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator.<init>(DefaultAdvisorAutoProxyCreator.java:36)

22:21:44,339 INFO  [STDOUT]       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

22:21:44,340 INFO  [STDOUT]       at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

22:21:44,340 INFO  [STDOUT]       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

22:21:44,340 INFO  [STDOUT]       at java.lang.reflect.Constructor.newInstance(Unknown Source)

22:21:44,340 INFO  [STDOUT]       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)

22:21:44,340 INFO  [STDOUT]       ... 124 more

22:21:44,340 INFO  [STDOUT] Caused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor from BaseClassLoader@9a4477{vfs:///C:/myCode/myWorkspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_6.x_Runtime_Server1393588138379/deploy/mywebapp.war}

22:21:44,341 INFO  [STDOUT]       at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480)

22:21:44,341 INFO  [STDOUT]       at java.lang.ClassLoader.loadClass(Unknown Source)

22:21:44,341 INFO  [STDOUT]       ... 134 more




Can you please tell what is the issue here ?   How to fix it ?
0
Comment
Question by:cofactor
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39897537
Looks like you have missing dependencies around AOP. You probably have missing jar(s)
0
 

Author Comment

by:cofactor
ID: 39898063
Looks like you have missing dependencies around AOP...You probably have missing jar(s)
yes. I too guess that.  but I am not able to find which jar.


I already have spring-aop-3.0.5-release.jar

what else to look at here ?

(this is a struts 2.3.15 project - doing a spring integration )
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 200 total points
ID: 39898381
http://technojeeves.com/index.php/aliasjava1/7-jarsearch

Get the fullest Spring you can find and point the above at the Spring base directory with arguments

<SPRING_BASE_DIRECTORY> org/aopalliance/intercept/MethodInterceptor

and you should find the right jar (if it's there ;))
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Accepted Solution

by:
cofactor earned 0 total points
ID: 39899455
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39899903
:)
0
 

Author Closing Comment

by:cofactor
ID: 39912015
google search helped :)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question