• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in lookup datasource

 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have deployed a datasource in JBoss server with look up name as "myds/OrcleDS"
And i am able to get the intial context.
on context when i call ctx.lookup("myds/OrcleDS");

I am getting error
javax.naming.NameNotFoundException: myds not bound

Its not taking the "myds/OracleDS" instead taking "myds" only...

how can i resolve this one...


Thanks in advance..
Bala.
 
Jan Cumps
Bartender
Posts: 2602
13
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have moved this post to our JBoss forum. It is about setting up JNDI resources in JBoss, and consuming them in jour application.

Regards, Jan
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How have you configured and deployed your datasource. The JNDI names are hierarchical. The naming parser splits it on the "/" character. So the error message first tries to find the myDS name in the global jndi namespace. On not finding it, it does not move forward. So the problem really is that your datasource either isn't correctly configured or you are using the wrong jndi name.

Where is the client code, looking up the datasource located? Is it in the same JVM as where the datasource is deployed?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most like, you want to look the datasource up using:

ctx.lookup("java:myds/OrcleDS");

but we won't know for sure until you provide the information Jaikiran asked for.
 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks a lot for your reply....

Here is my client code.. .which is running on other machine.



And I have configured the DS in JBoss using fallwing xml file placed in <JBOSS_HOME>/Server/default/deploy


I am able to use this datasource through another application (using hibernate) which is deployed in same JBoss server.
But unable to obtain the datasource from remote machine look up.
Even i chaged it from "myds/OracleDS" to "java:myds/OracleDS" still getting the same error:
javax.naming.NameNotFoundException: myds not bound

Please let me know if you need more info...

Thanks,
Bala.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this
 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding <use-java-context>false</use-java-context> to the DS solved my problem. Thanks a lot.
And as there mentioned this as antipartterns .
There is an implementation of this in JBoss4. I would not recommend this anti-pattern.
. I got my Architect to agree not use this concept of exposing DS for removte jvm.

Regards,
Bala
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic