-
1. Re: Naming Exception when I try to search the context
adrian.brock Feb 26, 2003 10:44 AM (in response to wnchoi)<ejb-ref>
<ejb-ref-name>ejb/test/DemoSession</ejb-ref-name>
defines
java:comp/env/ejb/test/DemoSession
<jndi-name> should be the global jndi name of the bean,
you don't provide your deployment descriptors so I can't
tell you what it is.
Regards,
Adrian -
2. Re: Naming Exception when I try to search the context
wnchoi Feb 26, 2003 11:07 AM (in response to wnchoi)Adrian,
Thank you for your reply. First of all, I don't know what is global JNDI, so could you tell me more about this?
In addition, the the descriptor values changed as you suggestioned, I got the error "Caugth exception: ejb not bound"
Any idea for me? Many Many thanks !!
Kenny -
3. Re: Naming Exception when I try to search the context
adrian.brock Feb 26, 2003 12:25 PM (in response to wnchoi)You still haven't posted your deployment descriptors.
By default jboss binds the ejb into global jndi
at <ejb-name> unless you specify <jndi-name> in jboss.xml
Assuming your ejb has just
<ejb-name>DemoSession</ejb-name>
You woud write
<ejb-ref>
<ejb-ref-name>ejb/test/DemoSession</ejb-ref-name>
<jndi-name>DemoSession</jndi-name>
</ejb-ref>
The lookup
java:comp/env/ejb/test/DemoSession
For more info look at
docs/dtd/jboss_3_0.dtd
docs/dtd/jboss-web_3_0.dtd
Regards,
Adrian -
4. Re: Naming Exception when I try to search the context
bman917 Feb 26, 2003 10:54 PM (in response to wnchoi)The <ejb-ref> element defines a reference from one bean to another. So in the xml you wrote your telling jboss the your session bean needs a reference to another session bean.
To fix the problem, I suggest you remove the whole <ejb-ref> thing. Your webclient doesn't need it also. Remove all the <ejb-ref>s from your xmls.
The lookup call you should use in your client should be the <ejb-name> of your bean. For example, if you typed your ejb-name like this:
<ejb-name>DemoSession</ejb-name>
then you should have a lookup call like this:
(DemoSessionHome)PortableRemoteObject.narrow(IContext.lookup("DemoSessionHome"), DemoSessionHome.class)
The Home object is an RMI-IIOP objects and so the must be cast into RMI-IIOP objects using a special RMI-OOP cast. In short, usign PortableRemoteObject.narrow(...) is the proper way of casting a remote object. -
5. Re: Naming Exception when I try to search the context
wnchoi Mar 5, 2003 7:25 PM (in response to wnchoi)Adrian/Jacky,
Thank you very much for your support. Now I could deploy ejb to my jBoss. However, I tried session bean only and believe will hit more problem on ejb deployment on the coming futher. This forum must be the way for me to find the answer.
Thanks,
Kenny
:)