aspose file tools*
The moose likes BEA/Weblogic and the fly likes connecting weblogic 6.1 and oracle thru thin driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "connecting weblogic 6.1 and oracle thru thin driver" Watch "connecting weblogic 6.1 and oracle thru thin driver" New topic
Author

connecting weblogic 6.1 and oracle thru thin driver

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
can anyone plz., explain how i can connect to oracle8.1.7 database thru weblogic6.1 and EJB using a thin driver...plz., elaborate on the jar files and classpath settings...
i want to use a oracle thin driver only...
Thanx in advance

------------------
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
Well, WL 6.1 is already shipped with oracle drivers all you have to do is to configure a connection poolin using the admin console, you must also want to use the utilitary utils.dbping that came�s with WL and you can use to test the connection.
regards.
parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
Thanx very much for the concern...
i have tried to use the WL jDriver...but i am getting the
ORA-23247 error...it says
" need explicit attach before authenticating a user - (SCOTT/********@SARATHY)"
Can u plz., help me...???
Thanx in advance
Vijay Shrivastava
Ranch Hand

Joined: Nov 15, 2001
Posts: 64
For configuring the WLS6.1 server with ORACLE8.17 using ORACLE driver.
Assuming you have the ORACLE driver file named CLASSES12.zip. Add Oracle driver class file in the weblogic startup script where you set WEBLOGIC_CLASSPATH.
Set WEBLOGIC_CLASSPATH=./directoyoforacle/CLASSES12.zip
And from the WLS6.1 Console setup ConnectionPool by providing the URL of database and the driver detail for thin driver. Also you need to specify username and password and make sure that you have added this pool for this server(WebLogicServer instance). Browse through all the tabs of ConnectionPool setup on console as you will need to have configure all parameters like size at startup.
When you start server you will see that ConnectionPool is setup.
------------------
Consultant - ObjectNetTechnologies ,Atlanta USA.
SCJP2, SCJEA (Part I)

Vijay shrivastava
parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
Hi Vijay...

Thanq very much VIJAY..that worked very fine..can u plz., tell me where actually is the problem for that error..
"need explicit attach before authenticating a user - (SCOTT/********@SARATHY)"
THANX AGAIN AND AGAIN...
That really reduced strain for me....
Regards
Vijay Shrivastava
Ranch Hand

Joined: Nov 15, 2001
Posts: 64
I am glad it solved your problem.
This is my best guess.
1. This is not an ORACLE Standard ErrorCode.
2. It might be an extension of ORACLE ErrorCodes by WLS JDBC driver.
3. WLS JDBC driver was not able to authenticate the user by way in which username/password is passed to it.
4. With WLS5.1 I have used WLS driver and it works fine only issue is it was not TYPE4 driver.
I will try to use WLs6.1 driver for ORACLE and see if I can reproduce this.
Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
i have similar problem and if you can take a look at it and help me out i really appreciate it :
I have the weblogicoxa37.dll in c:\bea\wlserver6.1\bin\oci817_8
i have orcale client (OCI.dll) in: c:\oracle\ora81\bi
in my startExamplesServer.cmd i set the path as:
set path=.\bin;.\bin\oci817_8;c:\oracle\ora81\bin;%path%
i have a problem connectin to oracle . any help would be highly appreciated..thanks
Originally posted by Vijay Shrivastava:
For configuring the WLS6.1 server with ORACLE8.17 using ORACLE driver.
Assuming you have the ORACLE driver file named CLASSES12.zip. Add Oracle driver class file in the weblogic startup script where you set WEBLOGIC_CLASSPATH.
Set WEBLOGIC_CLASSPATH=./directoyoforacle/CLASSES12.zip
And from the WLS6.1 Console setup ConnectionPool by providing the URL of database and the driver detail for thin driver. Also you need to specify username and password and make sure that you have added this pool for this server(WebLogicServer instance). Browse through all the tabs of ConnectionPool setup on console as you will need to have configure all parameters like size at startup.
When you start server you will see that ConnectionPool is setup.

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
hi..
assuming that u have properly created connection pools and corresponding datasources using administration console...
ur classpath should b set to the classes111.zip and classes12.zip which will be present in ur %ORACLE_HOME%\jdbc\lib directory where %ORACLE_HOME% is the directory in which u installed oracle...
for this all u have to do is file ensure that the follwing line is present in ur setEnv.bat
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%ORACLE_HOME%\jdbc\lib\classes111.zip;%ORACLE_HOME%\jdbc\lib\classes12.zip;%CLASSPATH%
the order of the classpath should be the same...weblogic.jar should appear before classesXXX.zip appears...
apart from this u need not set any paths to neither dll files nor any other files...
Hope this will help u...

