Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling EJB from servlet

 
eric Akortse
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a bit of a beginner myself on EJB3, but I find myself thinking why your bean is abstract?
 
Sudhakar Sharma
Ranch Hand
Posts: 71
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic