This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

bean lookup when deploying ejb application inside ear

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

When I deploy ejb.jar and app.war separately, bean lookup works perfectly. Below is the syntax which I am using:

"ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName
where appName in blank
moduleName is ejb
distinctName is blank
beanName is the bean to lookup
viewClassName is the class for the bean


But when I deploy ejb.jar inside an ear file and deploying app.war on a separate server. I am unable to lookup bean using above syntax.

Please can anyone help me on this?

Thanks,
Himanshu
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you deploy it as part of an ear, the appName part in that JNDI name, should correspond to the application name of the ear, which by default is the ear name without the .ear suffix.

P.S: If you are looking up the bean from within the same server (i.e. your client and EJB are both deployed on WildFly) then you don't need to use the WildFly specific ejb: JNDI naming scheme. You can use the portable Java EE spec supported JNDI naming scheme (which is described in the EJB spec as well as the Oracle EJB tutorials for Java EE6).
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Himanshu Mishra wrote:

But when I deploy ejb.jar inside an ear file and deploying app.war on a separate server.



I just saw this part in your original question now. If my suggestion in the previous post about using the correct appName doesn't work, then please provide more details about how exactly it fails, including any exception stacktraces.
 
Himanshu Mishra
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jaikiran,

It helped me.

I have to use name of the ear file as appName.

Thank you very much.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!