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

Problems with JNDI lookup of datasource

35 views
Skip to first unread message

Isabelle Muszynski

unread,
Aug 17, 2001, 9:20:47 AM8/17/01
to
Hi there,

I'm having problems looking up my datasource.

In config.xml :

<JDBCConnectionPool CapacityIncrement="2"
DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="3"
MaxCapacity="10" Name="dynsql"
Properties="user=dhlwb;password=dhlwb;dll=ocijdbc8;protocol=thin"
Targets="wombat" URL="jdbc:oracle:thin:@hp9000"/>
<JDBCTxDataSource JNDIName="wombat-ds-dynsql"
Name="Dynsql DataSource" PoolName="dynsql" Targets="wombat"/>

My bean is a stateless session bean.
I try to obtain a connection as follows :

initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)
initCtx.lookup("wombat-ds-dynsql");

I get the following exception :

javax.naming.NameNotFoundException: Unable to resolve
wombat-ds-dynsql. Resolved: '' Unresolved:'wombat-ds-dynsql' ;
remaining name ''
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:802)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:129)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:173)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:158)
at weblogic.rmi.internal.ServerRequest.sendOneWayRaw(ServerRequest.java:92)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:112)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:253)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:220)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy51.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.dhl.wombat.framework.WLDbContext.getConnection(WLDbContext.java:66)
at com.dhl.wombat.dynsql.DynSQLImpl.excute(DynSQLImpl.java:61)
at com.dhl.wombat.dynsql.DynSQLBean.excute(DynSQLBean.java:53)
at com.dhl.wombat.dynsql.DynSQLBean_nnfv8m_EOImpl.excute(DynSQLBean_nnfv8m_EOImpl.java:37)
at com.dhl.wombat.dynsql.DynSQLBean_nnfv8m_EOImpl_WLSkel.invoke(Unknown
Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


I have tried using "java:/comp/env/jdbc/wombat-ds-dynsql" for lookup,
but that doesn't work either.

Please help!!!

Isabelle

Srinivas Chennamaraja

unread,
Aug 17, 2001, 11:41:23 AM8/17/01
to
You should look for the name of the datasource not the JNDI_NAME. try doing
this

initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource)

initCtx.lookup("Dynsql DataSource");

it should work...


"Isabelle Muszynski" <Isabelle....@rekencentra.be> wrote in message
news:40f713ef.01081...@posting.google.com...

Sree Bodapati

unread,
Aug 17, 2001, 11:51:42 AM8/17/01
to
try,

DataSource ds = (javax.sql.DataSource) initCtx.lookup("DynsqlDataSource");

hth
/
sree

"Isabelle Muszynski" <Isabelle....@rekencentra.be> wrote in message
news:40f713ef.01081...@posting.google.com...

> Hi there,
>
> I'm having problems looking up my datasource.
>
> In config.xml :
>
> <JDBCConnectionPool CapacityIncrement="2"
> DriverName="oracle.jdbc.driver.OracleDriver"
> InitialCapacity="3"
> MaxCapacity="10" Name="dynsql"
> Properties="user=dhlwb;password=dhlwb;dll=ocijdbc8;protocol=thin"
> Targets="wombat" URL="jdbc:oracle:thin:@hp9000"/>
> <JDBCTxDataSource JNDIName="wombat-ds-dynsql"

> Name="DynsqlDataSource" PoolName="dynsql" Targets="wombat"/>

Slava Imeshev

unread,
Aug 17, 2001, 1:58:37 PM8/17/01
to
Hi Isabelle,

There are several sources of your problem.

o You don't provide correct JNDI name. Provide
correct name.

o You have not set up targer for the DataSource.
Provide correct target.

o You DataSource has not started up because
connection pool it's based is not started. Check
log and make sure connection pool and ds started.

Regards,

Slava Imeshev

"Isabelle Muszynski" <Isabelle....@rekencentra.be> wrote in message
news:40f713ef.01081...@posting.google.com...

Isabelle Muszynski

unread,
Aug 22, 2001, 5:52:35 AM8/22/01
to
Thanks everyone, I've got it working now.

Isabelle

0 new messages