You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Xiao-fei Song <xf...@yahoo.com> on 2007/07/02 11:14:27 UTC

jndi-name and sub-context

Hi all,

I am just working on geronimo v2 for a very simple ejb client application
but I got stuck on the jndi lookup part. I got 2 questions basically because
my code runs well on geronimo 1.x:

1. jndi-name specified in openejb-jar.xml does not work. Is this being
ignored or a geronimo regression?

2. when I try using deployment id as "MyEjbModule.jar/MySessionBean", the
look up returned subcontext instead of the home object, and I have a
ClassCastException while narrowing the object ref returned. The object's
class type is org.apache.openejb.client.JNDIContext instead of the home
interface.

I am currently evaluating geronimo for a large project but unfortunately I
got depearated at the very beginning phase but this really simple test. I
will appreciate if some one in the alias can respond me with anything:
anything wrong with my case, geronimo/openejb bug, whatever.

I'm okay if someone tells me in geronimo v2 the only option is to be using
application client instead of standalone remote client. But just let me know
first.

Thanks,
Chris
-- 
View this message in context: http://www.nabble.com/jndi-name-and-sub-context-tf4011031s134.html#a11390723
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: jndi-name and sub-context

Posted by Xiao-fei Song <xf...@yahoo.com>.
Hi Jarek,

Thanks for your reply. And I have decided to use application client to
continue my evaluation. I'll file a bug on the jndi-name issue.

Thanks,
Chris.


Jarek Gawor-2 wrote:
> 
> Hi,
> 
> Comments inline.
> 
> On 7/2/07, Xiao-fei Song <xf...@yahoo.com> wrote:
>>
>> Hi all,
>>
>> I am just working on geronimo v2 for a very simple ejb client application
>> but I got stuck on the jndi lookup part. I got 2 questions basically
>> because
>> my code runs well on geronimo 1.x:
>>
>> 1. jndi-name specified in openejb-jar.xml does not work. Is this being
>> ignored or a geronimo regression?
> 
> Please open a bug and hopefully somebody will address it.
> 
>> 2. when I try using deployment id as "MyEjbModule.jar/MySessionBean", the
>> look up returned subcontext instead of the home object, and I have a
>> ClassCastException while narrowing the object ref returned. The object's
>> class type is org.apache.openejb.client.JNDIContext instead of the home
>> interface.
> 
> I believe, the default JNDI name in v2 is of the following format:
> 
> {deploymentId}/{interfaceClass}
> 
> where {deploymentId} is:
> 
> {moduleId}/{ejbName}
> 
> So you want to lookup something like:
> MyEjbModule.jar/MySessionBean/my.package.SessionRemote
> 
> See
> http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxb-tests/jaxb-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBJAXBTest.java?view=markup
> for an example.
> 
> Hope this helps,
> Jarek
> 
> 

-- 
View this message in context: http://www.nabble.com/jndi-name-and-sub-context-tf4011031s134.html#a11408619
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: jndi-name and sub-context

Posted by Jarek Gawor <jg...@gmail.com>.
Hi,

Comments inline.

On 7/2/07, Xiao-fei Song <xf...@yahoo.com> wrote:
>
> Hi all,
>
> I am just working on geronimo v2 for a very simple ejb client application
> but I got stuck on the jndi lookup part. I got 2 questions basically because
> my code runs well on geronimo 1.x:
>
> 1. jndi-name specified in openejb-jar.xml does not work. Is this being
> ignored or a geronimo regression?

Please open a bug and hopefully somebody will address it.

> 2. when I try using deployment id as "MyEjbModule.jar/MySessionBean", the
> look up returned subcontext instead of the home object, and I have a
> ClassCastException while narrowing the object ref returned. The object's
> class type is org.apache.openejb.client.JNDIContext instead of the home
> interface.

I believe, the default JNDI name in v2 is of the following format:

{deploymentId}/{interfaceClass}

where {deploymentId} is:

{moduleId}/{ejbName}

So you want to lookup something like:
MyEjbModule.jar/MySessionBean/my.package.SessionRemote

See http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxb-tests/jaxb-ejb/src/test/java/org/apache/geronimo/testsuite/testset/EJBJAXBTest.java?view=markup
for an example.

Hope this helps,
Jarek