Regards
Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
if i don't include this path (set PATH=.\bin;.\bin\oci817_8;c:\oracle\ora81\bin;%PATH%) in my startExamplesServer.cmd i get this error my console)
" weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:192)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:698)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:629)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:279)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:233)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:193)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy48.updateDeployments(Unknown Source)

i made these changes to my classpth which is now:
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%ORACLE_HOME%\jdbc\lib\classes111.zip;%ORACLE_HOME%\jdbc\lib\classes12.zip;%CLASSPATH%
and used to be:
@rem set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.\samples\eval\cloudscape\lib\cloudscape.jar;.\config\examples\serverclasses
but it makes no diffrence whithout the set path in the top
your help/comments are very much appreciated it

Originally posted by parthasarathy madhira:
hi..
assuming that u have properly created connection pools and corresponding datasources using administration console...
ur classpath should b set to the classes111.zip and classes12.zip which will be present in ur %ORACLE_HOME%\jdbc\lib directory where %ORACLE_HOME% is the directory in which u installed oracle...
for this all u have to do is file ensure that the follwing line is present in ur setEnv.bat
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;%ORACLE_HOME%\jdbc\lib\classes111.zip;%ORACLE_HOME%\jdbc\lib\classes12.zip;%CLASSPATH%
the order of the classpath should be the same...weblogic.jar should appear before classesXXX.zip appears...
apart from this u need not set any paths to neither dll files nor any other files...
Hope this will help u...

Regards

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
hi...
sorry...but my startExamplesEnv.cmd file contains the following path setting
set PATH=.\bin;%PATH%
set
CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.\samples\eval\cloudscape\lib\cloudscape.jar
;.\config\examples\serverclasses
echo off
it doesnt contain any path setting to the weblogicoci37.dll
though my connection to the database is working fine...
the best solution in my view for this is change ur path setting to the .dll file itself...ie
change ur 'SET PATH' line as
set PATH=.\bin;.\bin\oci817_8\weblogicoci37.dll;c:\oracle\ora81\bin;%PATH%
if this also doesnt work then try giving absolute path like
c:\bea\wlserver6.1\oci817_8\weblogicoci37.dll
else try to test ur database using database connection utility provided by bea...then u can check the java.library.path...
the utility is
java utils.dbping ORACLE SCOTT TIGER ORXML
where oracle is database
scott,tiger r username and password
orxml is the database name to which u r trying to connect...
else
before starting the wlserver using startExamplesServer.cmd just try setting ur path to weblogicoci37.dll at the command line...which in fact is not needed
i think one of out of these will click
regards,
Vijay Shrivastava
Ranch Hand

