Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle Datasource V5 error in Websphere 5.1.2

3 views
Skip to first unread message

Narendra

unread,
Nov 2, 2004, 11:11:28 AM11/2/04
to
Hi I have created a datasource in websphere using console and able to
Test connection succesfully, however when i try to access through my
application (from DAO) it throws following exception
before I was able to setup datasource locally using WSAD, but not able
to do same on App server on Unix box.


[11/2/04 10:41:05:560 EST] 29ad5b4e Helpers W NMSV0605W: A
Reference object looked up from the context "java:" with the name
"comp/env/jdbc/SRSDataSource" was sent to the JNDI Naming Manager and
an exception resulted. Reference data follows:
Reference Factory Class Name:
com.ibm.ws.util.ResRefJndiLookupObjectFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object
Type: ResRefJndiLookupInfo
Content: com.ibm.ws.util.ResRefJndiLookupInfo@5c8c5b56
ResRefJndiLookupInfo: Look up
Name="jdbc/SRSDataSource";JndiLookupInfo: jndiName="jdbc/SRSDB";
providerURL=""; initialContextFactory=""

Exception data follows:
javax.naming.NameNotFoundException: Context:
srs-was-dev/nodes/srs-was-dev/servers/server1, name: jdbc/SRSDB: First
component in name jdbc/SRSDB not found. Root exception is
org.omg.CosNaming.NamingContextPackage.NotFound:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:1983)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1320)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:2424)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:2877)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1390)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown
Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372)

-----------------
Here is my java code

Context ctx = new javax.naming.InitialContext();
ds = (javax.sql.DataSource)
ctx.lookup("java:comp/env/jdbc/SRSDataSource");
------------------------
Here is my ds setting in console
Name : SRSDataSource
JNDI Name : jdbc/SRSDB
------------------

I also have references to the datasources from my EJBS defined in
ejb-jar.xml and ibm-ejb-jar-bnd.xmi files - same setting and same code
works great in WSAD.

any help ?
thank you

Narendra

unread,
Nov 2, 2004, 12:12:13 PM11/2/04
to

vikra...@excite.com

unread,
Nov 2, 2004, 3:53:57 PM11/2/04
to
Why dont you just try this

---------------------------------------------------------------------

Context ctx = new javax.naming.InitialContext();
ds = (javax.sql.DataSource)

ctx.lookup("jdbc/SRSDataSource");

-----------------------------------------------------------------------

I have just used the JNDI, you said, have configured in the console.
Vikram.

Chris Peyton

unread,
Nov 3, 2004, 9:04:44 AM11/3/04
to
java:comp/env/jdbc/SRSDataSource implies that you are looking up a
datasource reference, did you define a reference? If you do not have
a reference defined, then do as Vikram says, just use the JNDI name.
If you want to use a reference, create a reference, set the name to
something like jdbc/ref/SRSDataSource and then do the lookup against
java:comp/env/jdbc/ref/SRSDataSource

yn...@hotmail.com (Narendra) wrote in message news:<3f431ffe.04110...@posting.google.com>...

Narendra

unread,
Nov 4, 2004, 10:02:52 AM11/4/04
to
vikra...@excite.com wrote in message news:<1099428837....@z14g2000cwz.googlegroups.com>...


I tried the above code and as well just JNDI name , above code doesn't
work in both WSAD and WAS. gives following error
[04 Nov 2004 09:48:21,309] [Servlet.Engine.Transports : 3] ERROR
(DBConnection.java:151) - javax.naming.NameNotFoundException: Context:
srs-was-dev/nodes/srs-was-dev/servers/server1, name:
jdbc/SRSDataSource: First component in name jdbc/SRSDataSource not


found. [Root exception is
org.omg.CosNaming.NamingContextPackage.NotFound:

IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
[04 Nov 2004 09:48:21,310] [Servlet.Engine.Transports : 3] DEBUG
(DBConnection.java:127) - caught Exception
[04 Nov 2004 09:48:21,311] [Servlet.Engine.Transports : 3] DEBUG
(DBConnection.java:128) - error class name
javax.naming.NameNotFoundException
[04 Nov 2004 09:48:21,312] [Servlet.Engine.Transports : 3] ERROR
(DBConnection.java:130) - javax.naming.NameNotFoundException: Context:
srs-was-dev/nodes/srs-was-dev/servers/server1, name:
jdbc/SRSDataSource: First component in name jdbc/SRSDataSource not


found. [Root exception is
org.omg.CosNaming.NamingContextPackage.NotFound:

IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
[04 Nov 2004 09:48:21,313] [Servlet.Engine.Transports : 3] ERROR
(UserAuthDAO.java:95) - javax.naming.NameNotFoundException: Context:
srs-was-dev/nodes/srs-was-dev/servers/server1, name:
jdbc/SRSDataSource: First component in name jdbc/SRSDataSource not


found. [Root exception is
org.omg.CosNaming.NamingContextPackage.NotFound:

IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
[04 Nov 2004 09:48:21,314] [Servlet.Engine.Transports : 3] DEBUG
(UserAuthDAO.java:99) - closing con
[04 Nov 2004 09:48:21,315] [Servlet.Engine.Transports : 3] ERROR
(CreateProgramBean.java:373) - javax.naming.NameNotFoundException:
Context: srs-was-dev/nodes/srs-was-dev/servers/server1, name:
jdbc/SRSDataSource: First component in name jdbc/SRSDataSource not


found. [Root exception is
org.omg.CosNaming.NamingContextPackage.NotFound:

IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
[04 Nov 2004 09:48:21,361] [Servlet.Engine.Transports : 3] ERROR
(ProgramInfoCommandDelegate.java:76) - java.rmi.MarshalException:
CORBA MARSHAL 0x4942f896 No; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying
bridge : The repository ID is not of an RMI value type (Expected ID =
RMI:java.lang.Throwable:F8678B4F4D2EB705:D5C635273977B8CB; Received ID
= IDL:omg.org/CosNaming/NamingContext/NotFound:1.0) vmcid: IBM minor
code: 896 completed: No


JNDI works in WSAD and not in WAS
This is the code using JNDI directly
ds = (javax.sql.DataSource) ctx.lookup("jdbc/SRSDB");

thank you for the reply.

Narendra

unread,
Nov 4, 2004, 4:33:55 PM11/4/04
to
cnpe...@hotmail.com (Chris Peyton) wrote in message news:<9f6b2b1.04110...@posting.google.com>...

> java:comp/env/jdbc/SRSDataSource implies that you are looking up a
> datasource reference, did you define a reference? If you do not have
> a reference defined, then do as Vikram says, just use the JNDI name.
> If you want to use a reference, create a reference, set the name to
> something like jdbc/ref/SRSDataSource and then do the lookup against
> java:comp/env/jdbc/ref/SRSDataSource
>


I have references defined in ejb-jar.xml file as jdbc/SRSDataSource ,

even I tried using JNDI name directly that is jdbc/SRSDB, again It
worked in WSAD but failed in WAS.

may be i was doing something wrong in WAS settings ?? but my Test
Connection function in Admin Consol works fine .

thank you
Narendra

0 new messages