You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by weberjn <we...@gmail.com> on 2008/08/05 18:49:54 UTC

JNDI name for Java client to 2.1 EJB

Hi,

I try to access a 2.1 style EJB in Geronimo 2.1 (with xml deployment
descriptors)

I defined this JNDI name in openejb.xml

<enterprise-beans>
                <session>
                        <ejb-name>MyBean</ejb-name>
                        <jndi-name>MyBean</jndi-name> 

I tried a JNDI lookup from a Java client using these properties:

java.naming.factory.initial=org.openejb.client.RemoteInitialContextFactory
java.naming.provider.url=localhost:4201
java.naming.security.principal=system
java.naming.security.credentials=manager


I tried to look up "MyBean" in an InitialContext:

Caused by: javax.naming.NameNotFoundException: /MyBean does not exist in the
system.  Check that the app was successfully deployed.

With "java:MyBean":

javax.naming.NameNotFoundException: MyBean does not exist in the system. 
Check that the app was successfully deployed. 

I would guess that the one specified with <jndi-name> would be correct, but
this isn't so.

What is the right JNDI name?

Thanks,
Juergen



-- 
View this message in context: http://www.nabble.com/JNDI-name-for-Java-client-to-2.1-EJB-tp18835233s134p18835233.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JNDI name for Java client to 2.1 EJB

Posted by David Blevins <da...@visi.com>.
On Aug 8, 2008, at 7:16 AM, weberj wrote:

>
> Now I got to run the bank sample
> http://cwiki.apache.org/confluence/display/GMOxDOC12/EJB+sample+application+(1.2+Ok)
>
> The client also throws
>
>     [java] javax.naming.NameNotFoundException:
> /org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean does not  
> exist
> in the system.  Check that the app was successfully deployed.

As it seems our <jndi-name> element is still broke, the config/ 
bank_client.properties needs to be updated to:

   jndi.bankManager=BankManagerFacadeBeanRemoteHome


Added a JIRA for fixing the <jndi-name> and related elements:

https://issues.apache.org/jira/browse/GERONIMO-4237

-David


Re: JNDI name for Java client to 2.1 EJB

Posted by weberj <we...@yahoo.com>.
Now I got to run the bank sample 
http://cwiki.apache.org/confluence/display/GMOxDOC12/EJB+sample+application+(1.2+Ok)

The client also throws 

     [java] javax.naming.NameNotFoundException:
/org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean does not exist
in the system.  Check that the app was successfully deployed.
-- 
View this message in context: http://www.nabble.com/JNDI-name-for-Java-client-to-2.1-EJB-tp18835233s134p18892610.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JNDI name for Java client to 2.1 EJB

Posted by weberj <we...@yahoo.com>.

David Blevins wrote:
> 
> On Aug 5, 2008, at 11:01 AM, chi.botron wrote:
> 
>> weberjn wrote:
>>>
>>> I defined this JNDI name in openejb.xml
> 
> Double check the file is called openejb-jar.xml and not openejb.xml.
> 
It's openejb-jar.xml and it is taken (I put a typo into <xenterprise-beans>
and this gets noticed).

Where should the JNDI name appear in JNDI viewer? Below SessionBeans -
MyBean ? 
There is java:comp/HandleDelegate and more but no MyBean.




-- 
View this message in context: http://www.nabble.com/JNDI-name-for-Java-client-to-2.1-EJB-tp18835233s134p18866708.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JNDI name for Java client to 2.1 EJB

Posted by David Blevins <da...@visi.com>.
On Aug 6, 2008, at 5:34 AM, chi.botron wrote:

>
> I am running Geronimo 2.1.1 and the <jndi-name> elements and <jndi>  
> elements
> have not worked for me.
>
> I even used the Context.list("/") method to try to see all of the  
> JNDI names
> in the JNDI tree and only the default names show up.

That's unfortunate.  I'll definitely have a look at this.

-David


>
>
>
> David Blevins wrote:
>>
>> On Aug 5, 2008, at 11:01 AM, chi.botron wrote:
>>
>>>
>>> I had the same problem.  It looks like the <jndi-name> element is
>>> totally
>>> ignored in the deployment descriptor.
>>
>> It was in Geronimo 2.0, but it should work in Geronimo 2.1. G 2.1  
>> also
>> has a new <jndi> element for specifying the name [1] which supports
>> EJB 3.0 business interfaces.
>>
>>
>> [1]
>> http://cwiki.apache.org/GMOxDOC21/client-jndi-names.html#ClientJNDINames-SettingtheJNDIname
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/JNDI-name-for-Java-client-to-2.1-EJB-tp18835233s134p18850242.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>
>


