users@glassfish.java.net

Re: looking for portable MDB example

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Thu, 11 Oct 2007 16:51:11 +0530

Scott Oaks wrote:
> I'm trying to find a portable 3.0-based MDB (and corresponding client)
> example. Everything I find invariably uses mappedName for the resource
> injection (both in the MessageDriven resource for the MDB and the
> @Resource for the client), which works well, but isn't portable.

Please see Ken's response at
http://forums.java.net/jive/thread.jspa?messageID=213415 for a detailed
explanation on using mappedName. mappedName is the vendor-specific
representation of the global JNDI resource and using it is not equivalent to
using a non-portable "vendor-specific" API for binding to a global JNDI
resource. The mappedName is ignored by the container if it does not support the
mapepdName specified.

However if you want a portable representation, I think you have to use the
vendor-specific deployment descriptor [sun-ejb-jar.xml] to specify the
resource-ref mapping between the "Name" and the "MappedName"

You could look at ejb30mdb connector devtest
[available off
http://fisheye5.cenqua.com/browse/glassfish/appserv-tests/devtests/connector/mq/ejb30mdb
or in the workspace], and remove the mappedName part of the annotation and add a
sun-ejb-jar.xml with the resource-ref mapping. Please let me know should you
need more information.

Thanks
--Siva.

>
> I realize that the portability aspect will mean I need (non-portable)
> deployment descriptors to define the linkage for the name attribute, but
> that's easier changed than the annotations in the source code.
>
> -Scott
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>