Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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

Calling EJB from servlet

 
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
 
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.
 
Ranch Hand
Posts: 74
  • 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.
 
Get me the mayor's office! I need to tell her about this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic