Forums Register Login

Local EJB call - Naming Exception

+Pie Number of slices to send: Send
I am using weblogic 7.0 and i am making an local call on ejb using a client in the same environment.I am getting this exception while lookup.
Is there anything i missed in client program/ejb descriptors/weblogic descriptors.
javax.naming.NameNotFoundException: Unable to resolve 'HelloLocalHome' Resolved: '' Unresolved:'HelloLocalHome' ; remaining name 'HelloLocalHome'
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:338)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:333)
at javax.naming.InitialContext.lookup(Unknown Source)
at examples.HelloClients.main(HelloClients.java:37)
+Pie Number of slices to send: Send
We would need to see the deployment descriptors (both ejb-jar.xml and the vendor-specific one).
+Pie Number of slices to send: Send
Hi i am giving same
EJB DESCRIPTOR:
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>examples.HelloHome</home>
<remote>examples.Hello</remote>
<ejb-class>examples.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>Hello</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>examples.HelloLocalHome</local-home>
<local>examples.HelloLocal</local>
</ejb-local-ref>
</session>
</enterprise-beans>
</ejb-jar>
VENDOR SPECIFIC DESCRIPTOR:
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Hello</ejb-name>
<reference-descriptor>
<ejb-local-reference-description>
<ejb-ref-name>Hello</ejb-ref-name>
<jndi-name>HelloLocalHome</jndi-name>
</ejb-local-reference-description>
</reference-descriptor>
<clients-on-same-server>true</clients-on-same-server>
<jndi-name>HelloHome</jndi-name>
<local-jndi-name>HelloLocalHome</local-jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
+Pie Number of slices to send: Send
Send us the lookup code as well.
+Pie Number of slices to send: Send
Hi
I am providing the lookup code
Client lookup :
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
examples.HelloLocalHome home = (examples.HelloLocalHome)ctx.lookup("HelloLocalHome");
HelloLocal hello = home.create();
System.out.println(hello.hello());
hello.remove();
Calling code
java
-Djava.security.policy=../java.policy
-Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
-Djava.naming.provider.url=t3:ip ort
examples.HelloClient
thanks,
poonks
+Pie Number of slices to send: Send
Poonks,
(btw, you might want to change your name to comply with the 'Ranch naming policy)
Your code should use the following lookup string:

+Pie Number of slices to send: Send
Hey, wait a minute. Are you calling a local interface from a remote standalone client? That isn't even supposed to work.
+Pie Number of slices to send: Send
Lasse,
Can you please throw more light into it.
Am I supposed to call this from servlet/EJB only
(I will chnage name to comply with the 'Ranch naming policy)
Thanks,
poonks
+Pie Number of slices to send: Send
You can call the EJB from a standalone client but you'll have to use a remote interface instead of the local interface.
+Pie Number of slices to send: Send
That would require some changes to your client-side code:

...and ofcourse your deployment descriptors need to be changed to using <ejb-ref> instead of <ejb-local-ref>, <home> instead of <local-home>, etc.
+Pie Number of slices to send: Send
Thanks Lasse,
Actually we am planning to call Local interface one EJB from another EJB in same M/c.So initially i am trying out how to call local interface.Can you please clarify me Instead of a standalone call can i do the same call from another EJB.
Thanks in advance
poonks
+Pie Number of slices to send: Send
You can call a local interface from another EJB as long as the calling EJB is in the same .ear as the target EJB.
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1750 times.
Similar Threads
EJB Client code Error : NameNotFoundException
Entity Bean Not getting Bound to JNDI in WLS 6.1
when calling EJb , i am getting exception (javax.naming.LinkException)
Unable to resolve JMS TOPIC Name
Naming Exception 'Unable to resolve ...'
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:37:16.