geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan <xhh...@gmail.com>
Subject How to build app and global scope jndi namespace for client application ?
Date Wed, 06 Jul 2011 14:41:03 GMT
Hi, I am looking at a sample about using app scope jndi entry in client
application. The sample is an ear package, the structure is like :
a.ear
      /lib/lib.jar
     client.jar
     ejb.jar

In the lib.jar, there is a persistence.xml file in the meta-inf folder, and
in the application.xml, there is an entry like

<persistence-unit-ref>
    <persistence-unit-ref-name>java:app/env/pu</persistence-unit-ref-name>
  </persistence-unit-ref>

In the deployment process, EARConfigBuilder will use those naming builder to
create a PersistenceUnitReference in the java:app scope, and the reference
points to the abstractName of the PU found in the lib.jar. So far, it is
fine.But for the application client module, as app scope jndi is shareable
with the server side. It has the same PURference, but unfortunately, it
points to an unexisted PU GBean name. For fixing this, one way is to update
the PUReference in the app scope map for the application client module, we
might construct the AbstractName on the fly, might be we just need to update
the configuration name and some other properties. Another possible solution
is that, while processing the naming in other modules, if we found the jndi
reference is of app and global scope, let's keep them in a temporary
structure. Later, when processing the jndi entry for application client, we
adds all those entry to the application-client.xml file. So that application
client will use each naming builder to create the correct jndi reference for
themselves. That means, for application client modules, it will not share
the same map with other modules. This solution also have some issues, if we
have more than one application client, and each of them configures some
global and app jndi entry, those entries might lost for other modules,
including those web modules, ejb modules, and other client modules in the
same ear package.

Any idea for this ? Thanks.
-- 
Ivan

Mime
View raw message