Joined: Nov 15, 2001
Posts: 64
The error you are getting is not because your path settings are not there but it is because your Classpath is incorrect.
Since WebLogic is not able to load the OCI driver from the ORACLE driver (classes) it is tryng to load it's OCI driver and it is finding problem there.
Reasons could be 2.
1. You have specified the ConnectionPool using the WLS driver.
2. Your Classpath settings are incorrect.
For ConnectionPool settings read other messages I answered it earlier. I will suggest putting absolute path for ORACLE classes in your classpath. Like E:\oracle\ora81\jdbc\lib\classes111.zip;
Another thing (this point is informatery and doean't really affect your current problem) is you should not need both classes111 and classes12.zip in classpath. These are two different versions of driver from Oracle. classes12.zip will work fine if you are using ORACLE8.1.7 and classes111.zip was for earlier releases.
That will matter when you start using the JDBC through ORACLE thin driver Connection pool configured in WLS.
As suggested by partha testing database through utils.dbping may give you clue iff your database and connectivity has any issues.
Hope it helps,

------------------
Vijay shrivastava
Consultant - ObjectNetTechnologies ,Atlanta USA.
SCJP2, WLS5.1,SCJEA (Part I)
[This message has been edited by Vijay Shrivastava (edited November 30, 2001).]
Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
Partha, after i made these changes i still have this error here is the console :
Starting Loading jDriver/Oracle .....
<4/12/2001 10:09:27> <Error> <JDBC> <Cannot startup connection pool "oraclePool"
weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:192)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:698)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:629)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:279)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:233)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:193)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy48.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2734)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:362)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:154)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy71.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1151)
at weblogic.management.Admin.finish(Admin.java:570)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:506)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:203)
at weblogic.Server.main(Server.java:35)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:208)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:698)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:629)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:279)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:233)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:193)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy48.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2734)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:362)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:154)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy71.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1151)
at weblogic.management.Admin.finish(Admin.java:570)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:506)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:203)
at weblogic.Server.main(Server.java:35)

Also, here is my startup scipts:
SETLOCAL
cd ..\..
@rem Set user-defined variables.
set JAVA_HOME=C:\bea\jdk131
set WL_HOME=C:\bea\wlserver6.1
set ORACLE_HOME=C:\oracle\ora81
@rem Check that script is being run from the appropriate directory
if not exist lib\weblogic.jar goto wrongplace
goto checkJDK

:wrongplace
echo startExamplesServer.cmd must be run from the config\examples directory. 1>&2
goto finish
:checkJDK
if exist %JAVA_HOME%/bin/javac.exe goto runWebLogic
echo.
echo Javac wasn't found in directory %JAVA_HOME%/bin.
echo Please edit the startExamplesServer.cmd script so that the JAVA_HOME
echo variable points to the root directory of your JDK installation.
goto finish
:runWebLogic
echo on
set PATH=.\bin;.\bin\oci817_8\weblogicoci37.dll;c:\oracle\ora81\bin;%PATH%
@rem set WEBLOGIC_CLASSPATH=c:\classes\nz\gov\winz\app\ucv
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\lib\weblogic_sp.jar;%WL_HOME%\lib\weblogic.jar;C:\oracle\ora81\jdbc\lib\classes111.zip;C:\oracle\ora81\jdbc\lib\classes12.zip;.\config \examples\serverclasses;%CLASSPATH%

