Solved

java.lang.ClassNotFoundException   error

Posted on 2014-03-01
6
2,222 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 45
starter POM and spring-boot-starter,  spring-boot-web 2 54
xampp tool 12 50
pagenation logic how it is working in my code 1 30
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

777 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