tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rde8026 <rde8...@gmail.com>
Subject HELP! JNDI DataSource Name
Date Fri, 19 Sep 2008 22:10:29 GMT

Hello,

I'm sorry to post to message; I've seen a bunch of messages like this posted
but everything I've read and tried doesn't seem to work and I have no idea
why.....

I'm trying to get a reference to a Container Managed DataSource (configured
in my openejb.xml file).  I can get the reference via the @Resource
annotation but I am unable to get the resource via standard JNDI.

here is my code




Object obj1 = new
javax.naming.InitialContext().lookup("java:openejb/Resource/JTADS");
I've also tried it like this:
Properties props = new Properties();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
javax.naming.Context ctx = new javax.naming.InitialContext(props);
Object obj1 = ctx.lookup("java:openejb/Resource/JTADS");

I always get this error: NameNotFoundException: Name
"java:openejb/Resource/JTADS" not found.

Now the reason I need to understand the correct JNDI name is so I can use it
as a Hibernate Property (hibernate.connection.datasource).

I'm using openejb 3.1 SNAPSHOT and Hibernate hibernate-3.2.5.ga.

Any ideas?  I'm totally lost...as I understand it this should just work...
Thanks in advance....



-- 
View this message in context: http://www.nabble.com/HELP%21-JNDI-DataSource-Name-tp19579867p19579867.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message