Trouble with context and JNDI resource
I'm using this page, trying to get a resource in a java class: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html I have this in context.xml: Context !-- Default set of monitored resources -- WatchedResourceWEB-INF/web.xml/WatchedResource !-- Uncomment this to disable session persistence across Tomcat restarts -- !-- Manager pathname= / -- Resource name=proteus auth=Container type=org.apache.commons.dbcp.BasicDataSource maxActive=100 maxIdle=30 maxWait=1 username=install password=install driverClassName=com.informix.jdbc.IfxDriver url=jdbc:informix-sqli://sigma:1960/proteus:INFORMIXSERVER=sigma;IFX_LOCK_M ODE_WAIT=-1;IFX_ISOLATION_LEVEL=1 /Resource /Context I have this in web.xml: resource-env-ref description Connection pool for xmlrpc. /description resource-env-ref-name proteus /resource-env-ref-name resource-env-ref-type org.apache.commons.dbcp.BasicDataSource /resource-env-ref-type /resource-env-ref I have this code: l.debug(Created the status xmlrpc class); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(); this.setDataSource((BasicDataSource) envCtx.lookup(proteus)); I get this error: Name proteus is not bound in this Context - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Trouble with context and JNDI resource
OK, thanks, what does your context.xml look like for the jdbc/progress? -Original Message- From: Carsten Pohl [mailto:p...@tyntec.com] Sent: Tuesday, November 03, 2009 9:03 AM To: Tomcat Users List Subject: Re: Trouble with context and JNDI resource Hi, I am no expert, but your lookup looks strange. (Empty string in lookup). Furthermore these two contextes seem strange to me. This works great for me: @Override public void init() throws ServletException { LOGGER.info(INIT has been called); try { final InitialContext initialContext = new InitialContext(); if ( initialContext == null ) { final String error = Could not create initialContext. Errors WILL happen; LOGGER.severe(error); throw new ServletException(error); } // actual jndi name is jdbc/postgres CustomerloungeServlet.datasource = (DataSource) initialContext.lookup( java:/comp/env/jdbc/postgres ); if ( CustomerloungeServlet.datasource == null ) { final String error = Could not lookup, Errors WILL happen; LOGGER.severe(error); throw new ServletException(error); } } catch (NamingException e) { LOGGER.log(Level.SEVERE,Namingexception in init,e); throw new ServletException(e.getMessage()); } } And I did not put org.apache.commons.dbcp.BasicDataSource as type of the ressource. I guess it must be org.apache.commons.dbcp.dbcp. (I guess) but in the tomcat source is string compared to: javax.sql.DataSource You can try that. Regards, Carsten Pohl - Original Message - From: Mike Baranski list-subscripti...@secmgmt.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, 3 November, 2009 14:49:04 GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Trouble with context and JNDI resource I'm using this page, trying to get a resource in a java class: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html I have this in context.xml: Context !-- Default set of monitored resources -- WatchedResourceWEB-INF/web.xml/WatchedResource !-- Uncomment this to disable session persistence across Tomcat restarts -- !-- Manager pathname= / -- Resource name=proteus auth=Container type=org.apache.commons.dbcp.BasicDataSource maxActive=100 maxIdle=30 maxWait=1 username=install password=install driverClassName=com.informix.jdbc.IfxDriver url=jdbc:informix- sqli://sigma:1960/proteus:INFORMIXSERVER=sigma;IFX_LOCK_M ODE_WAIT=-1;IFX_ISOLATION_LEVEL=1 /Resource /Context I have this in web.xml: resource-env-ref description Connection pool for xmlrpc. /description resource-env-ref-name proteus /resource-env-ref-name resource-env-ref-type org.apache.commons.dbcp.BasicDataSource /resource-env-ref-type /resource-env-ref I have this code: l.debug(Created the status xmlrpc class); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(); this.setDataSource((BasicDataSource) envCtx.lookup(proteus)); I get this error: Name proteus is not bound in this Context - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Trouble with context and JNDI resource
That worked, thanks. -Original Message- From: Mikolaj Rydzewski [mailto:m...@ceti.pl] Sent: Tuesday, November 03, 2009 9:11 AM To: Tomcat Users List Subject: Re: Trouble with context and JNDI resource Mike Baranski wrote: Resource name=proteus auth=Container type=org.apache.commons.dbcp.BasicDataSource Why not to use jdbc/proteus? Just to follow convention. I'd also rather use javax.sql.DataSource as type attribute. resource-env-ref-name proteus /resource-env-ref-name The same, use jdbc/proteus. I have this code: l.debug(Created the status xmlrpc class); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(); this.setDataSource((BasicDataSource) envCtx.lookup(proteus)); What about following: new InitialContext().lookup(java:comp/env/jdbc/proteus); -- Mikolaj Rydzewski m...@ceti.pl - 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: Trouble with context and JNDI resource
Yes, I know, what's the convention for doing this without changing the context.xml and restarting tomcat? -Original Message- From: Carsten Pohl [mailto:p...@tyntec.com] Sent: Tuesday, November 03, 2009 9:30 AM To: Tomcat Users List Subject: Re: Trouble with context and JNDI resource My context.xml is quite straightforward. ?xml version=1.0 encoding=UTF-8? Context Resource name=jdbc/postgres override=true auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql://SERVERNAME:5432/Dionysos username=FOO password=BAZ maxActive=20 maxIdle=10 maxWait=1000 removeAbandoned=true removeAbandonedTimeout=15 logAbandoned=true validationQuery=SELECT 1/ /Context I put it in the META-INF folder of my WAR. But be advised: If you think you can change the url/username or passwd once the app has been deployed in Catalina/localhost/WEBAPPNAME.xml it will NOT work. Regards, Carsten Pohl - Original Message - From: Mike Baranski list-subscripti...@secmgmt.com To: Tomcat Users List users@tomcat.apache.org, p...@tyntec.com Sent: Tuesday, 3 November, 2009 15:15:45 GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: RE: Trouble with context and JNDI resource OK, thanks, what does your context.xml look like for the jdbc/progress? -Original Message- From: Carsten Pohl [mailto:p...@tyntec.com] Sent: Tuesday, November 03, 2009 9:03 AM To: Tomcat Users List Subject: Re: Trouble with context and JNDI resource Hi, I am no expert, but your lookup looks strange. (Empty string in lookup). Furthermore these two contextes seem strange to me. This works great for me: @Override public void init() throws ServletException { LOGGER.info(INIT has been called); try { final InitialContext initialContext = new InitialContext(); if ( initialContext == null ) { final String error = Could not create initialContext. Errors WILL happen; LOGGER.severe(error); throw new ServletException(error); } // actual jndi name is jdbc/postgres CustomerloungeServlet.datasource = (DataSource) initialContext.lookup( java:/comp/env/jdbc/postgres ); if ( CustomerloungeServlet.datasource == null ) { final String error = Could not lookup, Errors WILL happen; LOGGER.severe(error); throw new ServletException(error); } } catch (NamingException e) { LOGGER.log(Level.SEVERE,Namingexception in init,e); throw new ServletException(e.getMessage()); } } And I did not put org.apache.commons.dbcp.BasicDataSource as type of the ressource. I guess it must be org.apache.commons.dbcp.dbcp. (I guess) but in the tomcat source is string compared to: javax.sql.DataSource You can try that. Regards, Carsten Pohl - Original Message - From: Mike Baranski list-subscripti...@secmgmt.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, 3 November, 2009 14:49:04 GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Trouble with context and JNDI resource I'm using this page, trying to get a resource in a java class: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html I have this in context.xml: Context !-- Default set of monitored resources -- WatchedResourceWEB-INF/web.xml/WatchedResource !-- Uncomment this to disable session persistence across Tomcat restarts -- !-- Manager pathname= / -- Resource name=proteus auth=Container type=org.apache.commons.dbcp.BasicDataSource maxActive=100 maxIdle=30 maxWait=1 username=install password=install driverClassName=com.informix.jdbc.IfxDriver url=jdbc:informix- sqli://sigma:1960/proteus:INFORMIXSERVER=sigma;IFX_LOCK_M ODE_WAIT=-1;IFX_ISOLATION_LEVEL=1 /Resource /Context I have this in web.xml: resource-env-ref description Connection pool for xmlrpc. /description resource-env-ref-name proteus /resource-env-ref-name resource-env-ref-type org.apache.commons.dbcp.BasicDataSource /resource-env-ref-type /resource-env-ref I have this code: l.debug(Created the status xmlrpc class); Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(); this.setDataSource((BasicDataSource) envCtx.lookup(proteus)); I get this error: Name proteus is not bound in this Context - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Class not found when doing JNDI lookup
I have ifxjdbc.jar in WEB-INF/lib, which contains the Informix driver I'm looking for (I opened it and verified). I have the following in context.xml: Context path= !-- Default set of monitored resources -- WatchedResourceWEB-INF/web.xml/WatchedResource !-- Uncomment this to disable session persistence across Tomcat restarts -- !-- Manager pathname= / -- Resource name=jdbc/proteus auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=install password=install driverClassName=com.informix.jdbc.IfxDriver url=jdbc:informix-sqli://sigma:1960/proteus:INFORMIXSERVER=sigma;IFX_LOCK_M ODE_WAIT=-1;IFX_ISOLATION_LEVEL=1 /Resource /Context I get an error through the context lookup that I cannot load class com.informix.jdbc.IfxDriver. Here is the lookup: this.setDataSource((DataSource)new InitialContext().lookup(java:comp/env/jdbc/proteus)); Here's the web.xml entry: resource-env-ref description Connection pool for xmlrpc. /description resource-env-ref-name jdbc/proteus /resource-env-ref-name resource-env-ref-type javax.sql.DataSource /resource-env-ref-type /resource-env-ref Is JNDI somehow masking the classpath of WEB-INF/lib? I have verified that there are not multiple jars with this class in the webapp, and it is not in the common/lib for tomcat. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Class not found when doing JNDI lookup
Duh! That makes perfect sense. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Tuesday, November 03, 2009 10:38 AM To: Tomcat Users List Subject: RE: Class not found when doing JNDI lookup From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: Class not found when doing JNDI lookup I have ifxjdbc.jar in WEB-INF/lib, which contains the Informix driver I'm looking for (I opened it and verified). To quote from the doc: Before you proceed, don't forget to copy the JDBC Driver's jar into $CATALINA_HOME/lib. The jar must be in Tomcat's lib directory, not the webapp's WEB-INF/lib, if you want Tomcat to manage the connection pool. I have the following in context.xml: Context path= The path attribute is not allowed. Also, you appear to be modifying the global conf/context.xml, which is a really, really bad idea. The Resource element for the webapp should be in the webapp's Context element, located in the webapp's META-INF/context.xml file. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
302 Error with XMLRPC app
Here is my web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameSecurity Managment Consulting/display-name servlet servlet-nameXmlRpcServlet/servlet-name servlet-classorg.apache.xmlrpc.webserver.XmlRpcServlet/servlet-class /servlet servlet-mapping servlet-nameXmlRpcServlet/servlet-name url-pattern/xmlrpc-status/*/url-pattern /servlet-mapping /web-app I have the following java class: package com.secmgmt.xmlrpc.change_status; import org.apache.log4j.Logger; public class ChangeStatus { public static final int SUCCESS = 0; public static final int INVALID_LOGIN = 1; public static final int EID_NOT_FOUND = 2; public static final int SERVER_NOT_PRIMARY = 3; public static final int NO_CHANGE_NEEDED = 4; private static Logger l = Logger.getLogger(ChangeStatus.class); public static final String ACTIVE = ACTIVE; public static final String INACTIVE = INACTIVE; public static final int PP_ACTIVE = 0; public static final int PP_INACTIVE = 1; public ChangeStatus() { l.debug(Created the status xmlrpc class); } public boolean ping() { return true; } public int add(int one, int two) { l.debug(Adding + one + and + two); return one + two; } public int changeStatus(String eid, String user, String password, String status) { return SUCCESS; } } The following in the properties file: ChangeStatus=com.secmgmt.xmlrpc.picture.four.change_status.ChangeStatus My webapp deploys properly, and I never see an error in the logs anywhere when I hit it. My python program is: #!/usr/bin/python2 import xmlrpclib from pprint import pprint p = xmlrpclib.ServerProxy(http://192.168.1.15:8080/xmlrpc-status;) print Server created try: #print p.system.listMethods() #print dir(p) p._ServerProxy__verbose = 1 print Ping result: %s % (p.ChangeStatus.ping()) except xmlrpclib.Error, v: print ERROR, v pass print Done Here is the output: Server created connect: (192.168.1.15, 8080) send: 'POST /xmlrpc-status HTTP/1.0\r\nHost: 192.168.1.15:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: 111\r\n\r\n' send: ?xml version='1.0'?\nmethodCall\nmethodNameChangeStatus.ping/methodName\n params\n/params\n/methodCall\n reply: 'HTTP/1.1 302 Moved Temporarily\r\n' header: Server: Apache-Coyote/1.1 header: Location: http://192.168.1.15:8080/xmlrpc-status/ header: Date: Wed, 28 Oct 2009 19:47:50 GMT header: Connection: close ERROR ProtocolError for 192.168.1.15:8080/xmlrpc-status: 302 Moved Temporarily Done Any idea why I get the 302 error? My XML-RPC appears to be correct. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 302 Error with XMLRPC app
Thanks Chuck, tried that, here's my python output: Server created connect: (sirrus, 8080) send: 'POST /xmlrpc-status/ HTTP/1.0\r\nHost: sirrus:8080\r\nUser-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: 111\r\n\r\n' send: ?xml version='1.0'?\nmethodCall\nmethodNameChangeStatus.ping/methodName\n params\n/params\n/methodCall\n reply: 'HTTP/1.1 404 Not Found\r\n' header: Server: Apache-Coyote/1.1 header: Content-Type: text/html;charset=utf-8 header: Content-Length: 997 header: Date: Thu, 29 Oct 2009 16:32:18 GMT header: Connection: close ERROR ProtocolError for sirrus:8080/xmlrpc-status/: 404 Not Found Done -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, October 29, 2009 11:46 AM To: Tomcat Users List Subject: RE: 302 Error with XMLRPC app From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: 302 Error with XMLRPC app p = xmlrpclib.ServerProxy(http://192.168.1.15:8080/xmlrpc-status;) Any idea why I get the 302 error? My XML-RPC appears to be correct. As I recall, the 302 is required by the spec, since the target is not a static resource. Try changing your URL to http://192.168.1.15:8080/xmlrpc-status/; (note the trailing slash). - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 302 Error with XMLRPC app
Tomcat 5.5.27 Webapp is in /var/www/apache-tomcat-5.5.27/webapps/xmlrpc-status.war Deployed and running as 'root' on FC 5 Server.xml is attached. Thanks for the help, Chuck. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, October 29, 2009 12:42 PM To: Tomcat Users List Subject: RE: 302 Error with XMLRPC app From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: RE: 302 Error with XMLRPC app reply: 'HTTP/1.1 404 Not Found\r\n' Now we need more information about how you have Tomcat and your webapp set up. Tomcat version? How and where is the webapp deployed? You may want to post your server.xml and the file containing the Context element for the webapp (if any). If you're running on any reasonably recent version of Tomcat, your webapp will need to be deployed as ROOT (case sensitive) under the Host appBase directory, if you want the URL you're using to work. - 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 ?xml version=1.0 encoding=UTF-8? !-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- !-- A Server is a singleton element that represents the entire JVM, which may contain one or more Service instances. The Server listens for a shutdown command on the indicated port. Note: A Server is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- Server port=8005 shutdown=SHUTDOWN !-- Comment these entries out to disable JMX MBeans support used for the administration web application -- Listener className=org.apache.catalina.core.AprLifecycleListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / Listener className=org.apache.catalina.storeconfig.StoreConfigLifecycleListener/ !-- Global JNDI resources -- GlobalNamingResources !-- Test entry for demonstration purposes -- Environment name=simpleValue type=java.lang.Integer value=30/ !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources !-- A Service is a collection of one or more Connectors that share a single Container (and therefore the web applications visible within that Container). Normally, that Container is an Engine, but this is not required. Note: A Service is not itself a Container, so you may not define subcomponents such as Valves or Loggers at this level. -- !-- Define the Tomcat Stand-Alone Service -- Service name=Catalina !-- A Connector represents an endpoint by which requests are received and responses are returned. Each Connector passes requests on to the associated Container (normally an Engine) for processing. By default, a non-SSL HTTP/1.1 Connector is established on port 8080. You can also enable an SSL HTTP/1.1 Connector on port 8443 by following the instructions below and uncommenting the second Connector entry. SSL support requires the following steps (see the SSL Config HOWTO in the Tomcat 5 documentation bundle for more detailed instructions): * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or later, and put the JAR files into $JAVA_HOME/jre/lib/ext
RE: 302 Error with XMLRPC app
Worked like a champ! Thanks, I was struggling. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, October 29, 2009 1:12 PM To: Tomcat Users List Subject: RE: 302 Error with XMLRPC app From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: RE: 302 Error with XMLRPC app Webapp is in /var/www/apache-tomcat-5.5.27/webapps/xmlrpc-status.war Change the servlet mapping in your WEB-INF/web.xml to: servlet-mapping servlet-nameXmlRpcServlet/servlet-name url-pattern/*/url-pattern /servlet-mapping The URL path of the webapp must not be included in the url-pattern. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Getting arbitrary environment variables from webapp
Thanks! -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, September 30, 2009 3:47 PM To: Tomcat Users List Subject: RE: Getting arbitrary environment variables from webapp From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: Getting arbitrary environment variables from webapp Is there a way I can specify an environment variable via the startup.sh Create a setenv.sh script in Tomcat's bin directory and export whatever variables you need there. The startup.sh script calls setenv.sh automatically if it exists. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Getting arbitrary environment variables from webapp
Is there a way I can specify an environment variable via the startup.sh that I can then use System.getenv(MYWEBAPP_CONFIG_FILE); to get it from within my application? I need to store a file outside of the webroot to read configuration from, so that if a user changes this file, it will not get overwritten when an app is re-deployed. Thanks, Mike. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Configuring second tomcat instance on same box
http://www.urbandictionary.com/define.php?term=thread+hijacking -Original Message- From: Nagulapalli, Srinivas [mailto:srinivas.nagulapa...@starwoodvo.com] Sent: Thursday, September 17, 2009 11:30 AM To: Tomcat Users List Subject: RE: Configuring second tomcat instance on same box This is my first post after joining the list yesterday. Please clue me in as to what the error is. Best Srini -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Please don't hijack threads. Mark This electronic message transmission contains information from the Company that may be proprietary, confidential and/or privileged. The information is intended only for the use of the individual(s) or entity named above. If you are not the intended recipient, be aware that any disclosure, copying or distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by replying to the address listed in the From: field. - 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: 404 Error troubleshooting
Thanks for the help, all, I got it going. There was also an error in the Apache xmlrpc documentation that was giving me fits, too. -Original Message- From: Kris Schneider [mailto:kschnei...@gmail.com] Sent: Friday, September 11, 2009 1:09 PM To: Tomcat Users List Subject: Re: 404 Error troubleshooting On Fri, Sep 11, 2009 at 1:06 PM, Kris Schneider kschnei...@gmail.com wrote: On Fri, Sep 11, 2009 at 12:59 PM, Mike Baranski list-subscripti...@secmgmt.com wrote: Yes, restarted Tomcat (I also opened the war and opened the web.xml inside of it to make sure it was what I thought it was). No deploy errors, either. make sure you include the app's context (Path value in manager) in the request... -- Kris Schneider whoops, didn't notice that Charles had addressed this a couple minutes earlier... -- Kris Schneider - 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
404 Error troubleshooting
I have a webapp, which shows up in the manager, but gives a 404 error every time I try to access it. Can someone let me know how to turn on debugging and see what exactly is going on? It's an XMLRPC app (not that it makes a difference), and I have my web.xml servlet filter setup properly (according to the documentation). Thanks, Mike. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 404 Error troubleshooting
-Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Friday, September 11, 2009 11:49 AM To: Tomcat Users List Subject: RE: 404 Error troubleshooting From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: 404 Error troubleshooting I have a webapp, which shows up in the manager, but gives a 404 error every time I try to access it. When posting questions, provide some real information: 1) Tomcat version? 2) Any front end on Tomcat, or is it running standalone? 3) JRE/JDK version? 4) Platform you're running on? 5) The URL you're using? 6) Contents of WEB-INF/web.xml? 7) Contents of any Context element you have for the webapp? 8) Any errors recorded in the Tomcat logs? Can someone let me know how to turn on debugging and see what exactly is going on? The default Tomcat configuration logs all errors. Modify conf/logging.properties if you want more detail. However, start by enabling the AccessLogValve in conf/server.xml to see what requests Tomcat is actually getting. - Chuck Tomcat 5.5 Linux (FC 7) JDK 1.6 Standalone Web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameSecurity Managment Consulting/display-name servlet servlet-nameXmlRpcServlet/servlet-name servlet-classorg.apache.xmlrpc.webserver.XmlRpcServlet/servlet-class /servlet servlet-mapping servlet-nameXmlRpcServlet/servlet-name url-pattern/xmlrpc-status/url-pattern /servlet-mapping /web-app Access Log: 127.0.0.1 - - [11/Sep/2009:12:41:25 -0400] POST /xmlrpc-status/ HTTP/1.0 404 997 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 404 Error troubleshooting
127.0.0.1 - - [11/Sep/2009:12:50:19 -0400] POST /xmlrpc-status/ HTTP/1.0 404 997 ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameSecurity Managment Consulting/display-name servlet servlet-nameXmlRpcServlet/servlet-name servlet-classorg.apache.xmlrpc.webserver.XmlRpcServlet/servlet-class /servlet servlet-mapping servlet-nameXmlRpcServlet/servlet-name url-pattern/xmlrpc-status/*/url-pattern /servlet-mapping /web-app -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Friday, September 11, 2009 12:47 PM To: Tomcat Users List Subject: RE: 404 Error troubleshooting From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: RE: 404 Error troubleshooting url-pattern/xmlrpc-status/url-pattern Access Log: 127.0.0.1 - - [11/Sep/2009:12:41:25 -0400] POST /xmlrpc-status/ HTTP/1.0 Your url-pattern doesn't match the submitted URL; change the pattern value to /xmlrpc-status/* (without the quotes). - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: 404 Error troubleshooting
Yes, restarted Tomcat (I also opened the war and opened the web.xml inside of it to make sure it was what I thought it was). No deploy errors, either. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Friday, September 11, 2009 12:54 PM To: Tomcat Users List Subject: RE: 404 Error troubleshooting From: Mike Baranski [mailto:list-subscripti...@secmgmt.com] Subject: RE: 404 Error troubleshooting 127.0.0.1 - - [11/Sep/2009:12:50:19 -0400] POST /xmlrpc-status/ HTTP/1.0 404 997 Did you reload the webapp or restart Tomcat after making the change? Also, check the logs for deployment errors. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org