-
1. Re: InitialContext for ejb lookup locally in Jboss as 7.1.3 Final
jaikiran May 7, 2013 3:46 AM (in response to georgesg)Local lookup doesn't require EJB client protocol (ejb: ). ejb: is only meant for remote views.
-
2. Re: InitialContext for ejb lookup locally in Jboss as 7.1.3 Final
georgesg May 7, 2013 3:51 AM (in response to jaikiran)So, for local lookup using ejb 2.1, i can do the lookup as below ?
InitialContext context = new InitialContext();
Object = context.lookup("java:app/MobilematrixCX_ejb-1.0.0-SNAPSHOT/com.cassis.cx.base.Dispatcher!com.cassis.cx.base.Dispatcher_LocalHome");
Earlier in Jboss 4.3, we set the below values for Initial Context,
<initial-context name="PX">
<name-value-pair>
<name>java.naming.factory.initial</name>
<value>org.jnp.interfaces.NamingContextFactory</value>
</name-value-pair>
<name-value-pair>
<name>java.naming.provider.url</name>
<value>jnp://127.0.0.1:21119</value>
</name-value-pair>
<name-value-pair>
<name>java.naming.factory.url.pkgs</name>
<value>org.jboss.naming:org.jnp.interfaces</value>
</name-value-pair>
</initial-context
-
3. Re: InitialContext for ejb lookup locally in Jboss as 7.1.3 Final
jaikiran May 7, 2013 3:57 AM (in response to georgesg)Yes, you can use the java:global, java:app, java:module namespaces as defined by the spec. In fact, you can even use those namespaces for remote EJB views, if the EJB is deployed on the same server as the client.
-
4. Re: InitialContext for ejb lookup locally in Jboss as 7.1.3 Final
georgesg May 7, 2013 4:09 AM (in response to jaikiran)Thanks Jaikiran.
Now am clear on JNDI lookup. But my primary confusion is with regard to the Initial context Instantiation. Because, if you look at the below InitialContext parameters, In Jboss 4.3.GA , they use "JNP" protocol for Package Prefix as well as for Initial Context Factory. So, when i Instantiate InitialContext in JBOSS EAP 6 (7.1.3 Final) , How will i do Instantiation of InitialContext for a local lookup ? Should i need to instantiate something like below or just InitialContext context = new InitialContext(); will do the job ?
<initial-context name="PX">
<name-value-pair>
<name>java.naming.factory.initial</name>
<value>org.jnp.interfaces.NamingContextFactory</value>
</name-value-pair>
<name-value-pair>
<name>java.naming.provider.url</name>
<value>jnp://127.0.0.1:21119</value>
</name-value-pair>
<name-value-pair>
<name>java.naming.factory.url.pkgs</name>
<value>org.jboss.naming:org.jnp.interfaces</value>
</name-value-pair>
</initial-context
-
5. Re: InitialContext for ejb lookup locally in Jboss as 7.1.3 Final
jaikiran May 7, 2013 4:11 AM (in response to georgesg)ANAND KUMAR GEORGE PREM KUMAR wrote:
just InitialContext context = new InitialContext(); will do the job ?
Yes that should work.