[jboss-user] [JNDI and Naming] - How to do global JNDI lookup
Viggo Navarsete
do-not-reply at jboss.com
Fri Feb 25 05:01:07 EST 2011
Viggo Navarsete [http://community.jboss.org/people/viggo.navarsete] created the discussion
"How to do global JNDI lookup"
To view the discussion, visit: http://community.jboss.org/message/589706#589706
--------------------------------------------------------------
Hi,
given that my global JNDI tree looks like this:
h1. global JNDI Namespace
+- UserTransactionSessionFactory (proxy: $Proxy175 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
+- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
+- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
+- SecureDeploymentManager (class: org.jnp.interfaces.NamingContext)
| +- remote[link -> DeploymentManager] (class: javax.naming.LinkRef)
+- SecureManagementView (class: org.jnp.interfaces.NamingContext)
| +- remote[link -> ManagementView] (class: javax.naming.LinkRef)
+- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)
+- mds-ear-1.3.1-SNAPSHOT (class: org.jnp.interfaces.NamingContext)
| +- RbacBean (class: org.jnp.interfaces.NamingContext)
| | +- local-com.tracetracker.mds.adm.business.RbacLocal (class: Proxy for: com.tracetracker.mds.adm.business.RbacLocal)
| | +- local (class: Proxy for: com.tracetracker.mds.adm.business.RbacLocal)
| +- MasterDataBean (class: org.jnp.interfaces.NamingContext)
| | +- local (class: Proxy for: com.tracetracker.mds.adm.business.MasterDataLocal)
| | +- local-com.tracetracker.mds.adm.business.MasterDataLocal (class: Proxy for: com.tracetracker.mds.adm.business.MasterDataLocal)
| +- MasterDataXMLValidatorBean (class: org.jnp.interfaces.NamingContext)
| | +- local (class: Proxy for: com.tracetracker.mds.adm.business.MasterDataXMLValidatorLocal)
| | +- local-com.tracetracker.mds.adm.business.MasterDataXMLValidatorLocal (class: Proxy for: com.tracetracker.mds.adm.business.MasterDataXMLValidatorLocal)
| +- MDDValidatorBean (class: org.jnp.interfaces.NamingContext)
| | +- local (class: Proxy for: com.tracetracker.mds.adm.business.MDDValidatorLocal)
how do I write code to lookup MasterDataBean in JBoss 6.0.0.Final?
The convention is (as far as I know) this:
java:global[/<app-name>]/<module-name>/<bean-name>[!<fully-qualified-interface-name>]
which should translate to this code (but doesn't currently work!):
InitialContext ctx = new InitialContext();
Object obj = ctx.lookup( "java:global/mds-ear-1.3.1-SNAPSHOT/MasterDataBean" );
private MasterDataLocal masterDataService = (MasterDataLocal) obj;
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/589706#589706]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110225/9c9e2411/attachment.html
More information about the jboss-user
mailing list