Solved

java.lang.ClassNotFoundException   error

Posted on 2014-03-01
6
2,160 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now