Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AspectJ LTW using Spring

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have an aspect called LoggingAspect as defined below:


My application logic is built using Spring. I have a simple JUnit test case to test my service. But I do not see the advice?? Any suggestions as to where the fault could be? Following is my aop.xml that I have in the META-INF folder of my application.

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the Spring documentation, I do not need to do any explicit LTW when I use Spring AOP like I did above in my example. But why does it fail to work? When I run my test class I fail to see the advices. Any suggestions please!
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have configured the Spring IDE on my Eclipse Helios. But why is that I could not view the aspects and advices that I have defined as above?


Screenshot.jpg
[Thumbnail for Screenshot.jpg]
Eclipse_Screenshot
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat start up now shows the following issue.

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions on this guys?
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the full stack trace:

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added context.xml for my web app and specified the Spring's Tomcat class loader. Now getting the following error:


Which jar file do I have to put under Tomcat's lib directory?
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added spring-tomcat-weaver.jar to the tomcat lib directory. But now it looks like my app itself is not deployed. Below is what I see in the log files. Also when I look at the Tomcat webapps directory, I just see my war file but the exploded war is not there.

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And of course accessing the web application gives a 404.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, got rid of this error. My context.xml under tomcat home/conf/catalina/localhost/MyWebapp.xml had a wrong entry for the docBase. It was pointing to my development directory rather than the exploded war directory in Tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic