• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in lookup datasource

 
Ranch Hand
Posts: 157
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tilak
Ranch Hand
Posts: 157
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this
 
Bala Tilak
Ranch Hand
Posts: 157
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic