users@glassfish.java.net

Re: Mapping MDB to Activation Spec?

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Sep 2008 02:50:27 PDT

Hi Ivo

> .... 1) the sun-ejb-jar.xml in the examples declare the
> element 'mdb-resource-adapter-mid'. That means the
> software developer is forced to use the same
> module-id as on testsystem, and on all other systems
> (integration, education, production etc)
> the adapter must have the same id which is known to
> the developer

Yes, the resource-adapter-mid element must point to the module name of the resource adapter archive deployed in that particular target instance.

> 2) the ejb-jar.xml contains the activation config
> properties. so the developer must know about
> queuenames, usernames, passwords, poolsizes etc and
> all settings must be the same for all environments
> (test, integration, education, production etc)?

Activation configuration properties like destinations, username,
password which may be need to be overridden during
deployment time can also be placed in sun-ejb-jar.xml. The
activation-config values specified in sun-ejb-jar.xml will
override the values placed in ejb-jar.xml.

Just to clarify, the value specified for a destination is usually
the JNDI name of a connector resource. The connector resource
in turn points to the actual destination. So when you are moving across
deployment targets (from testing to production), your asadmin
scripts that creates the connector resources could modify the actual
Destination pointed by the connector resource with no change needed
in the application.

I do agree that changing usernames and passwords
are a problem. Again if all your connection factories and
ActivationSpecs use the same username/password, and the
resource adapter supports setting of the username/password at the
resource adapter level, you could again script this by creating a
deployment-target-specific resource-adapter-config

> In Websphere Application server, the
> ibm-ejb-jar-bnd.xmi (ibm pendant to sun-ejb-jar.xml)
> declares a jndi reference to the activation spec, the
> activation spec is administered in the server. So the
> developer can use his own settings
> (maybee even another JMS Provider), and all other
> environments can be configured by the activation
> spec. Is there an equivalent way to do this in
> glassfish, maybee using JNDI Resources (Custom /
> External) and if so, how to reference it from
> sun-ejb-jar.xml?

Unfortunately GlassFish does not yet have a mechanism to
externalize activation spec configuration information (in JNDI/elsewhere).
The only way out today is to swap out sun-ejb-jar.xml when you move
from one deployment target (test) to another (production).

HTH
Thanks
--Siva.
[Message sent by forum member 'sivakumart' (sivakumart)]

http://forums.java.net/jive/thread.jspa?messageID=299778