• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help accessing an EJB from outside my container

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • 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

 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!