tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kalyan <>
Subject Jndi lookup for bean and datasource.
Date Thu, 20 Jun 2019 20:24:27 GMT
I have two issues with the jndi lookup. 
I am using kind of a netty server which is our home grown server. 
I used openejb to deploy the ejbs.  I don't have any EAR or WAR file. Its
jar file with contains the ejb-jar.xml etc.. 
The deployment was successful.  The container came up fine. 

*1 ) Bean lookup issue*
If you look at the jndi below

--> Ejb(deployment-id=SyncServiceBean)

what's the classpath.ear here?? from where its is coming ? i don't have any
classpath.ear file in my deployment. 

I want to lookup the bean using something like sd/SyncServiceBeanSB .

How can i do the mapping ? 

2) Datasource lookup issue 

    I created a 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:@xxxxxxx:1521/readdb");
        p.put("DS_DB.UserName", "q1_user");
        p.put("DS_DB.Password", "XXXXX");
        p.put("DS_DB.LogSql", "true");
        p.put("DS_DB.JtaManaged", "true");

     InitialContext initialContext = new InitialContext(p);

  In the code if i try to lookup with DS_DB it doesn't work 

    context.lookup("java:/DS_DB")   throws exception 

But same if i lookup as 
   context("java:openejb:Resource/DS_DB")  it works. 

I also tried with the link


Even then it doesn't work. 

Please help me solve the above two issues.. 


Sent from:

View raw message