The Java EE platform specification defines the following JNDI contexts:

java:comp - The namespace is scoped to the current component (i.e. EJB)
java:module - Scoped to the current module
java:app - Scoped to the current application
java:global - Scoped to the application server

-
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Mon, Jun 24, 2019 at 10:05 AM Jean-Louis Monteiro <
jlmonte...@tomitribe.com> wrote:

> Hi,
>
> Sorry for the delay.
> I have looked at the question and there is an alias="name1,name2"
> attribute you can use to define different aliases for the same resource.
>
> It is useful when you are migrating from another app server.
>
> That being said, the "java:" namespace in jndi is restricted per spec, so
> I'm not sure you will be able to define the name you want.
>
> Give it a try and let us know anyway.
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>
>
> On Fri, Jun 21, 2019 at 6:01 PM Kalyan <kalyanfrem...@gmail.com> wrote:
>
>> 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
>>
>

Reply via email to