File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes AspectJ LTW using Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "AspectJ LTW using Spring" Watch "AspectJ LTW using Spring" New topic
Author

AspectJ LTW using Spring

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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.


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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?





[Thumbnail for Screenshot.jpg]

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Tomcat start up now shows the following issue.

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Any suggestions on this guys?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

So the full stack trace:

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

And of course accessing the web application gives a 404.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AspectJ LTW using Spring
 
Similar Threads
This week book give away
Spring AOP and AspectJ Integration with EJB3
AOP Not working with Spring 3 MVC application
Problem with Spring AOP
jboss-aop configuration help