aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Calling EJB from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Calling EJB from servlet" Watch "Calling EJB from servlet" New topic
Author

Calling EJB from servlet

eric Akortse
Greenhorn

Joined: Mar 31, 2011
Posts: 1
Hi, I am a newbie in web applications and I am trying to develop all by myself an enterprise application using Eclipse helios and jboss 6. I am having problems injecting my ejb class which is in my EJB module into my servlet which is in my Web module. In other words the are in separate locations. I feel my servlet cannot see my ejb when I use @EJB annotations to inject it. I would like to know what I am doing wrong, please. My codes are as followed...






And following is my code for my servlet...



In the doGet() of my servlet I have the SignOnRemote underlined in my eclipse to be an error which says SignOnRemote cannot be resolved to a type.
As I said earlier on, they are all in different modules. Any help will be very appreciated

Thanks
Sudhakar Sharma
Ranch Hand

Joined: Apr 04, 2009
Posts: 71

I think you should use mapped-name in the look up code instead of "InstituteEAR/SignOnBean/remote" use "SignOnBean/remote" only.
Nico Van Brandt
Ranch Hand

Joined: Mar 31, 2011
Posts: 66

I'm a bit of a beginner myself on EJB3, but I find myself thinking why your bean is abstract?


Oracle Java SE6 Certified Programmer
Oracle Java EE5 Certified Web Component Developer
Sudhakar Sharma
Ranch Hand

Joined: Apr 04, 2009
Posts: 71

Nico Van Belle wrote:I'm a bit of a beginner myself on EJB3, but I find myself thinking why your bean is abstract?


thanks nico van belle for remembering me the programming restriction of EJB. that's true bean class cannot be abstract or final.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling EJB from servlet
 
Similar Threads
java.lang.NoClassDefFoundError
Stub cannot be cast to Interface
Problem facing in Ejb execution in eclipse IDE
EJB Single Timer Bean Implementation
Problem facing in Ejb execution in eclipse IDE