thanks in advance
Originally posted by parthasarathy madhira:
hi...
sorry...but my startExamplesEnv.cmd file contains the following path setting
set PATH=.\bin;%PATH%
set
CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.\samples\eval\cloudscape\lib\cloudscape.jar
;.\config\examples\serverclasses
echo off
it doesnt contain any path setting to the weblogicoci37.dll
though my connection to the database is working fine...
the best solution in my view for this is change ur path setting to the .dll file itself...ie
change ur 'SET PATH' line as
set PATH=.\bin;.\bin\oci817_8\weblogicoci37.dll;c:\oracle\ora81\bin;%PATH%
if this also doesnt work then try giving absolute path like
c:\bea\wlserver6.1\oci817_8\weblogicoci37.dll
else try to test ur database using database connection utility provided by bea...then u can check the java.library.path...
the utility is
java utils.dbping ORACLE SCOTT TIGER ORXML
where oracle is database
scott,tiger r username and password
orxml is the database name to which u r trying to connect...
else
before starting the wlserver using startExamplesServer.cmd just try setting ur path to weblogicoci37.dll at the command line...which in fact is not needed
i think one of out of these will click
regards,

Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
Vijay could u send me your email address to adam_jzw@yahoo.com in order for me to send my startExamplesSever.cmd
thanks
Originally posted by Vijay Shrivastava:
For configuring the WLS6.1 server with ORACLE8.17 using ORACLE driver.
Assuming you have the ORACLE driver file named CLASSES12.zip. Add Oracle driver class file in the weblogic startup script where you set WEBLOGIC_CLASSPATH.
Set WEBLOGIC_CLASSPATH=./directoyoforacle/CLASSES12.zip
And from the WLS6.1 Console setup ConnectionPool by providing the URL of database and the driver detail for thin driver. Also you need to specify username and password and make sure that you have added this pool for this server(WebLogicServer instance). Browse through all the tabs of ConnectionPool setup on console as you will need to have configure all parameters like size at startup.
When you start server you will see that ConnectionPool is setup.

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
hi there...
first try testing ur driver and database connection using java utils.dbping utility...
it'll give all errors if u dont have something ie required in ur classpath...
first start with nothing in ur classpath and go on setting ur classpath as the utility runs and demands...here is how i worked it out...once the utility is successful i think there should b no problems for u to use the driver....
important thing to note is the 2nd classpath setting ie for the license.bea file present in BEA_HOME directory....
D:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
D:\>set classpath=d:\bea\wlserver6.1\lib\weblogic.jar;
D:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Missing license file for: WebLogic Server 6.1
Error encountered:
java.sql.SQLException: Fail to load jDriver/Oracle due to license checking failed!
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:182)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
D:\>set classpath=%classpath%d:\bea;
D:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
**** Success!!! ****
You can connect to the database in your app using:
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
java.sql.Driver d = (java.sql.Driver)Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn = d.connect("jdbc:weblogic racle:ORXML", props);
// This mode is superior, especially in serverside classes because
// it avoids DriverManager calls are class synchronized, and will
// bottleneck any other JDBC in the server, even already-running
// connections, because all JDBC drivers use DriverManager.println()
// to log info and exceptions, and that call is also class synchronized.
// For repeated connecting, a single driver instance can be re-used.
**** or ****
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle:ORXML", "SCOTT", "TIGER");
**** or ****
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
props.put("server", "ORXML");
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle", props);
D:\>
parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
try this and send me the sequence of classpath settings that u made in running the utility...
hope this helps...
Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
when i first ran the java dbutil first i got this:
C:\bea\wlserver6.1\config\examples>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
C:\bea\wlserver6.1\config\examples>set classpath=c:\bea\wlserver6.1\lib\weblogic
.jar
C:\bea\wlserver6.1\config\examples>java utils.dbping ORACLE SCOTT TIGER ORXML
Missing license file for: WebLogic Server 6.1
Error encountered:
java.sql.SQLException: Fail to load jDriver/Oracle due to license checking faile
d!
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:182)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
C:\bea\wlserver6.1\config\examples>set classpath=%classpath%c:\bea
C:\bea\wlserver6.1\config\examples>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
C:\bea\wlserver6.1\config\examples>set classpath=%classpath%c:\bea;
C:\bea\wlserver6.1\config\examples>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
C:\bea\wlserver6.1\config\examples>

Originally posted by parthasarathy madhira:
try this and send me the sequence of classpath settings that u made in running the utility...
hope this helps...

Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
in the tow steps i got the same results:

C:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
C:\>set classpath=c:\bea\wlserver6.1\lib\weblogic.jar;
C:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Missing license file for: WebLogic Server 6.1
Error encountered:
java.sql.SQLException: Fail to load jDriver/Oracle due to license checking faile
d!
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:182)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at utils.dbping.main(dbping.java:167)
C:\>set classpath=%classpath%c:\bea;
C:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at utils.dbping.main(dbping.java:167)
btw i already connected to my database(Oracle) using a servlets
it was deployed and ran on wls6.1.
thanks a lot

Originally posted by parthasarathy madhira:
hi there...
first try testing ur driver and database connection using java utils.dbping utility...
it'll give all errors if u dont have something ie required in ur classpath...
first start with nothing in ur classpath and go on setting ur classpath as the utility runs and demands...here is how i worked it out...once the utility is successful i think there should b no problems for u to use the driver....
important thing to note is the 2nd classpath setting ie for the license.bea file present in BEA_HOME directory....
D:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
D:\>set classpath=d:\bea\wlserver6.1\lib\weblogic.jar;
D:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Missing license file for: WebLogic Server 6.1
Error encountered:
java.sql.SQLException: Fail to load jDriver/Oracle due to license checking failed!
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:182)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
D:\>set classpath=%classpath%d:\bea;
D:\>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
**** Success!!! ****
You can connect to the database in your app using:
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
java.sql.Driver d = (java.sql.Driver)Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn = d.connect("jdbc:weblogic racle:ORXML", props);
// This mode is superior, especially in serverside classes because
// it avoids DriverManager calls are class synchronized, and will
// bottleneck any other JDBC in the server, even already-running
// connections, because all JDBC drivers use DriverManager.println()
// to log info and exceptions, and that call is also class synchronized.
// For repeated connecting, a single driver instance can be re-used.
**** or ****
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle:ORXML", "SCOTT", "TIGER");
**** or ****
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
props.put("server", "ORXML");
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle", props);
D:\>

parthasarathy madhira
Ranch Hand

Joined: Aug 31, 2001
Posts: 41
hi there...
i started with nothing in my path and classpath ...
what u do is ...give the following 2 lines in the command line and then follow the same steps which i followed...

set path="" and set classpath=""
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
'java' is not recognized as an internal or external command,
operable program or batch file.
D:\bea>set path=c:\jdk1.3\bin;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
D:\bea>set classpath=d:\bea\wlserver6.1\lib\weblogic.jar;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
here u can c that i got the same error which u got...so in the next command i am setting the path to it...as follows...and fixed the error...
D:\bea>set path=%path%d:\bea\wlserver6.1\bin\oci817_8;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError: D:\bea\wlserver6.1\bin\oci817_8\weblogicoci37.dll: Can't find dependent libraries
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
now i got this error bcas previously there was oracle bin directory(which contains oci.dll file which is required by weblogicoci37.dll) in my path...but as i've emptied the path in this command prompt window i got this error...so i am setting the path variable now to oracle bin directory...
after which it works very fine....
D:\bea>set path=%path%d:\oracle\ora81\bin;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
**** Success!!! ****
You can connect to the database in your app using:
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
java.sql.Driver d = (java.sql.Driver)Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn = d.connect("jdbc:weblogic racle:ORXML", props);
// This mode is superior, especially in serverside classes because
// it avoids DriverManager calls are class synchronized, and will
// bottleneck any other JDBC in the server, even already-running
// connections, because all JDBC drivers use DriverManager.println()
// to log info and exceptions, and that call is also class synchronized.
// For repeated connecting, a single driver instance can be re-used.
**** or ****
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle:ORXML", "SCOTT", "TIGER");
**** or ****
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
props.put("server", "ORXML");
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle", props);
D:\bea>
i suggested u this process bcas after this u'll b very clear what is exactly required in the "path" and "classpath" variables...after this u can accordingly change ur classpath settings in startExamplesServer.cmd file....
hope this helps...
all the best and
Best Regards....
Adam Adams
Ranch Hand

Joined: Nov 28, 2001
Posts: 60
thanks a lot Partha? it works ...i really appreciate your help
Originally posted by parthasarathy madhira:
hi there...
i started with nothing in my path and classpath ...
what u do is ...give the following 2 lines in the command line and then follow the same steps which i followed...

