tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kalyan <kalyanfrem...@gmail.com>
Subject Re: Bind Datasource to specific jndi name
Date Fri, 21 Jun 2019 16:01:41 GMT
I really appreciate that. 

The problem i have is 

I created the datasource as 

 p.put("DS_DB", "new://Resource?type=javax.sql.DataSource");
        p.put("DS_DB.JdbcDriver", "oracle.jdbc.OracleDriver");
        p.put("DS_DB.JdbcUrl", "jdbc:oracle:thin:@xxxxxx:1521/rwdb");
        p.put("DS_DB.UserName", "ds_user");
        p.put("DS_DB.Password", "xxxxxxx");
        p.put("DS_DB.LogSql", "true");
        p.put("DS_DB.JtaManaged", "true");


InitialContext initialContext = new InitialContext(p);

            initialContext.bind("java:/DS_DB",new
                    javax.naming.LinkRef("java:openejb:Resource/DS_DB"));

Now i am trying to look up 

initialContext.lookup("java:/DS_DB")   : javax.naming.NameNotFoundException:
Name "DS_DB" not found.

But it works when i do 

initialContext.lookup("/DS_DB")
initialContext.lookup("java:openejb:Resource/DS_DB")

I am wondering, why it won't work with *java:/DS_DB*

I am using openejb-core-8.0.0-M3 . version. 

thanks
Kalyan 

    






--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Mime
View raw message