tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josef Puff <josef.p...@gmail.com>
Subject Re: Bind Datasource to specific jndi name
Date Mon, 24 Jun 2019 08:10:35 GMT
Please remove me from this list.
I already tried it several times but I’m in til now so I really don’t like
to get more information about this subject.
Can anyone help me to get out?

Von: Monteiro Jean-Louis <jlmonteiro@tomitribe.com>
<jlmonteiro@tomitribe.com>
Antworten: users@tomee.apache.org <users@tomee.apache.org>
<users@tomee.apache.org>
Datum: 24. Juni 2019 at 10:08:54
An: users@tomee.apache.org <users@tomee.apache.org> <users@tomee.apache.org>
Betreff:  Re: Bind Datasource to specific jndi name

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 <
jlmonteiro@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 <kalyanfremont@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
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message