set path="" and set classpath=""
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
'java' is not recognized as an internal or external command,
operable program or batch file.
D:\bea>set path=c:\jdk1.3\bin;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Exception in thread "main" java.lang.NoClassDefFoundError: utils/dbping
D:\bea>set classpath=d:\bea\wlserver6.1\lib\weblogic.jar;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
here u can c that i got the same error which u got...so in the next command i am setting the path to it...as follows...and fixed the error...
D:\bea>set path=%path%d:\bea\wlserver6.1\bin\oci817_8;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError: D:\bea\wlserver6.1\bin\oci817_8\weblogicoci37.dll: Can't find dependent libraries
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
now i got this error bcas previously there was oracle bin directory(which contains oci.dll file which is required by weblogicoci37.dll) in my path...but as i've emptied the path in this command prompt window i got this error...so i am setting the path variable now to oracle bin directory...
after which it works very fine....
D:\bea>set path=%path%d:\oracle\ora81\bin;
D:\bea>java utils.dbping ORACLE SCOTT TIGER ORXML
Starting Loading jDriver/Oracle .....
**** Success!!! ****
You can connect to the database in your app using:
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
java.sql.Driver d = (java.sql.Driver)Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn = d.connect("jdbc:weblogic racle:ORXML", props);
// This mode is superior, especially in serverside classes because
// it avoids DriverManager calls are class synchronized, and will
// bottleneck any other JDBC in the server, even already-running
// connections, because all JDBC drivers use DriverManager.println()
// to log info and exceptions, and that call is also class synchronized.
// For repeated connecting, a single driver instance can be re-used.
**** or ****
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle:ORXML", "SCOTT", "TIGER");
**** or ****
java.util.Properties props = new java.util.Properties();
props.put("user", "SCOTT");
props.put("password", "TIGER");
props.put("server", "ORXML");
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:weblogic racle", props);
D:\bea>
i suggested u this process bcas after this u'll b very clear what is exactly required in the "path" and "classpath" variables...after this u can accordingly change ur classpath settings in startExamplesServer.cmd file....
hope this helps...
all the best and
Best Regards....

julian
Greenhorn

Joined: Jun 30, 2002
Posts: 1
Hi,
I tried to test my connection using the following:
java utils.dbping ORACLE USER PASSWD SID, but i get the following error:
Error encountered:
java.lang.ArrayIndexOutOfBoundsException
at com.bea.utils.misc.ProcessUtil.base64ToBytes(ProcessUtil.java:552)
at com.bea.utils.misc.Process.validate(Process.java:1231)
at com.bea.utils.misc.Process.isValidSignature(Process.java:518)
at com.bea.utils.misc.ProcessManager.memCheck(ProcessManager.java:647)
at com.bea.utils.misc.ProcessManager.memCheck(ProcessManager.java:786)
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:177)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
What could be the problem?, I tried using java utils.dbping ORACLE_THIN and it worked, but are not supposed to use thin driver for the application.
Thanks in Advance...
Julian
mars76
Ranch Hand

Joined: Nov 30, 2000
Posts: 30
Hi,
I followed all the above steps and in my machine i have installed 8.0.5 Client version and i am testing the utils.dbping program . I am getting the following error..
The Procedure entry point OCILobLocatorAssign could not be located in the dynamic link library OCI.dll
Please help me...
Thanks
Sateesh
bryan Lee
Greenhorn

