dev@glassfish.java.net

Re: What is the default mapped-name, if any, for an MDB in EJB3?

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Fri, 19 May 2006 13:18:40 -0400

Hi, Peter

>>>> So in your case, you would need to
>>>>
>>>> 1. provide mapped-name through deployment descriptor (or mappedName
>>>> attribute within the @javax.ejb.MessageDriven annotation).
>>>> OR
>>>> 2. specify the global jndi-name in sun-ejb-jar.xml
>>>>
>>>> Note: when both are present, the jndi-name in sun-ejb-jar.xml
>>>> overrides the value specified through mapped-name element (or the
>>>> mappedName attribute).
>>>
>>> Thanks for this information.
>>>
>>> I can work with this. I was hoping for a default name though :(
>>> I will have to generate a jndi-name for the NetBeans user in cases
>>> where they do not specify a mapped name in the MDB wizard.
>>
>>
>> How would you know what jndi name to generate? In the case when there
>> are multiple external jms resources, how do you determine which one
>> is the one you should use?
>
> We also generate the resource.

If you know which resource the MDB should map to, even if the user
specifies the mapped name later, it should point to the same resource?
In that case, the user doesn't need to manually delete the jndi-name
information the netbeans created because it's the same thing whether the
jndi name overrides the mapped name or not...

Thanks,

- Hong