This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Example problem from Spring in Action AOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Example problem from Spring in Action AOP" Watch "Example problem from Spring in Action AOP" New topic
Author

Example problem from Spring in Action AOP

Bahadir Mert Uzan
Greenhorn

Joined: Mar 27, 2009
Posts: 13
Hello everyone, I am very new to the Spring development and I want to learn in without going through expensive courses.
Because of that I bought a book Manning Spring in Action 2nd Edition. That book being much more understandable than other references
I try to follow every example with Netbeans IDE which supports Spring 2.5 library. Now I am stuck in the 2nd exercise of the first chapter
of the book.Here is the class I hope you are


Try catch is for my self because otherwise it throws a huge number of errors. So far I can catch this error

This is the XML code that should do the trick but it doesn't



I am a person who can understand things properly in their execution. So if you can help me that will be brilliant.
For the full code source code is available in http://www.manning.com/walls3/ and in that source code its chapter 1's knights example.
Once again a simple solution which I can do with Netbeans will be very appreciated.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Looks like you're missing library dependencies.
Bahadir Mert Uzan
Greenhorn

Joined: Mar 27, 2009
Posts: 13
David Newton wrote:Looks like you're missing library dependencies.


I have both used netbeans 2.5 Spring library, downloaded the zip version with dependencies and add it to my project.
Doesn't solve it. :(
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What libraries are you deploying?
Bahadir Mert Uzan
Greenhorn

Joined: Mar 27, 2009
Posts: 13
David Newton wrote:What libraries are you deploying?


Spring Framework 2.5 -
commons-logging-1.1.jar
cglib-2-2.jar
-spring-2.5.jar (sorry it's a little late in here)
alse everything from Spring-framework-2.5.6.Sec01 zip
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's "soring-2.5.jar"? In any case, when you say "everything", it'd really be a LOT more useful if you just told us what you're deploying, rather than making us do all the work.
Bahadir Mert Uzan
Greenhorn

Joined: Mar 27, 2009
Posts: 13
David Newton wrote:What's "soring-2.5.jar"? In any case, when you say "everything", it'd really be a LOT more useful if you just told us what you're deploying, rather than making us do all the work.


A very simple java application with java classes. Its about 9 simple classes and I am trying to learn AOP. I ll show you how easy the classes are.


and the other class
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not what I asked. I asked you to list, specifically, the libraries you're deploying. Or maybe how you're trying to run it. One way or another, the missing class isn't there when the program is being run.
Rendi Artha
Greenhorn

Joined: Jan 20, 2010
Posts: 29
David Newton wrote:Looks like you're missing library dependencies.


just add this library : aspectjrt.jar ---> (spring-framework-2.5.6.SEC01\lib\aspectj)

Hope this could help.
Bahadir Mert Uzan
Greenhorn

Joined: Mar 27, 2009
Posts: 13
Rendi Artawijaya wrote:
David Newton wrote:Looks like you're missing library dependencies.


just add this library : aspectjrt.jar ---> (spring-framework-2.5.6.SEC01\lib\aspectj)

Hope this could help.


Yes I add both aspectjrt.jar and aspectweaver.jar and it works. Strange I thought these would have resided in Spring Libraries that Netbeans have.
Thanks everyone.
About Deployment I don't know the details but netbeans usually do jar modification and other stuff it self. I don't think it does anything fancy.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

"Jar modification"? "Deployed" means "what jars are on the classpath when you execute the program."
Bahadir Mert Uzan
Greenhorn

Joined: Mar 27, 2009
Posts: 13
David Newton wrote:"Jar modification"? "Deployed" means "what jars are on the classpath when you execute the program."


I deploy them with these libraries attached.
(these are from libraries in Netbeans Spring Framework2.5)
commons-logging-1-1.jar
cglib-2.2.jar
spring2.5.jar

and these 2 that solved the problem

aspectjrt.jar
aspectweaver.jar
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yes, I saw that it was already solved. I was trying to clear up your confusion about terminology.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Example problem from Spring in Action AOP
 
Similar Threads
Spring AOP program not running as expected
Simple AOP not working
Spring AOP question
Spring 2.5 and AOP - BeanPostProcessor before instantiation of bean failed
Bug is Spring or meant to behave like that?