Joined: Mar 30, 2002
Posts: 13
This is the problem/results When I follow parthasarathy madhira's step-by-step suggestions:
=============
C:\>set path=c:\j2sdk1.4.0\bin;
C:\>set classpath=c:\bea\wlserver6.1\lib\weblogic.jar;
C:\>set path=c:\j2sdk1.4.0\bin;c:\bea\wlserver6.1\bin\oci816_8\weblogicoci37.dll
;
C:\>set path=c:\j2sdk1.4.0\bin;c:\bea\wlserver6.1\bin\oci816_8\weblogicoci37.dll
;c:\Oracle\Ora81\bin;
C:\>set classpath=c:\bea\wlserver6.1\lib\weblogic.jar;c:\bea;
C:\>java utils.dbping ORACLE SCOTT TIGER oracle
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at utils.dbping.main(dbping.java:167)
============================
Can anyone tell me what is wrong with it?
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
Set your PATH to include the weblogic bin/oci816_8 DIRECTORY, not the DLL file.
bryan Lee
Greenhorn

Joined: Mar 30, 2002
Posts: 13
As Dave suggested, the running results/problem has been changed to my original problem:
==========================
C:\>set path=c:\j2sdk1.4.0\bin;
C:\>set classpath=c:\bea\wlserver6.1\lib\weblogic.jar;
C:\>set path=c:\j2sdk1.4.0\bin;c:\bea\wlserver6.1\bin\oci816_8;
C:\>set path=c:\j2sdk1.4.0\bin;c:\bea\wlserver6.1\bin\oci816_8;c:\Oracle\Ora81\b
in;
C:\>set classpath=c:\bea\wlserver6.1\lib\weblogic.jar;c:\bea;
C:\>java utils.dbping ORACLE SCOTT TIGER oracle
Starting Loading jDriver/Oracle .....

---------- LOGIN ERROR CODE: 24327
Error encountered:
java.sql.SQLException: ORA-24327: need explicit attach before authenticating a u
ser - (SCOTT/********@oracle)
at weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:161)
at weblogic.jdbc.oci.Driver.connect(Driver.java:112)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at utils.dbping.main(dbping.java:167)
=====================
Thanks for furthure suggestions.
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
I know I have seen this error message but it has been months ago and I just can't remember what exactly it was.
I did find this:
http://support.bea.com/askbea/wls/S-08804.html
There's lots of things in there to keep you busy
Other (internal) stuff I have looked at suggests the problem is often in the tnsnames.ora settings.
Try to connect using sqlplus - that'll confirm that tns is (or is not) set right.
PARWAR JOHAL
Greenhorn

Joined: Mar 25, 2003
Posts: 2
Originally posted by sateesh kommineni:
Hi,
I followed all the above steps and in my machine i have installed 8.0.5 Client version and i am testing the utils.dbping program . I am getting the following error..
The Procedure entry point OCILobLocatorAssign could not be located in the dynamic link library OCI.dll
Please help me...
Thanks
Sateesh
PARWAR JOHAL
Greenhorn

Joined: Mar 25, 2003
Posts: 2
Originally posted by sateesh kommineni:
Hi,
I followed all the above steps and in my machine i have installed 8.0.5 Client version and i am testing the utils.dbping program . I am getting the following error..
The Procedure entry point OCILobLocatorAssign could not be located in the dynamic link library OCI.dll
Please help me...
Thanks
Sateesh

I am having extactly the same problem can you help?
please e-mail me at Parwar.Johal@BritishAirways.com
Saravanan Alagu
Greenhorn

Joined: Oct 08, 2005
Posts: 5
Guys,

Am also facing the same problem. I set all path and classpath as specified above, still am getting following exception,


Error encountered:

java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.Unsatis
fiedLinkError: no weblogicoci37 in java.library.path
at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:243)
at weblogic.jdbc.oci.Driver.connect(Driver.java:79)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)

Is oci.ddl is required? I'm not able to find either in oracle or weblogic install path. Weblogic 6.1 is installed in solaris and oracle 9.2 is used as database. Appreciate your quick response. Also i would like to know, whether i can use unicode inserts by using oci driver. If not could you pls. suggest me a right driver for multilingual support.

Thanks,
Saran
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connecting weblogic 6.1 and oracle thru thin driver