0
votes

I am getting an error when I try to establish connection through a DataSource created in weblogic server.Has anyone faced this error in past.I am getting exception in getConnection method of the DataSource.


    java.lang.IllegalArgumentException: interface weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_com_informix_jdbc_IfxSqliConnect_RemoteInterface is not visible from class loader
     at java.lang.reflect.Proxy.getProxyClass(Proxy.java:337)
     at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:567)
     at weblogic.rmi.internal.ProxyStub.newInstance(ProxyStub.java:69)
     at weblogic.rmi.internal.OIDManager.resolveObject(OIDManager.java:242)
     at weblogic.common.internal.ChunkedObjectInputStream.resolveObject(ChunkedObjectInputStream.java:81)
     at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.resolveObject(ChunkedObjectInputStream.java:328)
     at java.io.ObjectInputStream.checkResolve(ObjectInputStream.java:1321)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
     at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1835)
     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1759)
     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
     at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:139)
     at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:152)
     at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
     at weblogic.rmi.internal.BasicRemoteRef.unmarshalReturn(BasicRemoteRef.java:233)
     at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:264)
     at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
     at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
     at $Proxy2.getConnection(Unknown Source

2
That almost looks like you're trying to access the DataSource object directly over RMI, which is almost certainly will not allow. Is that the only stack trace, or do you have more? - skaffman
I have a little more but can't post it because of data security...However what I do is create my own DataSource class which contacts DataSource.getConnection method.The DataSource object is created by looking up the weblogic connection pool address - Harish

2 Answers

0
votes

It seems like you're trying to access the Datasource through a socket instead of looking up the JNDI name of the resource first and invoking getConnection on that reference.

0
votes

You can simply find the cause of your issue by trying the following command:

java utils.dbping ORACLE_THIN scott tiger dbserver1:1561:demo

If this command returns Success!!!, you know, your connection to DB from server is okay, and you have to focus on middleware settings. If not, error detail will be provided.

scott = db username
tiger = db password
demo = db instance name

More information can be found here: http://docs.oracle.com/cd/E13222_01/wls/docs81/admin_ref/utils11.html

To execute java utils.dbping, make sure you have executed setWLSEnv.sh first, to setup java local variables.