RE: environment variables for hostname and context name
From: Chris Cheshire [mailto:cheshira...@gmail.com] Subject: Re: environment variables for hostname and context name The tomcat directory is available through the environment somehow, and is accessed as ${catalina.home}. The ${catalina.home} reference is to a system property, not an environment variable - these are two entirely separate and distinct mechanisms. What else is exposed this way? Use System.getProperties() in a servlet to find out. Lambda Probe has a screen that displays all of them. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: environment variables for hostname and context name
org.apache.jasper.JasperException: /WEB-INF/jsp/login.jsp(17,2) Unterminated lt;core:if tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [jasper.jar:na] this says that login.jsp at line 17 column2 has an unterminated if tag here is a complete example that uses if component from Struts core e.g. s:if test=#groupStatus.odd == true odd/s:if !-- assuming you have this taglib declaration -- %@ taglib prefix=s uri=/struts-tags% html head titletest For Bharaat/title meta name=GENERATOR content=Microsoft FrontPage 3.0 /head body table tr class=trheadermain align=center bgcolor=#99 height=17 td colspan=4 align=center height=17 width=100%/td /tr tr bgcolor=#99 height=17 td class=trheadermain colspan=2 align=center height=17 width=33%bNAME/b/td td class=trheadermain width=33%bPrice/b/td td class=trheadermain width=33%bOriginal Value/b/td /tr tr td!-- construct an iterator which will iterate thru a Entries list supplied by simple.GetEntryAction -- webwork:iterator value=simple.GetEntryAction status=groupStatus /td /tr s:iterator value=groupDao.groups status=groupStatus tr class=s:if test=#groupStatus.odd == true odd/s:ifs:elseeven/s:else /tr /s:iterator /tr /table /body /html Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Fri, 18 Sep 2009 17:18:08 -0700 Subject: environment variables for hostname and context name From: cheshira...@gmail.com To: users@tomcat.apache.org I'm reconfiguring the logging for my tomcat installation (6.0.20) to use logback (instead of log4j) for the server logging so I can split out error messages on a per host basis. I see that catalina.home is exposed as an environment var and usable in the logging configuration file - what about the hostname and context name/path? I would like to set up a config file such that I don't have to edit it every time I add a new sandbox for a developer (host). I want the errors split out per host instead of one big file, because it makes it possible to tell which sandbox had a problem with a JSP page for instance. I have it working if I hardcode a new appender per host going to a separate file - something like : root level=INFO appender-ref ref=tomcat / /root logger name=org.apache.catalina.core.ContainerBase.[Catalina].[a.domain.com] level=INFO additivity=false appender-ref ref=tomcat_www / /logger and then two appenders, one for base logging from the tomcat container, and then one for the host a.domain.com. appender name=tomcat_www class=ch.qos.logback.core.rolling.RollingFileAppender File${catalina.home}/logs/tomcat-www.log/File RollingPolicy class=ch.qos.logback.core.rolling.TimeBasedRollingPolicy FileNamePattern${catalina.home}/logs/tomcat-www.%d{-MM-dd}.log.gz/FileNamePattern /RollingPolicy layout class=ch.qos.logback.classic.PatternLayout Pattern%-25(%date{HH:mm:ss.SSS} [%thread]) %-5level%n%logger%n%msg%n/Pattern /layout /appender Now when I log an error I see something like : 17:04:01.890 [http-8080-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[a.domain.com].[/foo].[default] Servlet.service() for servlet default threw exception org.apache.jasper.JasperException: /WEB-INF/jsp/login.jsp(17,2) Unterminated lt;core:if tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [jasper.jar:na] [blah blah blah] a.domain.com is the host where the web app is deployed. foo is the context path under which the app is deployed. So if it was able to log this information, it must be accessible somewhere, right? If I can get access to the hostname and context name I can specify a dynamic file name using these variables, and then only have one appender defined no matter how many new hosts I deploy. Chris
Re: environment variables for hostname and context name
I forced that error specifically for this example. That's not the issue. That is an example of what I am trying to log, and it illustrates that the information I need is available at the logging level. On Fri, Sep 18, 2009 at 7:01 PM, Martin Gainty mgai...@hotmail.com wrote: org.apache.jasper.JasperException: /WEB-INF/jsp/login.jsp(17,2) Unterminated core:if tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [jasper.jar:na] this says that login.jsp at line 17 column2 has an unterminated if tag here is a complete example that uses if component from Struts core e.g. s:if test=#groupStatus.odd == true odd/s:if - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: environment variables for hostname and context name
On 19.09.2009 02:18, Chris Cheshire wrote: I'm reconfiguring the logging for my tomcat installation (6.0.20) to use logback (instead of log4j) for the server logging so I can split out error messages on a per host basis. I see that catalina.home is exposed as an environment var and usable in the logging configuration file - what about the hostname and context name/path? I would like to set up a config file such that I don't have to edit it every time I add a new sandbox for a developer (host). I want the errors split out per host instead of one big file, because it makes it possible to tell which sandbox had a problem with a JSP page for instance. I have it working if I hardcode a new appender per host going to a separate file - something like : root level=INFO appender-ref ref=tomcat / /root logger name=org.apache.catalina.core.ContainerBase.[Catalina].[a.domain.com] level=INFO additivity=false appender-ref ref=tomcat_www / /logger and then two appenders, one for base logging from the tomcat container, and then one for the host a.domain.com. appender name=tomcat_www class=ch.qos.logback.core.rolling.RollingFileAppender File${catalina.home}/logs/tomcat-www.log/File RollingPolicy class=ch.qos.logback.core.rolling.TimeBasedRollingPolicy FileNamePattern${catalina.home}/logs/tomcat-www.%d{-MM-dd}.log.gz/FileNamePattern /RollingPolicy layout class=ch.qos.logback.classic.PatternLayout Pattern%-25(%date{HH:mm:ss.SSS} [%thread]) %-5level%n%logger%n%msg%n/Pattern /layout /appender Now when I log an error I see something like : 17:04:01.890 [http-8080-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[a.domain.com].[/foo].[default] Servlet.service() for servlet default threw exception org.apache.jasper.JasperException: /WEB-INF/jsp/login.jsp(17,2) Unterminated lt;core:if tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [jasper.jar:na] [blah blah blah] a.domain.com is the host where the web app is deployed. foo is the context path under which the app is deployed. So if it was able to log this information, it must be accessible somewhere, right? If I can get access to the hostname and context name I can specify a dynamic file name using these variables, and then only have one appender defined no matter how many new hosts I deploy. In configuration files Log4J only support two kinds of variables: - system properties - variables defined previously inside Log4J (typically in the same config file) Both ways do not have the ability to react on context information during logging. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: environment variables for hostname and context name
Right. The tomcat directory is available through the environment somehow, and is accessed as ${catalina.home}. From here I can get to the tomcat logs directory. What else is exposed this way? I am hoping that if the host and context are available in the logging message itself, then maybe they are/can be exposed. Those values are generated internally by tomcat when it dumps that stack trace, they weren't part of the original logging message. On Fri, Sep 18, 2009 at 8:30 PM, Rainer Jung rainer.j...@kippdata.de wrote: On 19.09.2009 02:18, Chris Cheshire wrote: I'm reconfiguring the logging for my tomcat installation (6.0.20) to use logback (instead of log4j) for the server logging so I can split out error messages on a per host basis. I see that catalina.home is exposed as an environment var and usable in the logging configuration file - what about the hostname and context name/path? I would like to set up a config file such that I don't have to edit it every time I add a new sandbox for a developer (host). I want the errors split out per host instead of one big file, because it makes it possible to tell which sandbox had a problem with a JSP page for instance. I have it working if I hardcode a new appender per host going to a separate file - something like : root level=INFO appender-ref ref=tomcat / /root logger name=org.apache.catalina.core.ContainerBase.[Catalina].[a.domain.com] level=INFO additivity=false appender-ref ref=tomcat_www / /logger and then two appenders, one for base logging from the tomcat container, and then one for the host a.domain.com. appender name=tomcat_www class=ch.qos.logback.core.rolling.RollingFileAppender File${catalina.home}/logs/tomcat-www.log/File RollingPolicy class=ch.qos.logback.core.rolling.TimeBasedRollingPolicy FileNamePattern${catalina.home}/logs/tomcat-www.%d{-MM-dd}.log.gz/FileNamePattern /RollingPolicy layout class=ch.qos.logback.classic.PatternLayout Pattern%-25(%date{HH:mm:ss.SSS} [%thread]) %-5level%n%logger%n%msg%n/Pattern /layout /appender Now when I log an error I see something like : 17:04:01.890 [http-8080-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[a.domain.com].[/foo].[default] Servlet.service() for servlet default threw exception org.apache.jasper.JasperException: /WEB-INF/jsp/login.jsp(17,2) Unterminated lt;core:if tag at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [jasper.jar:na] [blah blah blah] a.domain.com is the host where the web app is deployed. foo is the context path under which the app is deployed. So if it was able to log this information, it must be accessible somewhere, right? If I can get access to the hostname and context name I can specify a dynamic file name using these variables, and then only have one appender defined no matter how many new hosts I deploy. In configuration files Log4J only support two kinds of variables: - system properties - variables defined previously inside Log4J (typically in the same config file) Both ways do not have the ability to react on context information during logging. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Environment Variables
Tomcat does not use CLASSPATH. The list of variables used by tomcat is written at the top of catalina.sh script. En l'instant précis du 06/06/08 10:46, [EMAIL PROTECTED] s'exprimait en ces termes: Hi, Can anybody tell me which environment variables tomcat uses? I am pretty sure it uses JAVA_HOME for core java, and I am guessing it uses the web application directories for classes belonging to web apps under it. The reason I am asking this is that I have a jar file clash on my development machine, and when I try to run a certain class I get the error: java.lang.LinkageError: loader constraints violated when linking javax/xml/rpc/Service class. I am pretty sure this is because I have 2 copies of a class located in different jar files, I googled this and a lot of links point to CLASSPATH, but my CLASSPATH variable doesn't really have anything in it: C:\Program Files\gemplus\gac\GATicket.jar;C:\Program Files\gemplus\gac\iaikPkcs11Wrapper.jar Appreciate any help. Thanks, Paul Ockleford ** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Environment Variables
Brilliant thanks for that. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: 06 June 2008 07:49 To: Tomcat Users List Subject: Re: Environment Variables Tomcat does not use CLASSPATH. The list of variables used by tomcat is written at the top of catalina.sh script. En l'instant précis du 06/06/08 10:46, [EMAIL PROTECTED] s'exprimait en ces termes: Hi, Can anybody tell me which environment variables tomcat uses? I am pretty sure it uses JAVA_HOME for core java, and I am guessing it uses the web application directories for classes belonging to web apps under it. The reason I am asking this is that I have a jar file clash on my development machine, and when I try to run a certain class I get the error: java.lang.LinkageError: loader constraints violated when linking javax/xml/rpc/Service class. I am pretty sure this is because I have 2 copies of a class located in different jar files, I googled this and a lot of links point to CLASSPATH, but my CLASSPATH variable doesn't really have anything in it: C:\Program Files\gemplus\gac\GATicket.jar;C:\Program Files\gemplus\gac\iaikPkcs11Wrapper.jar Appreciate any help. Thanks, Paul Ockleford ** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Environment Variables
From: David Delbecq [mailto:[EMAIL PROTECTED] Subject: Re: Environment Variables Tomcat does not use CLASSPATH. The list of variables used by tomcat is written at the top of catalina.sh script. Note that the Tomcat code does not use *any* environment variables - only the scripts do. The scripts translate some of the pertinent variables to system properties set on the command line, and Tomcat does make use of those. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Environment variables
From: Andrew Hole [mailto:[EMAIL PROTECTED] Subject: Environment variables how can I setup environment variables on tomcat windows service? Tomcat cleans environment variables... You can't - services don't use environment variables. Use the tomcat?w.exe program to set Java system properties and heap values for the service. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Environment variables
I'm trying to execute a ssh command inside java code. SSH command must know HOMEDRIVE environment variable to find know_hosts file... How can I do that? Thanks a lot On Nov 6, 2007 3:14 PM, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Andrew Hole [mailto:[EMAIL PROTECTED] Subject: Environment variables how can I setup environment variables on tomcat windows service? Tomcat cleans environment variables... You can't - services don't use environment variables. Use the tomcat?w.exe program to set Java system properties and heap values for the service. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Environment variables
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew, Andrew Hole wrote: I'm trying to execute a ssh command inside java code. SSH command must know HOMEDRIVE environment variable to find know_hosts file... How can I do that? How are you invoking ssh? If you're doing a standard Runtime.exec, why not just use the versions of that method which take environment variables as parameters? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHMIcT9CaO5/Lv0PARAmbgAJwLJiMu33Cs8qdsBoG2afUuVFvJ0wCgmDmD tuvpCb2Wc21yYuc1w+q8GJA= =fG1R -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Environment variables
I will try!!! Thanks a lot On Nov 6, 2007 3:24 PM, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew, Andrew Hole wrote: I'm trying to execute a ssh command inside java code. SSH command must know HOMEDRIVE environment variable to find know_hosts file... How can I do that? How are you invoking ssh? If you're doing a standard Runtime.exec, why not just use the versions of that method which take environment variables as parameters? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHMIcT9CaO5/Lv0PARAmbgAJwLJiMu33Cs8qdsBoG2afUuVFvJ0wCgmDmD tuvpCb2Wc21yYuc1w+q8GJA= =fG1R -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Environment variables
Andrew Hole wrote: I'm trying to execute a ssh command inside java code. SSH command must know HOMEDRIVE environment variable to find know_hosts file... How can I do that? Hi Andrew, You can pass the value as a Java Option. Click the Tomcat Service Manager icon (usually lower right of the Windows Taskbar). Click the Java Tab. Then append to the bottom of Java Options. -- Regards Gabe Wong NGASI AppServer Manager Application server installation and configuration AUTOMATION http://www.ngasi.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]