• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

ORACLE XA DataSource Problem in WebSphere 5.1

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
Have you guys faced this problem earlier. I am trying to retrieve datasource connection but it is giving error.

I have tryed these ways:

java.util.Properties parms = new java.util.Properties();
parms.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
Context jndi = new InitialContext(parms); DataSource ds=(DataSource) jndi.lookup(strDataSourceName);
objConn = ds.getConnection();

and

Context jndi = new InitialContext();
DataSource ds=(DataSource) jndi.lookup(strDataSourceName);
objConn = ds.getConnection();

Error Description

NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.java.javaURLContextRoot
Context method: list(Name)
Context name: java:
Target name: comp/env/jdbc/ORADS
Other data:
Exception stack trace: javax.naming.NotContextException: The object bound under the name "comp/env/jdbc/ORADS" is not a context


 
author & internet detective
Posts: 41250
849
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghuveer,
Are you using WSAD or WebSphere App Server? Can you view the DataSource in the JNDI through the Universal Test Client's JNDI explorer (if WSAD) or the admin console (if WebSphere) ? Does the server start up clean? Does it output a line about the DataSource?
 
Raghuveer Rawat
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne for reply.

I am using WebSphere App Server.
yeah, Server Starts Up Properly.
I am able to see Data Source properties. Test Connection is successful.

Earlier there was a problem as there were two data source with same name but with case difference under same Node.

e.g.
DataSource Name: OracleDS
JNDI Name: jndi/OraDS
and
DataSource Name: oracleDS
JNDI Name: jndi/oraDS

Is this a probem? I was getting a configuration error saying that we can not define two Data Sources Under Same Node.

I changed the name of Data Sources and jndi names but still I am getting the same error as mentioned earlier.
 
Jeanne Boyarsky
author & internet detective
Posts: 41250
849
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghuveer,
Having datasources that only differ in case would be a problem.

Is "jndi/oraDS" exactly what you have in the JNDI? It should be "jdbc/oraDS" to match how you are calling it.
 
Raghuveer Rawat
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne,
I am sorry I did not check...
my Jndi Name for Data Source were jdbc/OraDS and jdbc/oraDS.

But now I have changes the name but still it is giving same problem.
I also have doubt about full datasource path.

Could please clarify what one should pass in lookup.

Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/OraDS");

or

DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/OraDS");


What is the difference between two approaches?
 
and POOF! You're gone! But look, this tiny ad is still here:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic