users@glassfish.java.net

Re: How to remove osgi war version from the JNDI Lookup?

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Fri, 09 Sep 2011 15:31:55 +0530

I am not sure if you are still interested in this issue or not, but I
found a portable way to assign a portable JNDI name to an EJB. You can
do something like this in your EJB:

@Stateless
*_at_EJB(name="java:global/mywar/MyEJBBean", beanName="MyEJBBean")*
public class MyEJBBean {
    ...
}

The highlighted line will add a JNDI entry called
"java:global/mywar/MyEJBBean" pointing to the EJB called MyEJBBean.

Hope this suffices your need.

Thanks,
Sahoo

On Monday 05 September 2011 09:35 AM, Sahoo wrote:
> I don't think deployment is using module-name from web.xml to
> construct the global JNDI name. Pl. file a bug against deployment.
>
> Can't you use sun-web.xml to bind the EJBs with your own JNDI name?
>
> Sahoo
> On Sunday 04 September 2011 07:28 PM, forums_at_java.net wrote:
>> Hi,
>>
>> Thanks for your answer. I defined "module-name" in web.xml, however
>> the jndi
>> name still built from Bundle-Name and Bundle-Version, like this:
>> "java:global/mywar_1.0.0.SNAPSHOT".
>>
>> <module-name>my-web</module-name>
>>
>>
>>
>> --
>>
>> [Message sent by forum member 'okna2000']
>>
>> View Post: http://forums.java.net/node/840006
>>
>>
>