• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

@Ejb annotation does not work

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I completed SCJP in December 2009 and after a long time i decided to take SCBCD exam. I am reading "EJB 3 in action" and writing code in Eclipse and using JBoss. I started with "Hello world" but I have difficulty working on @EJB annotation for Dependency injection. Can some one tell me how to make it work?
 
Ranch Hand
Posts: 109
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friend,

@EJB annotation can use to inject server side beans such as Stateless, Stateful or MessageDriven into a another server side bean such as java server side application client, another EJB or or web components like servlets, JSP. But you can't use @EJB annotation in a not server side java application. Therefore you have to use JNDI lookup to inject server side beans into non server side java applications.

So vijayakrishna in your case we can't figure out what you are going to inject using @EJB. So if you post your code it will be easy to figure out what the problem is.
 
Ranch Hand
Posts: 92
Android Eclipse IDE Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use also the @EJB annotation to inject an EJB3 bean reference in a client java application, if you run it in ACC (Aplication Client Container) that comes for example with GlassFish.
 
Get me the mayor's office! I need to tell her about this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic