You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sampath Kumar Rallapalli <sk...@yahoo.com> on 2007/01/17 17:46:17 UTC

Tomcat 5.5.20: issue with tomcat service & defining application specific environment variables

Hi,
   
  I am using Tomcat5.5.20 along with jdk 1.5.0_09 on Windows XP SP1 and running Tomcat as a Windows Service. For running Tomcat as windows service, I opened a cmd line prompt and executed the bat file, service.bat by providing the argument as "service.bat install".
  Then, I started the service and tomcat is running on the port 8080. I could access the Tomcat default page (http://localhost:8080) successfully. It worked fine upto this point.
   
  Issue 1:
  When I tried to access an application that I deployed by placing the war file in the webapps directory, it gives the exceptions. I could not access the login page of my application.
  The error says a dll of my application is not in java.library.path. (Everything works fine if I start the tomcat using the Startup.bat instead of running it as service. I could login to my application and perform the tasks as required).
   
  But the path to this dll is defined in the SYSTEM variables in the SYSTEM PATH variable.
  It seems that tomcat is not able to read the SYSTEM Path correctly. Can any one provide me inputs on how to fix this issue?
   
  Issue 2:
  Also, if the tomcat is running in service mode, how to provide the application specific environment variables? I tried creating the file setenv.bat inside <CATALINA_HOME>\bin directory and stopped and restarted the service. But, tomcat service has not picked them up. (If we run tomcat in non-service mode, we can define the application specific settings in Startup.bat).
   
  Thanks for your consideration.
   
  Regards,
  Sampath Kumar

 
---------------------------------
 Get your own web address.
 Have a HUGE year through Yahoo! Small Business.

RE: Tomcat 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
> Subject: RE: Tomcat 5.5.20: issue with tomcat service & 
> defining application specific environment variables
>    
>   I set the environment variable, -Djava.library.path

This is _not_ an environment variable - it's a Java system property.

> it appeared to me that the Tomcat picked up this value as it 
> gave me a different error as "Can't find Dependent Libraries."

You can see what the values are by deploying Lambda Probe in Tomcat and
looking at the System Properties page.  Does Tomcat running as a service
(usually using the System account) have access to the path you defined?
Such a path must point to a location on a local hard drive.

>   I tried adding the Path variable to the java tab by adding, 
> -DPath=%PATH%.... did not work.

Not surprising; nothing in the JVM looks for a system property named
"PATH".

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by Sampath Kumar Rallapalli <sk...@yahoo.com>.
Hi Chuck,
   
  Thanks for your follow up and here is an update from me.
   
  I set the environment variable, -Djava.library.path  on the java tab of 'Tomat Service Monitor' for java.library.path and it appeared to me that the Tomcat picked up this value as it gave me a different error as "Can't find Dependent Libraries."
   
  "java.lang.UnsatisfiedLinkError:  <<the dll name with correct path as expected>> Can't find dependent libraries"
   
  I tried adding the Path variable to the java tab by adding, -DPath=%PATH%.... did not work.
  Another attempt by adding the -DPath=<<copied the System Path>> and still did not work.
   
  If I run the Tomcat using the startup.bat instead of running as Service, everything works fine.
   
  Any more inputs?
   
  Regards,
  Sampath
  

"Caldarale, Charles R" <Ch...@unisys.com> wrote:
  > From: Caldarale, Charles R 
> Subject: RE: Tomcat 5.5.20: issue with tomcat service & 
> defining application specific environment variables
> 
> > From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
> > Subject: RE: Tomcat 5.5.20: issue with tomcat service & 
> > defining application specific environment variables
> > 
> > Thanks Chuck for your response. I tried your suggestion of 
> > providing an additional argument on Java tab for 
> > java.library.path and it did not work.
> 
> Exactly what did you try?

I just verified that arbitrary -D parameters are handled properly with
the Java tab of tomcat5w.exe. I added these values:

-Dtest.property=dummy
-Djava.library.path=G:\testing

and Lambda Probe shows both of them in its system properties display.
You do have to restart Tomcat after setting them, of course. This is
with Tomcat 5.5.20 and both JDK 1.5 and 1.6.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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



 
---------------------------------
 Get your own web address.
 Have a HUGE year through Yahoo! Small Business.

RE: Tomcat 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Caldarale, Charles R 
> Subject: RE: Tomcat 5.5.20: issue with tomcat service & 
> defining application specific environment variables
> 
> > From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
> > Subject: RE: Tomcat 5.5.20: issue with tomcat service & 
> > defining application specific environment variables
> > 
> > Thanks Chuck for your response. I tried your suggestion of 
> > providing an additional argument on Java tab for 
> > java.library.path and it did not work.
> 
> Exactly what did you try?

I just verified that arbitrary -D parameters are handled properly with
the Java tab of tomcat5w.exe.  I added these values:

-Dtest.property=dummy
-Djava.library.path=G:\testing

and Lambda Probe shows both of them in its system properties display.
You do have to restart Tomcat after setting them, of course.  This is
with Tomcat 5.5.20 and both JDK 1.5 and 1.6.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
> Subject: RE: Tomcat 5.5.20: issue with tomcat service & 
> defining application specific environment variables
> 
> Thanks Chuck for your response. I tried your suggestion of 
> providing an additional argument on Java tab for 
> java.library.path and it did not work.

Exactly what did you try?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by Martin Gainty <mg...@hotmail.com>.
a re-iteration of the suggestion already offered
if in $JAVA_HOME%/jre/lib/i386/jvm.cfg you would see a specification for java.library.path as in
/********contents of jvm.cfg**********/
java.library.path=/opt/jdk1.5.0_06/jre/lib/i386/client

then..
place your dll in /opt/jdk1.5.0_06/jre/lib/i386/client

M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Sampath Kumar Rallapalli" <sk...@yahoo.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, January 17, 2007 2:58 PM
Subject: RE: Tomcat 5.5.20: issue with tomcat service & defining application specific environment variables


> Thanks Chuck for your response. I tried your suggestion of providing an additional argument on Java tab for java.library.path and it did not work.
>   
>  Any further inputs would be appreciated.
>   
>  Regards,
>  Sampath
>  
> 
> "Caldarale, Charles R" <Ch...@unisys.com> wrote:
>  > From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
>> Subject: Tomcat 5.5.20: issue with tomcat service & defining 
>> application specific environment variables
>>
>> But the path to this dll is defined in the SYSTEM variables 
>> in the SYSTEM PATH variable.
> 
> Not sure if services have access to environment variables. In any
> event, the easiest way is to set the appropriate -D values in the Java
> tab of the tomcat5w.exe utility. For this case, it's:
> -Djava.library.path=
> 
>> Also, if the tomcat is running in service mode, how to 
>> provide the application specific environment variables?
> 
> As above, I think you'll need to use Java system properties, not
> environment variables.
> 
> - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 
> 
> ---------------------------------
> Food fight? Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.

RE: Tomcat 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by Sampath Kumar Rallapalli <sk...@yahoo.com>.
Thanks Chuck for your response. I tried your suggestion of providing an additional argument on Java tab for java.library.path and it did not work.
   
  Any further inputs would be appreciated.
   
  Regards,
  Sampath
  

"Caldarale, Charles R" <Ch...@unisys.com> wrote:
  > From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
> Subject: Tomcat 5.5.20: issue with tomcat service & defining 
> application specific environment variables
>
> But the path to this dll is defined in the SYSTEM variables 
> in the SYSTEM PATH variable.

Not sure if services have access to environment variables. In any
event, the easiest way is to set the appropriate -D values in the Java
tab of the tomcat5w.exe utility. For this case, it's:
-Djava.library.path=

> Also, if the tomcat is running in service mode, how to 
> provide the application specific environment variables?

As above, I think you'll need to use Java system properties, not
environment variables.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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



 
---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.

RE: Tomcat 5.5.20: issue with tomcat service & defining application specific environment variables

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Sampath Kumar Rallapalli [mailto:skumar_rallapalli@yahoo.com] 
> Subject: Tomcat 5.5.20: issue with tomcat service & defining 
> application specific environment variables
>
>   But the path to this dll is defined in the SYSTEM variables 
> in the SYSTEM PATH variable.

Not sure if services have access to environment variables.  In any
event, the easiest way is to set the appropriate -D values in the Java
tab of the tomcat5w.exe utility.  For this case, it's:
-Djava.library.path=<your-name-here>

> Also, if the tomcat is running in service mode, how to 
> provide the application specific environment variables?

As above, I think you'll need to use Java system properties, not
environment variables.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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