This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring AOP and AspectJ Integration with EJB3

 
Greenhorn
Posts: 5
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone give me an headstart on how to integrate Spring AOP ans AspectJ in EJB3.
So far I have figured out the following related to this.

EJB Stateless Session Bean. I am injecting the SaveCreditCardInfoDAO bean into my Controller EJB. But while I am calling the method using the instance I have injected, nothing is getting logged.



beanRefContext.xml


aopContext.xml


Advice Class


ApplicationUtil Class used to load the logger xml file.


When I run my client it gives me following error.


If I remove following line from aopContext.xml then the application runs fine but does not log anything.


All these files and classes are in the same Eclipse project. Only SaveCreditCardInfoDAO is in different project but still its instance is getting injected into the EJB.

Please advice !!!

Regards
Damodar
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you still have your classpath issue in your Eclipse project. Hopefully someone in the IDE forum will answer that other thread that I moved over there.

One other thing that I noticed that might cause you problems, is I don't think your pointcut expression is correct.

You are basically saying any method, that takes any number of parameters and returns anything, within any class, within a single package. Meaning only one package level from root. That last part is where I htink your pointcut expression is wrong.

While I never recommend a pointcut expression to be that vague because you open yourself for everything to be advised.

But if you want it all then the expression would be

execution(* *..*.*(..))

Mark
 
Damodar Wagle
Greenhorn
Posts: 5
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that new expression. I changed my expression to the new one.
I was trying to log everything so that the expression should not cause hindrance in the logging implementation. Thats the reason I kept it so vague. But anyways the problem still holds. Should I still move this issue in the IDE forum or let it be here?

Thanks and Regards
Damodar
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can stay here. But you do need to get your project classpath set correctly to use the other project in its classpath. And that is your project settings in Eclipse.

Mark
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic