[jboss-user] [EJB 3.0] - InitialContext reference and definition

davestar do-not-reply at jboss.com
Tue Jan 20 13:02:40 EST 2009


My Session EJB is successfully deployed in JBoss 4.2.2 and here's the entry in the Global JNDI Namespace from the JMX console.
  +- MXIntegrationEAR (class: org.jnp.interfaces.NamingContext)
  |   |   +- BurdenRateFacade (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- local (proxy: $Proxy80 implements interface gov.usbr.data.cdw.BurdenRateFacadeLocal,interface org.jboss.ejb3.JBossProxy)
  |   |   |   +- remote (proxy: $Proxy78 implements interface gov.usbr.data.cdw.BurdenRateFacadeRemote,interface org.jboss.ejb3.JBossProxy)

In my client code where I try to get a local reference of the EJB, this runs with a main method from a java class that is not deployed in the App server.
When I do a 
Context ctx = new InitialContext()
  | ctx.lookup("BurdenRateFacade")

I get a 
anonymous wrote : javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter

Do I need to define an ejb-jar.xml? with some entries like these?
<ejb-local-ref>
  |     <ejb-ref-name>ejb/Test</ejb-ref-name>
  |     <ejb-ref-type>Session</ejb-ref-type>
  |     <local>Test</local>
  | </ejb-local-ref>


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4203371#4203371

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4203371



More information about the jboss-user mailing list