Re: JNDI name for Java client to 2.1 EJB

Posted by "chi.botron" <cf...@benefitsxml.com>.
I am running Geronimo 2.1.1 and the <jndi-name> elements and <jndi> elements
have not worked for me.

I even used the Context.list("/") method to try to see all of the JNDI names
in the JNDI tree and only the default names show up.


David Blevins wrote:
> 
> On Aug 5, 2008, at 11:01 AM, chi.botron wrote:
> 
>>
>> I had the same problem.  It looks like the <jndi-name> element is  
>> totally
>> ignored in the deployment descriptor.
> 
> It was in Geronimo 2.0, but it should work in Geronimo 2.1. G 2.1 also  
> has a new <jndi> element for specifying the name [1] which supports  
> EJB 3.0 business interfaces.
> 
> 
> [1]
> http://cwiki.apache.org/GMOxDOC21/client-jndi-names.html#ClientJNDINames-SettingtheJNDIname
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JNDI-name-for-Java-client-to-2.1-EJB-tp18835233s134p18850242.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: JNDI name for Java client to 2.1 EJB

Posted by David Blevins <da...@visi.com>.
On Aug 5, 2008, at 11:01 AM, chi.botron wrote:

>
> I had the same problem.  It looks like the <jndi-name> element is  
> totally
> ignored in the deployment descriptor.

It was in Geronimo 2.0, but it should work in Geronimo 2.1. G 2.1 also  
has a new <jndi> element for specifying the name [1] which supports  
EJB 3.0 business interfaces.

> weberjn wrote:
>>
>> I defined this JNDI name in openejb.xml

Double check the file is called openejb-jar.xml and not openejb.xml.

>>
>> <enterprise-beans>
>>                <session>
>>                        <ejb-name>MyBean</ejb-name>
>>                        <jndi-name>MyBean</jndi-name>
[..]
>> I tried to look up "MyBean" in an InitialContext:
>>
>> Caused by: javax.naming.NameNotFoundException: /MyBean does not  
>> exist in
>> the system.  Check that the app was successfully deployed.

This should have worked.

>> With "java:MyBean":
>>
>> javax.naming.NameNotFoundException: MyBean does not exist in the  
>> system.
>> Check that the app was successfully deployed.

This one definitely won't as the "java:" isn't supported in plain java  
clients.

-David

[1] http://cwiki.apache.org/GMOxDOC21/client-jndi-names.html#ClientJNDINames-SettingtheJNDIname


Re: JNDI name for Java client to 2.1 EJB

Posted by "chi.botron" <cf...@benefitsxml.com>.
I had the same problem.  It looks like the <jndi-name> element is totally
ignored in the deployment descriptor.

What you will find however is that OpenEJB automatically creates JNDI
entries for your EJBs Remote and Local interfaces automatically using the
default names.  

I bet if you try looking up "MyBeanRemoteHome" instead of "MyBean", you will
find your EJB.



weberjn wrote:
> 
> Hi,
> 
> I try to access a 2.1 style EJB in Geronimo 2.1 (with xml deployment
> descriptors)
> 
> I defined this JNDI name in openejb.xml
> 
> <enterprise-beans>
>                 <session>
>                         <ejb-name>MyBean</ejb-name>
>                         <jndi-name>MyBean</jndi-name> 
> 
> I tried a JNDI lookup from a Java client using these properties:
> 
> java.naming.factory.initial=org.openejb.client.RemoteInitialContextFactory
> java.naming.provider.url=localhost:4201
> java.naming.security.principal=system
> java.naming.security.credentials=manager
> 
> 
> I tried to look up "MyBean" in an InitialContext:
> 
> Caused by: javax.naming.NameNotFoundException: /MyBean does not exist in
> the system.  Check that the app was successfully deployed.
> 
> With "java:MyBean":
> 
> javax.naming.NameNotFoundException: MyBean does not exist in the system. 
> Check that the app was successfully deployed. 
> 
> I would guess that the one specified with <jndi-name> would be correct,
> but this isn't so.
> 
> What is the right JNDI name?
> 
> Thanks,
> Juergen
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JNDI-name-for-Java-client-to-2.1-EJB-tp18835233s134p18836702.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.