File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes JNDI Access Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI Access Problem" Watch "JNDI Access Problem" New topic
Author

JNDI Access Problem

nmkaranth
Greenhorn

Joined: Jan 04, 2002
Posts: 2
I am using Weblogic 6.1sp2. I have the connection pool configured in Weblogic 6.1 bound to a JNDI name.
From a java file, I need to get a connection from the datasource. However I get the following error when do the initial context lookup.
My code-
public Connection getSQLConnection()
{
// datasource, JNDI name specified
final String DATASOURCE = "ABCD";
InitialContext ic = null;
try
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, "t3://localhost:7001");
ic = new InitialContext(p);
DataSource ds = (DataSource)ic.lookup(DATASOURCE);
return ds.getConnection();
}
catch (Exception ex)
{
ex.printStackTrace();
System.out.println(ex.toString());
return null;
}
finally
{
try
{
ic.close();
}
catch (Exception e)
{
System.out.println("Error in Closing the Context");
}
}
}
I get the following error when executing this statement DataSource ds = (DataSource)ic.lookup(DATASOURCE);
Error:
java.lang.NoSuchMethodError
at weblogic.transaction.internal.TransactionManagerImpl.<clinit>(TransactionManagerImpl.java:123)
at weblogic.transaction.TxHelper.getTransactionManager(TxHelper.java:56)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:240)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:220)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy0.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at TestCon.getSQLConnection(TestCon.java:221)
at TestCon.run(TestCon.java:68)
at java.lang.Thread.run(Thread.java:484)
--------------- nested within: ------------------
weblogic.rmi.extensions.RemoteRuntimeException - with nested exception:
[java.lang.NoSuchMethodError]
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60)
at $Proxy0.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at TestCon.getSQLConnection(TestCon.java:221)
at TestCon.run(TestCon.java:68)
at java.lang.Thread.run(Thread.java:484)
Has anybody got a similar error.
Please help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI Access Problem
 
Similar Threads
NameNotFoundException- Strange
Entity Bean Not getting Bound to JNDI in WLS 6.1
Unable to resolve JMS TOPIC Name
Deployment problem
Data Source and JNDI problem