Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb 3.0 client in WebLogic

 
Ritesh Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am migrating my existing ejb2.0 project to ejb3.0.
In my project bean is called from a action class and not from servlet.

Now while trying to call my bean via @EJB I am getting NullPointerException.
The same is working fine if I am calling my bean from the servlet using @EJB.

Thanks in Advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34372
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ritesh,
The dependency injection annotations only work from Servlet or EJB classes. You'll need to continue looking up the bean from the JNDI in the action.
 
Ritesh Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Thanks for your reply.
But in case of using JNDI lookup, I will need to maintain weblogic.xml for the jndi name?
Moreover I will also need to maintain the other DD's which will make the implementation as it was when I was using ejb 2.0

Is there any way out of this??
Hope to get some advise.

Thanks once again.

Regards,
Ritesh
 
Ritesh Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Had been trying to call my ejb 3.0, but am unsuccessful.
Can any body suggest me on the same.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic