• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help accessing an EJB from outside my container

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm using Resin 3.0.19 (as my web/app containers) and I'm trying to access an EJB that is running locally. Problem is, when I'm outside my container, I don't know how to generate a context that has access to the EJB. Here is the code I'm using to access ...



where REMOTE_SERVICE_JNDI is defined as "java:comp/env/ejb/InterlockServiceBean". However, upon running this code I'm getting a lookup exception, caused by "javax.naming.NoInitialContextException: Need to specify class name in environment or system property
, or as an applet parameter, or in an application resource file: java.naming.factory.initial".


Any info you can provide is most appreciated, - Dave

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You will need a jndi.properties file which contains the initial context factory class and the provider url properties. The Resin documentation will have more details about the exact values for these properties.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Although the EJB runs in a resin container, do the jndi.properties' factory values have to be Resin specific? I know the provider URL for the EJB, so isn't there another factory I can use to generate a context?

Thanks for your help, - Dave
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Alvarado wrote:Although the EJB runs in a resin container, do the jndi.properties' factory values have to be Resin specific?



Yes, the initial context property values, are application server specific.
reply
    Bookmark Topic Watch Topic
  • New Topic