You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rumpa Giri <gi...@yahoo.com> on 2007/12/01 03:01:34 UTC
Tomcat Service and OCI
Hello,
I am trying to run the tomcat as NT Service, but does not seem to work with OCI, if I run the same tomcat instance not as a service but via startup.bat, the OCI JDBC driver works fine.
Can anybody help me locate how to fix the service installation script to avoid the exception.
Local setup followed -
1) I have installed tomcat 5.5.25.
2) Installed oracle client installation to use JDBC OCI Driver.
a) Installed the oracle client installation at location - C:\oracle\product\10.2.0\client_1
b) PATH is updated to reflect the above location for the dlls.
c) copied the ojdbc14.ar to the %CATALINA_HOME%/commo/lib/ folder.
3) the context.xml has the OCI URL properly -
<Resource name="jdbc/provider" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:oci:@//<IP>:1521/orcl"
username="UN" password="PWD" maxActive="20" maxIdle="10"
maxWait="-1"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
/>
If i run the %CATALINA_HOME%/bin/startup.bat - the application works fine and the JDBC code excutes properly.
To install the tomcat as a service I ran the following script -
NOTE - We did specify the -Djava.library.path in the script.
_____________________________________________________________________________
SET CATALINA_HOME=C:\tools\apache-tomcat-5.5.25
SET CATALINA_BASE=C:\tools\apache-tomcat-5.5.25
@echo off
echo CATALINA_HOME: %CATALINA_HOME%
echo CATALINA_BASE: %CATALINA_BASE%
echo JAVA_HOME: %JAVA_HOME%
pause
set BASEDIR=%CATALINA_HOME%
call "%CATALINA_HOME%\bin\setclasspath.bat"
set args=%args% --Description=TOMCAT1
set args=%args% --DisplayName=TOMCAT1
set args=%args% --Startup=auto
set args=%args% --LogPath=%CATALINA_BASE%\logs
set args=%args% --LogLevel=DEBUG
set args=%args% --StdError=%CATALINA_BASE%\logs\tomcat1_err.log
set args=%args% --StdOutput=%CATALINA_BASE%\logs\tomcat1_out.log
set args=%args% --Classpath="%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar"
set args=%args% --JavaHome=%JAVA_HOME%
set args=%args% --Jvm=%JAVA_HOME%\jre\bin\server\jvm.dll
set args=%args% --JvmOptions="-Xms128m;-Xmx512m;-Djava.library.path=C:\oracle\product\10.2.0\client_1;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"
set args=%args% --StartMode=jvm
set args=%args% --StartClass=org.apache.catalina.startup.Bootstrap
set args=%args% --StartParams=start
rem set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
rem set args=%args% --StartPath=%CATALINA_HOME%\bin;
set args=%args% --StopMode=jvm
set args=%args% --StopClass=org.apache.catalina.startup.Bootstrap
set args=%args% --StopParams=stop
rem set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
rem set args=%args% --StopPath=%CATALINA_HOME%\bin
%CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatTest %args%
set args=
set BASEDIR=
_____________________________________________________________________________
Now when we run the service and start the application - we get the following exception -
java.lang.UnsatisfiedLinkError: C:\oracle\product\10.2.0\client_1\ocijdbc10.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3135)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3131)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
<<snipped>>
Can anybody please help me locate how to fix the service installation script to avoid the exception. I am assuming since the regular command prompt way of starting tomcat works fine with the driver, its the service installation script which is missing something.
Thanks,
Rumpa Giri
---------------------------------
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
Re: Tomcat Service and OCI
Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
Now Tomcat is also a cool pojo application server
---------------------------------------------------------------------------
After Thought
Rumpa, I was just thinking.... it happens.
>From what you doing and, ie installing drivers in Tomcat/lib
If Oracle is set up right, you should have to do nothing else... ie just run
Service.Bat
Then if you finding that from the Tomcat Icon in Task bar... making the
service start on AUTO does not work (I find that, dont know why).
Then go to Admn - > Services on windows and set it there. Then the service
will start when the machine starts.
If you have to start it from the command line, the only script you should be
Writing is something like
NET Start Apache Tomcat
Its a service... idea is not to start it like a normal EXE or Jar
You want to try get it down like this, so that if a windows user uses the
Installer version, it also works.
If anything... I think its a property in the Oracle installation that isnt
right... I think check the system properties needed for OCI.
It should be very easy...
> Rumpa I dont know, going to guess.
>
> First Guess ;)
> I'm wondering why you dont base this on service.bat
> Starting a service is done for you, and it (service bat) look like its
> actually a 2 phase thing.
> First the service is installed, and then at the bottom, they give you a
> place to add options, with another call.
> You seem to be doing it the hard way.
>
> Second Guess ;)
> The error you getting has got nothing to do with the JDBC driver, it cant
> find the DLL.
> I think if you put the DLL in windows/system32 it would find it.
> Which means the system path or something like that is not right.
> The Tomcat service probably checks this sort of thing when started in 2
> phases, but the cause is probably because services run under a "local
> system user", and the system paths showing the location of those DLL's are
> under "your" user name and not in ALL user names... see My Computer (right
> cick) -> Advanced -> Env Variables.
>
> Then finally, if you do let Tomcat do its thing through service bat, you
> should get a task bar icon, if you click on that and look at the Java tab,
> its easy to see which JavaOpts are coming through and you can change and
> test there as well.
>
> Compliments of the Season
>
>
>
>
>
>
>
>
>
>
>
> ----- Original Message -----
> From: "Rumpa Giri" <gi...@yahoo.com>
> To: <us...@tomcat.apache.org>
> Sent: Saturday, December 01, 2007 4:01 AM
> Subject: Tomcat Service and OCI
>
>
>> Hello,
>>
>> I am trying to run the tomcat as NT Service, but does not seem to work
>> with OCI, if I run the same tomcat instance not as a service but via
>> startup.bat, the OCI JDBC driver works fine.
>>
>> Can anybody help me locate how to fix the service installation script to
>> avoid the exception.
>>
>> Local setup followed -
>>
>> 1) I have installed tomcat 5.5.25.
>> 2) Installed oracle client installation to use JDBC OCI Driver.
>> a) Installed the oracle client installation at location -
>> C:\oracle\product\10.2.0\client_1
>> b) PATH is updated to reflect the above location for the dlls.
>> c) copied the ojdbc14.ar to the %CATALINA_HOME%/commo/lib/ folder.
>> 3) the context.xml has the OCI URL properly -
>> <Resource name="jdbc/provider" auth="Container"
>> type="javax.sql.DataSource"
>> driverClassName="oracle.jdbc.driver.OracleDriver"
>> url="jdbc:oracle:oci:@//<IP>:1521/orcl"
>> username="UN" password="PWD" maxActive="20" maxIdle="10"
>> maxWait="-1"
>> removeAbandoned="true"
>> removeAbandonedTimeout="60"
>> logAbandoned="true"
>> />
>>
>> If i run the %CATALINA_HOME%/bin/startup.bat - the application works
>> fine and the JDBC code excutes properly.
>>
>> To install the tomcat as a service I ran the following script -
>> NOTE - We did specify the -Djava.library.path in the script.
>>
>> _____________________________________________________________________________
>> SET CATALINA_HOME=C:\tools\apache-tomcat-5.5.25
>> SET CATALINA_BASE=C:\tools\apache-tomcat-5.5.25
>>
>> @echo off
>>
>> echo CATALINA_HOME: %CATALINA_HOME%
>> echo CATALINA_BASE: %CATALINA_BASE%
>> echo JAVA_HOME: %JAVA_HOME%
>> pause
>> set BASEDIR=%CATALINA_HOME%
>> call "%CATALINA_HOME%\bin\setclasspath.bat"
>>
>> set args=%args% --Description=TOMCAT1
>> set args=%args% --DisplayName=TOMCAT1
>>
>> set args=%args% --Startup=auto
>>
>> set args=%args% --LogPath=%CATALINA_BASE%\logs
>> set args=%args% --LogLevel=DEBUG
>> set args=%args% --StdError=%CATALINA_BASE%\logs\tomcat1_err.log
>> set args=%args% --StdOutput=%CATALINA_BASE%\logs\tomcat1_out.log
>>
>> set
>> args=%args% --Classpath="%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar"
>>
>> set args=%args% --JavaHome=%JAVA_HOME%
>> set args=%args% --Jvm=%JAVA_HOME%\jre\bin\server\jvm.dll
>> set
>> args=%args% --JvmOptions="-Xms128m;-Xmx512m;-Djava.library.path=C:\oracle\product\10.2.0\client_1;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"
>>
>> set args=%args% --StartMode=jvm
>> set args=%args% --StartClass=org.apache.catalina.startup.Bootstrap
>> set args=%args% --StartParams=start
>> rem set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
>> rem set args=%args% --StartPath=%CATALINA_HOME%\bin;
>>
>> set args=%args% --StopMode=jvm
>> set args=%args% --StopClass=org.apache.catalina.startup.Bootstrap
>> set args=%args% --StopParams=stop
>> rem set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
>> rem set args=%args% --StopPath=%CATALINA_HOME%\bin
>>
>> %CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatTest %args%
>> set args=
>> set BASEDIR=
>> _____________________________________________________________________________
>>
>> Now when we run the service and start the application - we get the
>> following exception -
>> java.lang.UnsatisfiedLinkError:
>> C:\oracle\product\10.2.0\client_1\ocijdbc10.dll: Can't find dependent
>> libraries
>> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
>> at java.lang.Runtime.loadLibrary0(Runtime.java:822)
>> at java.lang.System.loadLibrary(System.java:992)
>> at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3135)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3131)
>> at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
>> at
>> oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
>> at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
>> at
>> oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
>> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
>> at
>> org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
>> at
>> org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
>> at
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
>> at
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
>> at
>> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
>> <<snipped>>
>>
>> Can anybody please help me locate how to fix the service installation
>> script to avoid the exception. I am assuming since the regular command
>> prompt way of starting tomcat works fine with the driver, its the service
>> installation script which is missing something.
>>
>> Thanks,
>> Rumpa Giri
>>
>>
>> ---------------------------------
>> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
>> how.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Service and OCI
Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
Now Tomcat is also a cool pojo application server
---------------------------------------------------------------------------
Rumpa I dont know, going to guess.
First Guess ;)
I'm wondering why you dont base this on service.bat
Starting a service is done for you, and it (service bat) look like its
actually a 2 phase thing.
First the service is installed, and then at the bottom, they give you a
place to add options, with another call.
You seem to be doing it the hard way.
Second Guess ;)
The error you getting has got nothing to do with the JDBC driver, it cant
find the DLL.
I think if you put the DLL in windows/system32 it would find it.
Which means the system path or something like that is not right.
The Tomcat service probably checks this sort of thing when started in 2
phases, but the cause is probably because services run under a "local system
user", and the system paths showing the location of those DLL's are under
"your" user name and not in ALL user names... see My Computer (right
cick) -> Advanced -> Env Variables.
Then finally, if you do let Tomcat do its thing through service bat, you
should get a task bar icon, if you click on that and look at the Java tab,
its easy to see which JavaOpts are coming through and you can change and
test there as well.
Compliments of the Season
----- Original Message -----
From: "Rumpa Giri" <gi...@yahoo.com>
To: <us...@tomcat.apache.org>
Sent: Saturday, December 01, 2007 4:01 AM
Subject: Tomcat Service and OCI
> Hello,
>
> I am trying to run the tomcat as NT Service, but does not seem to work
> with OCI, if I run the same tomcat instance not as a service but via
> startup.bat, the OCI JDBC driver works fine.
>
> Can anybody help me locate how to fix the service installation script to
> avoid the exception.
>
> Local setup followed -
>
> 1) I have installed tomcat 5.5.25.
> 2) Installed oracle client installation to use JDBC OCI Driver.
> a) Installed the oracle client installation at location -
> C:\oracle\product\10.2.0\client_1
> b) PATH is updated to reflect the above location for the dlls.
> c) copied the ojdbc14.ar to the %CATALINA_HOME%/commo/lib/ folder.
> 3) the context.xml has the OCI URL properly -
> <Resource name="jdbc/provider" auth="Container"
> type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.driver.OracleDriver"
> url="jdbc:oracle:oci:@//<IP>:1521/orcl"
> username="UN" password="PWD" maxActive="20" maxIdle="10"
> maxWait="-1"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"
> />
>
> If i run the %CATALINA_HOME%/bin/startup.bat - the application works fine
> and the JDBC code excutes properly.
>
> To install the tomcat as a service I ran the following script -
> NOTE - We did specify the -Djava.library.path in the script.
>
> _____________________________________________________________________________
> SET CATALINA_HOME=C:\tools\apache-tomcat-5.5.25
> SET CATALINA_BASE=C:\tools\apache-tomcat-5.5.25
>
> @echo off
>
> echo CATALINA_HOME: %CATALINA_HOME%
> echo CATALINA_BASE: %CATALINA_BASE%
> echo JAVA_HOME: %JAVA_HOME%
> pause
> set BASEDIR=%CATALINA_HOME%
> call "%CATALINA_HOME%\bin\setclasspath.bat"
>
> set args=%args% --Description=TOMCAT1
> set args=%args% --DisplayName=TOMCAT1
>
> set args=%args% --Startup=auto
>
> set args=%args% --LogPath=%CATALINA_BASE%\logs
> set args=%args% --LogLevel=DEBUG
> set args=%args% --StdError=%CATALINA_BASE%\logs\tomcat1_err.log
> set args=%args% --StdOutput=%CATALINA_BASE%\logs\tomcat1_out.log
>
> set
> args=%args% --Classpath="%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar"
>
> set args=%args% --JavaHome=%JAVA_HOME%
> set args=%args% --Jvm=%JAVA_HOME%\jre\bin\server\jvm.dll
> set
> args=%args% --JvmOptions="-Xms128m;-Xmx512m;-Djava.library.path=C:\oracle\product\10.2.0\client_1;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"
>
> set args=%args% --StartMode=jvm
> set args=%args% --StartClass=org.apache.catalina.startup.Bootstrap
> set args=%args% --StartParams=start
> rem set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
> rem set args=%args% --StartPath=%CATALINA_HOME%\bin;
>
> set args=%args% --StopMode=jvm
> set args=%args% --StopClass=org.apache.catalina.startup.Bootstrap
> set args=%args% --StopParams=stop
> rem set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
> rem set args=%args% --StopPath=%CATALINA_HOME%\bin
>
> %CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatTest %args%
> set args=
> set BASEDIR=
> _____________________________________________________________________________
>
> Now when we run the service and start the application - we get the
> following exception -
> java.lang.UnsatisfiedLinkError:
> C:\oracle\product\10.2.0\client_1\ocijdbc10.dll: Can't find dependent
> libraries
> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
> at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
> at java.lang.Runtime.loadLibrary0(Runtime.java:822)
> at java.lang.System.loadLibrary(System.java:992)
> at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3135)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3131)
> at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
> at
> oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
> at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
> at
> oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
> at
> org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
> at
> org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
> at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
> at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
> at
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
> <<snipped>>
>
> Can anybody please help me locate how to fix the service installation
> script to avoid the exception. I am assuming since the regular command
> prompt way of starting tomcat works fine with the driver, its the service
> installation script which is missing something.
>
> Thanks,
> Rumpa Giri
>
>
> ---------------------------------
> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
> how.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Service and OCI
Posted by Tim Funk <fu...@joedog.org>.
I tested the performance years (3+) ago trying to answer the same
question. In most cases the OCI driver was faster but in some tests the
thin driver was faster (IIRC the results from that long ago).
That being said - the performance difference in the drivers is (most
likely) negligible compared to all the other issues that can slow a
request down.
-Tim
Rumpa Giri wrote:
> Thanks a lot, speaking of OCI, is there any evidence that OCI will perform better than the THIN driver?
>
> We are being encouraged to use OCI on production environment since everybody says so, but our development team isn't convinced of the same. We are using oracle 10g and based on their documentation there isn't much difference between OCI and THIN, the 10g THIN driver now supports what OCI used to have advantage over.
>
> Thanks again,
> Rumpa
>
> Tim Funk <fu...@joedog.org> wrote:
> When run as a service - the PATH used by SYSTEM is not the same as when
> you are logged in. (So you need to add the dll's somewhere in your path
> as SYSTEM user - I can't recall how this is done but this is a very
> common problem google can help you with)
>
> The type 4 jdbc driver from oracle has been very stable for the last
> (lot of) years. There really isn't much reason top use the OCI driver.
>
> -Tim
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Service and OCI
Posted by Rumpa Giri <gi...@yahoo.com>.
Thanks a lot, speaking of OCI, is there any evidence that OCI will perform better than the THIN driver?
We are being encouraged to use OCI on production environment since everybody says so, but our development team isn't convinced of the same. We are using oracle 10g and based on their documentation there isn't much difference between OCI and THIN, the 10g THIN driver now supports what OCI used to have advantage over.
Thanks again,
Rumpa
Tim Funk <fu...@joedog.org> wrote:
When run as a service - the PATH used by SYSTEM is not the same as when
you are logged in. (So you need to add the dll's somewhere in your path
as SYSTEM user - I can't recall how this is done but this is a very
common problem google can help you with)
The type 4 jdbc driver from oracle has been very stable for the last
(lot of) years. There really isn't much reason top use the OCI driver.
-Tim
Rumpa Giri wrote:
> Hello,
>
> I am trying to run the tomcat as NT Service, but does not seem to work with OCI, if I run the same tomcat instance not as a service but via startup.bat, the OCI JDBC driver works fine.
>
> Can anybody help me locate how to fix the service installation script to avoid the exception.
>
> Local setup followed -
>
> 1) I have installed tomcat 5.5.25.
> 2) Installed oracle client installation to use JDBC OCI Driver.
> a) Installed the oracle client installation at location - C:\oracle\product\10.2.0\client_1
> b) PATH is updated to reflect the above location for the dlls.
> c) copied the ojdbc14.ar to the %CATALINA_HOME%/commo/lib/ folder.
> 3) the context.xml has the OCI URL properly -
> > type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
> url="jdbc:oracle:oci:@//:1521/orcl"
> username="UN" password="PWD" maxActive="20" maxIdle="10"
> maxWait="-1"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"
> />
>
> If i run the %CATALINA_HOME%/bin/startup.bat - the application works fine and the JDBC code excutes properly.
>
> To install the tomcat as a service I ran the following script -
> NOTE - We did specify the -Djava.library.path in the script.
> _____________________________________________________________________________
> SET CATALINA_HOME=C:\tools\apache-tomcat-5.5.25
> SET CATALINA_BASE=C:\tools\apache-tomcat-5.5.25
>
> @echo off
>
> echo CATALINA_HOME: %CATALINA_HOME%
> echo CATALINA_BASE: %CATALINA_BASE%
> echo JAVA_HOME: %JAVA_HOME%
> pause
> set BASEDIR=%CATALINA_HOME%
> call "%CATALINA_HOME%\bin\setclasspath.bat"
>
> set args=%args% --Description=TOMCAT1
> set args=%args% --DisplayName=TOMCAT1
>
> set args=%args% --Startup=auto
>
> set args=%args% --LogPath=%CATALINA_BASE%\logs
> set args=%args% --LogLevel=DEBUG
> set args=%args% --StdError=%CATALINA_BASE%\logs\tomcat1_err.log
> set args=%args% --StdOutput=%CATALINA_BASE%\logs\tomcat1_out.log
>
> set args=%args% --Classpath="%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar"
>
> set args=%args% --JavaHome=%JAVA_HOME%
> set args=%args% --Jvm=%JAVA_HOME%\jre\bin\server\jvm.dll
> set args=%args% --JvmOptions="-Xms128m;-Xmx512m;-Djava.library.path=C:\oracle\product\10.2.0\client_1;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"
>
> set args=%args% --StartMode=jvm
> set args=%args% --StartClass=org.apache.catalina.startup.Bootstrap
> set args=%args% --StartParams=start
> rem set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
> rem set args=%args% --StartPath=%CATALINA_HOME%\bin;
>
> set args=%args% --StopMode=jvm
> set args=%args% --StopClass=org.apache.catalina.startup.Bootstrap
> set args=%args% --StopParams=stop
> rem set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
> rem set args=%args% --StopPath=%CATALINA_HOME%\bin
>
> %CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatTest %args%
> set args=
> set BASEDIR=
> _____________________________________________________________________________
>
> Now when we run the service and start the application - we get the following exception -
> java.lang.UnsatisfiedLinkError: C:\oracle\product\10.2.0\client_1\ocijdbc10.dll: Can't find dependent libraries
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
Re: Tomcat Service and OCI
Posted by Tim Funk <fu...@joedog.org>.
When run as a service - the PATH used by SYSTEM is not the same as when
you are logged in. (So you need to add the dll's somewhere in your path
as SYSTEM user - I can't recall how this is done but this is a very
common problem google can help you with)
The type 4 jdbc driver from oracle has been very stable for the last
(lot of) years. There really isn't much reason top use the OCI driver.
-Tim
Rumpa Giri wrote:
> Hello,
>
> I am trying to run the tomcat as NT Service, but does not seem to work with OCI, if I run the same tomcat instance not as a service but via startup.bat, the OCI JDBC driver works fine.
>
> Can anybody help me locate how to fix the service installation script to avoid the exception.
>
> Local setup followed -
>
> 1) I have installed tomcat 5.5.25.
> 2) Installed oracle client installation to use JDBC OCI Driver.
> a) Installed the oracle client installation at location - C:\oracle\product\10.2.0\client_1
> b) PATH is updated to reflect the above location for the dlls.
> c) copied the ojdbc14.ar to the %CATALINA_HOME%/commo/lib/ folder.
> 3) the context.xml has the OCI URL properly -
> <Resource name="jdbc/provider" auth="Container"
> type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
> url="jdbc:oracle:oci:@//<IP>:1521/orcl"
> username="UN" password="PWD" maxActive="20" maxIdle="10"
> maxWait="-1"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"
> />
>
> If i run the %CATALINA_HOME%/bin/startup.bat - the application works fine and the JDBC code excutes properly.
>
> To install the tomcat as a service I ran the following script -
> NOTE - We did specify the -Djava.library.path in the script.
> _____________________________________________________________________________
> SET CATALINA_HOME=C:\tools\apache-tomcat-5.5.25
> SET CATALINA_BASE=C:\tools\apache-tomcat-5.5.25
>
> @echo off
>
> echo CATALINA_HOME: %CATALINA_HOME%
> echo CATALINA_BASE: %CATALINA_BASE%
> echo JAVA_HOME: %JAVA_HOME%
> pause
> set BASEDIR=%CATALINA_HOME%
> call "%CATALINA_HOME%\bin\setclasspath.bat"
>
> set args=%args% --Description=TOMCAT1
> set args=%args% --DisplayName=TOMCAT1
>
> set args=%args% --Startup=auto
>
> set args=%args% --LogPath=%CATALINA_BASE%\logs
> set args=%args% --LogLevel=DEBUG
> set args=%args% --StdError=%CATALINA_BASE%\logs\tomcat1_err.log
> set args=%args% --StdOutput=%CATALINA_BASE%\logs\tomcat1_out.log
>
> set args=%args% --Classpath="%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar"
>
> set args=%args% --JavaHome=%JAVA_HOME%
> set args=%args% --Jvm=%JAVA_HOME%\jre\bin\server\jvm.dll
> set args=%args% --JvmOptions="-Xms128m;-Xmx512m;-Djava.library.path=C:\oracle\product\10.2.0\client_1;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"
>
> set args=%args% --StartMode=jvm
> set args=%args% --StartClass=org.apache.catalina.startup.Bootstrap
> set args=%args% --StartParams=start
> rem set args=%args% --StartImage=%CATALINA_HOME%\bin\tomcat5.exe
> rem set args=%args% --StartPath=%CATALINA_HOME%\bin;
>
> set args=%args% --StopMode=jvm
> set args=%args% --StopClass=org.apache.catalina.startup.Bootstrap
> set args=%args% --StopParams=stop
> rem set args=%args% --StopImage=%CATALINA_HOME%\bin\tomcat5.exe
> rem set args=%args% --StopPath=%CATALINA_HOME%\bin
>
> %CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatTest %args%
> set args=
> set BASEDIR=
> _____________________________________________________________________________
>
> Now when we run the service and start the application - we get the following exception -
> java.lang.UnsatisfiedLinkError: C:\oracle\product\10.2.0\client_1\ocijdbc10.dll: Can't find dependent libraries
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org