• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in configiring Spring aspects

 
RajivAwadhesh kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I tried the example of Spring aspects given in Spring in Action 3rd Edition(Manning).
I am having the problem while running the example.
Following are the java source files and xml configuration file.


"knights.xml"










The error am getting is follows




Please suggest what is the error?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are misisng the aopalliance.jar file from your classpath. To use Spring and Spring AOP requires jar files in your classpath. It is more than just one jar, and it appears that you have at least one jar missing.

Mark
 
RajivAwadhesh kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added the necessary jars.. I had thought that all jars would be available with
the Spring 3.0 distribution i downloaded and added in my classpath.

But few of the jars were missing..When aop is integral to Spring
i cant understand why we have to add some jars separately
 
Mohit J Kumar
Ranch Hand
Posts: 33
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hell Everyone,

I am getting the exact same error. I am also following Spring in Action 3rd edition and trying the same example.

After a lot of google search I found that the best possible way to resolve this is to add aopalliance.jar seperately.

I also tried adding: aopalliance.jar & aopalliance-alpha1.jar individually and together but the error won't go away.

Please help.

Is there any other jar I need to add in addition to aopalliance.jar. I am using Spring 3.2

Thanks
~Mohit
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohit, based on your request here

I managed to get this running.. but oops.. with Maven..

but I guess since you have the project in Eclipse and this seems to be an dependency issue you could check if you have all these dependencies in the project build path..

MAVENREPOSITORY\repository\org\aspectj\aspectjweaver\1.8.2\aspectjweaver-1.8.2.jar
MAVENREPOSITORY\repository\org\slf4j\jcl-over-slf4j\1.7.5\jcl-over-slf4j-1.7.5.jar
MAVENREPOSITORY\repository\org\slf4j\slf4j-api\1.7.5\slf4j-api-1.7.5.jar
MAVENREPOSITORY\repository\org\springframework\spring-core\4.0.0.RELEASE\spring-core-4.0.0.RELEASE.jar
MAVENREPOSITORY\repository\org\springframework\spring-context\4.0.0.RELEASE\spring-context-4.0.0.RELEASE.jar
MAVENREPOSITORY\repository\org\springframework\spring-aop\4.0.0.RELEASE\spring-aop-4.0.0.RELEASE.jar
MAVENREPOSITORY\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
MAVENREPOSITORY\repository\org\springframework\spring-beans\4.0.0.RELEASE\spring-beans-4.0.0.RELEASE.jar
MAVENREPOSITORY\repository\org\springframework\spring-expression\4.0.0.RELEASE\spring-expression-4.0.0.RELEASE.jar

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic