Register / Login
Win a copy of
The Way of the Web Tester: A Beginner's Guide to Automating Tests
this week in the
EJB and other Java EE Technologies
How to map Global JNDI name and ENC.
posted 7 years ago
In Glassfish, I have created a global JNDI name :
JNDI name = jdbc/abcd .
And in my code, I tried to inject the resource with the same name:
private static DataSource ds;
I assume that this will be interpreted as Environment Naming Context (ENC) name :
Fortunately I think Glassfish will automatically resolve ENC name to global JNDI name if a resource with the same Global JNDI name exists.
But what if I have :
And still my global JNDI name on server is jdbc/abcd.
How to provide the mapping between ENC (java:comp/env/Some_Portable_JNDI_Name) and Global JNDI name (jdbc/abcd) in this case?
I think I have to provide this mapping in Glassfish specific deployment descriptor?
May I know waht is that and how to provide mapping?
I dont want to rely on mappedName property of @Resource annotation as that makes code difficult to port.
Arun Kumar Kandregula.
SCBCD 1.3 92%
SCJP 1.4 98%
doubt in enthuware com.enthuware.ets.scbcd.v5.2.12 - Objective Bean Environment
JNDI mapping in Weblogic
Numerous questions on JNDI
Global JNI Vs ENC
datasource for mysql