Advertisement

09.08.2004 at 01:26PM PDT, ID: 21123646
[x]
Attachment Details

Reasons for getting "java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path" when accessing an Oracle DB with Connection con = myDriver.connect(connectionURL, props);

Asked by eduardotorres17 in BEA WebLogic Application Server

Gentlemen,
                after doing a full install of an oracle client and setting all possible libraries in the classpath

set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\classes111.jar;%ORACLE_HOME%\classes111_g.jar;
set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\classes12.jar;%ORACLE_HOME%\classes12_g.jar;
set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\classes12dms.jar;%ORACLE_HOME%\classes12dms_g.jar;
set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\ojdbc14.jar;%ORACLE_HOME%\ojdbc14_g.jar;%ORACLE_HOME%\ocrs12.jar;
set CLASSPATH=%CLASSPATH%;%ORACLE_HOME%\nls_charset11.jar;%ORACLE_HOME%\nls_charset12.jar;

where ORACLE_HOME was set as an environment variable in my pc: ORACLE_HOME = C:\oracle\ora92\jdbc\lib,

I am trying to access an Oracle db with this code in an ejb:

Connection con = null;
try{
Properties props = new Properties();
      props.put("user","BizAgiVision");
      props.put("password", "BizAgi");
      props.put("DatabaseName", "BizAgiVision");
      props.put("dll", "ocijdbc8");
      props.put("protocol", "oci8");
      
      Driver myDriver = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
      String connectionURL = "jdbc:oracle:oci8:@(description=(address=(host=devt_oracle)(protocol=tcp)(port=1521))(connect_data=(SID=BizAgiOr)))";
                con =    myDriver.connect(connectionURL, props);

...code Continues..

When running this, I get the exception message

      

java.rmi.RemoteException: EJB Exception: ; nested exception is:
        java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path

Start server side stack trace:
java.rmi.RemoteException: EJB Exception: ; nested exception is:
        java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
        at weblogic.ejb20.internal.EJBRuntimeUtils.throwRemoteException(EJBRunti
meUtils.java:100)
        at weblogic.ejb20.internal.BaseEJBHome.handleSystemException(BaseEJBHome
.java:309)
        at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:2
42)
        at com.testing.session.stateless.FundsManagerStatelessSession_qoqat1_EOI
mpl.addFunds(FundsManagerStatelessSession_qoqat1_EOImpl.java:107)
        at com.testing.session.stateless.FundsManagerStatelessSession_qoqat1_EOI
mpl_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
        at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:114)
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
        at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:785)
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:308)
        at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
Caused by: java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
        at java.lang.Runtime.loadLibrary0(Runtime.java:788)
        at java.lang.System.loadLibrary(System.java:834)
        at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
        at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)

        at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
        at com.testing.session.stateless.FundsManagerStatelessBean.addFunds(Fund
sManagerStatelessBean.java:98)

THE QUESTION IS, DO I HAVE AN ERROR IN THE URL STRING OR THE PROPERTIES OBJECT?
I am sure I have included all the needed .jars in the CLASSPATH.

THANKS.Start Free Trial
[+][-]09.09.2004 at 12:19AM PDT, ID: 12013634

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: BEA WebLogic Application Server
Sign Up Now!
Solution Provided By: yuvalg
Participating Experts: 3
Solution Grade: B
 
 
[+][-]09.09.2004 at 06:05PM PDT, ID: 12022884

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.10.2004 at 07:23AM PDT, ID: 12026986

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32