RE: WAR File loaded into embedded Tomcat not reachable
Hi, you did not tell us about how you load the war file. If the extension is correct (mynewwar.ZIP) I think it won't be loaded automatically. If it is named mynewwar.war and e.g. available in directory C:\mywebapps this should work: Context ctxt = embedded.createContext(/mynewwar , C:\mywebapps\mynewwar.war); ... host.addChild(ctxt); If this doesn't not work for you, you may have to do something like Loader loader = embedded.createLoader( classLoaderKnowingMynewwar ); ctxt.setLoader( loader ); before adding the context. Matthias -Original Message- From: Max Länzlinger [mailto:[EMAIL PROTECTED] Sent: Friday, April 27, 2007 8:16 PM To: users@tomcat.apache.org Subject: WAR File loaded into embedded Tomcat not reachable Hello, I want load a war-file programmaticly into the embedded tomcat-server. I made a Project (MyProject.ZIP) which starts the Server. Also a small web-application as war-file (mynewwar.zip). The server starts fine, and does so far not complain when loading the web-applikation war File into the standard context. The Problem ist afterwards, i cannot call the web-applikation. I Use embedded Tomcat 5.0.30. Sure the problem is little, any wrang/mising call to a method, and i would be very happy for help; if it runs i have a chance to embed Tomcat in our Sybase Database which supports Java, and we coud migrate all our xslt Applikations vom inside Sybase to the nice Tomcat resp. write nice JSF instead. THANKS A LOT FOR HELP Greetings MAx -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - 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: Context started twice
Can you post your dummyservlet Code ? Thanks Guru -Original Message- From: sc [mailto:[EMAIL PROTECTED] Sent: 29 April 2007 06:21 To: users@tomcat.apache.org Subject: Context started twice There was a thread on this http://www.nabble.com/Context-starts-twice-t1351694.html;. But my configuration is a bit different. this is my configuration: server.xml doesn't have context definition. context.xml is empty except this line WatchedResourceWEB-INF/web.xml/WatchedResource under $CATALINA_HOME/Catalina/localhost, I defined a context xml file, trip.xml ?xml version='1.0' encoding='utf-8'? Context docBase=d:/dev/trip/main/build path=/trip Resource name=jdbc/trip auth=Container .. /Context In my web.xml, I have the following entry, servlet servlet-namedummy/servlet-name servlet-classcom.trip.view.DummyServlet/servlet-class load-on-startup1/load-on-startup /servlet When DummyServlet starts, it init twice. Any help is appreciated. -- View this message in context: http://www.nabble.com/Context-started-twice-tf3664516.html#a10239122 Sent from the Tomcat - User mailing list archive at Nabble.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] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-XX:+HeapDumpOnOutOfMemoryError
I specified that parameter in JAVA_OPTS variable, but after the first java.lang.OutOfMemoryError: Java heap space error, no dump file was created. Where should that file be created by default? any clue? Thanks -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - 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: -XX:+HeapDumpOnOutOfMemoryError
In the working directory of the process. Of course you need enough free disk space. There is also -XX:HeapDumpPath=DIRECTORY_OR_FILE (Caution: I don't know, if all JVM versions that implement -XX:+HeapDumpOnOutOfMemoryError, implement this one too). You should check in the process table (if it's a unix like system) if your switches are picked up appropriately. Also you can check their function by wrinting a simple java app, that has an unterminated loop allocating objects and setting the heap size to a small value, which should prodice an OurOfmemoryError and a heap dump. Regards, Rainer [EMAIL PROTECTED] schrieb: I specified that parameter in JAVA_OPTS variable, but after the first java.lang.OutOfMemoryError: Java heap space error, no dump file was created. Where should that file be created by default? any clue? Thanks - 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: -XX:+HeapDumpOnOutOfMemoryError
In the working directory of the process. Of course you need enough free disk space. working directory means something like: /TomcatServer/work/Catalina/localhost/webapp_name/ ? because there is nothing there :( and there is enough free space. There is also -XX:HeapDumpPath=DIRECTORY_OR_FILE (Caution: I don't know, if all JVM versions that implement -XX:+HeapDumpOnOutOfMemoryError, implement this one too). You should check in the process table (if it's a unix like system) if your switches are picked up appropriately. /usr/local/jdk/bin/java -server -Xms512m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/jakarta/jakarta-tomcat-5.5.9/common/endorsed -classpath :/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/bootstrap.jar:/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/commons-logging-api.jar -Dcatalina.base=/usr/local/jakarta/jakarta-tomcat-5.5.9 -Dcatalina.home=/usr/local/jakarta/jakarta-tomcat-5.5.9 -Djava.io.tmpdir=/usr/local/jakarta/jakarta-tomcat-5.5.9/temp org.apache.catalina.startup.Bootstrap start is the process info. Any clue why it didn't get generated? Also you can check their function by wrinting a simple java app, that has an unterminated loop allocating objects and setting the heap size to a small value, which should prodice an OurOfmemoryError and a heap dump. Regards, Rainer [EMAIL PROTECTED] schrieb: I specified that parameter in JAVA_OPTS variable, but after the first java.lang.OutOfMemoryError: Java heap space error, no dump file was created. Where should that file be created by default? any clue? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - 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: -XX:+HeapDumpOnOutOfMemoryError
In the working directory of the process. Of course you need enough free disk space. working directory means something like: /TomcatServer/work/Catalina/localhost/webapp_name/ ? because there is nothing there :( and there is enough free space. There is also -XX:HeapDumpPath=DIRECTORY_OR_FILE (Caution: I don't know, if all JVM versions that implement -XX:+HeapDumpOnOutOfMemoryError, implement this one too). You should check in the process table (if it's a unix like system) if your switches are picked up appropriately. /usr/local/jdk/bin/java -server -Xms512m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/jakarta/jakarta-tomcat-5.5.9/common/endorsed -classpath :/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/bootstrap.jar:/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/commons-logging-api.jar -Dcatalina.base=/usr/local/jakarta/jakarta-tomcat-5.5.9 -Dcatalina.home=/usr/local/jakarta/jakarta-tomcat-5.5.9 -Djava.io.tmpdir=/usr/local/jakarta/jakarta-tomcat-5.5.9/temp org.apache.catalina.startup.Bootstrap start is the process info. Any clue why it didn't get generated? With that process line, is it normal that the Runtime().getRuntime().totalMemory() command gives me 43425792? Also you can check their function by wrinting a simple java app, that has an unterminated loop allocating objects and setting the heap size to a small value, which should prodice an OurOfmemoryError and a heap dump. Regards, Rainer [EMAIL PROTECTED] schrieb: I specified that parameter in JAVA_OPTS variable, but after the first java.lang.OutOfMemoryError: Java heap space error, no dump file was created. Where should that file be created by default? any clue? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
query on Embedded Tomcat
Hi all, I am trying to execute some servlets in the embedded tomcat. But some of the servlets which have a function getParameter(the function the the value of parameter from query string) are not getting executed properly while the same servelts when executed in standalone Tomacat are getting executed peoperly. Like i am using this statement in servlet: String str = request.getParameter(SPID); now in this str will have the value of SPID which will be given in query string. Whwn the servlet containing this statement is executed with stand alone Tomacat str will have the value as given in query starng. But if, same is run with embedded tomacat str returns null. Can anybody help in this case. Thanks in advance, Robin -- View this message in context: http://www.nabble.com/query-on-Embedded-Tomcat-tf3668723.html#a10250733 Sent from the Tomcat - User mailing list archive at Nabble.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]
Runtime.getRuntime().****Memory()
As i wrote in my previous messages i'm experiencing OutOfMemory heap problems. I added a Runtime.getRuntime().totalMemory() and Runtime.getRuntime().freeMemory() at the end of the main client thread that is created when a client connects to the webapp. I noticed that when i deply the webapp i got those values: Total Memory: 43425792. Free Memory left: 17827832 After about an hour the values drop to: Total Memory: 43425792. Free Memory left: 6898584 and keep getting lower. After 1 hour and half i got that: Total Memory: 43425792. Free Memory left: 439248 so i thought that this would go to OutOfMemory soon, but after some mins i got: Total Memory: 58986496. Free Memory left: 25538936 so i went to catalina.out logs and looked what happen: [Unloading class sun.reflect.GeneratedMethodAccessor44] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor10] [Unloading class sun.reflect.GeneratedMethodAccessor48] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor14] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor8] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor11] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor13] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor9] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor15] [Unloading class org.apache.jsp.admin_jsp] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor12] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor7] [Loaded com.mysql.jdbc.Messages from file:/usr/local/jakarta/jakarta-tomcat-5.5.9/common/lib/mysql-connector-java-5.0.5-bin.jar] [Loaded sun.reflect.GeneratedSerializationConstructorAccessor16 from __JVM_DefineClass__] [Loaded sun.reflect.GeneratedSerializationConstructorAccessor17 from __JVM_DefineClass__] Why total memory increased? it adjusted the heap memory to not go out of memory? from 43mb to 58mb there is 15mb of difference, why the free space raised to 25mb then? the garabge collection wasn't efficent? I started the server with java -server -Xms512m -Xmx1024m so the heap will be resized untill it reaches 1024mb? I'm using db connection pooling, is there a chance that it's getting a lot of resources? i followed the tutorials to create and close db connections for pooling reuse: if i used them wrong, shouldn't i get another error message? It's some weeks i'm trying to figure out what's the problem of those OutOfMemory heap errors, any help is appreciated. -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
One login only
Hi, I'm currently trying to configure Tomcat to only allow a user to log in once. If the same user tries to log in when already logged in (from another machine for example) I want to cancel the login request and present an explanation to the user. I'm using the FORM based authentication and have searched the web for a solution to this problem to no avail. Any help would be much appreciated, Jamie This email and any files attached are intended for the addressee and may contain information of a confidential nature. If you are not the intended recipient, be aware that this email was sent to you in error and you should not disclose, distribute, print, copy or make other use of this email or its attachments. Such actions, in fact, may be unlawful. In compliance with the various Regulations and Acts, General Dynamics United Kingdom Limited reserves the right to monitor (and examine for viruses) all emails and email attachments, both inbound and outbound. Email communications and their attachments may not be secure or error- or virus-free and the company does not accept liability or responsibility for such matters or the consequences thereof. General Dynamics United Kingdom Limited, Registered Office: 100 New Bridge Street, London EC4V 6JA. Registered in England and Wales No: 1911653.
Tomcat - problem when using SSL connector only
Problem: I have a Tomcat server with only one webapp. When deploying the server with only the SSL connector defined the webapp cannot be contacted with the browser (404 in both IE and firefox). Now: the 1st strange thing is that the webapp has no problems whatsoever when the non-ssl connector (8080) is deployed - I can connect at both 8080 and 8443 2nd strange this is that the tomcat library is one I copied from a testsite we have where this setup works without problems i.e. same server, same JDK, same webapp, same server.xml (pasted below) file.. everything... I've tried just about everything, hostnames, ports, ssl certificate.. everything. Please help if you know what is wrong here Ulrich server.xml: Server port=8006 shutdown=SHUTDOWN debug=0 !-- Global JNDI resources -- GlobalNamingResources !-- 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 !-- Define the Tomcat Stand-Alone Service -- Service name=Catalina !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 Connector port=8080 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / Note : To disable connection timeouts, set connectionTimeout value to 0 -- !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- !-- See explanation for cipher suites here: http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html -- Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=/keystore/ssl-servercertificate.keystore/ !-- Define the top level container in our container hierarchy -- Engine name=Catalina defaultHost=test debug=0 !-- Because this Realm is here, an instance will be shared globally -- !-- This Realm uses the UserDatabase configured in the global JNDI resources under the key UserDatabase. Any edits that are performed against this UserDatabase are immediately available for use by the Realm. -- Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ !-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. -- Host name=test debug=0 appBase=webapps unpackWARs=false autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliaslocalhost/Alias Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=webserver_access_log. suffix=.txt pattern=common resolveHosts=false/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=webserver_log. suffix=.txt timestamp=true/ /Host /Engine /Service /Server - 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: Context started twice
On 4/30/07, sc [EMAIL PROTECTED] wrote: As you suggested, I started from scratch. I downloaded tomcat 6 from apache.org. changed $catalina_home to point to the new directory. Under $catalina_home/webapps, I created a new folder, which only has one servlet TestServlet Do a global search on your projects and also on C: or Home drive to see if this line of code is defined in an additional Servlet that is visible to the current installation of Tomcat: log.info(TestServlet init); I know you mentioned that there's only one Servlet under webapps, but just in case... I also see super.init(config); but that shouldn't cause the TestServlet's init method to be called twice. public class TestServlet extends HttpServlet { private Log log = LogFactory.getLog(this.getClass().getName()); //public void init() throws ServletException public void init(ServletConfig config) throws ServletException { super.init(config); log.info(TestServlet init); } public void destroy() { log.info(TestServlet destroy); } } My web.xml as following: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; version=2.5 display-nameHello, World Application/display-name description This is a simple web application with a source code organization based on the recommendations of the Application Developer's Guide. /description servlet servlet-nametest/servlet-name servlet-classcom.trip.view.TestServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nametest/servlet-name url-pattern/test/url-pattern /servlet-mapping /web-app I didn't do any changes to the new installation of tomcat. Then I started tomcat and shutdown it. The log showed the following entries: 2007-04-30 12:35:27,968 [main] INFO com.cutetrip.view.TestServlet - TestServlet init 2007-04-30 12:35:27,968 [main] INFO com.cutetrip.view.TestServlet - TestServlet init 2007-04-30 12:35:40,046 [main] INFO com.cutetrip.view.TestServlet - TestServlet destroy 2007-04-30 12:35:40,046 [main] INFO com.cutetrip.view.TestServlet - TestServlet destroy Since I just downloaded Tomcat, it is likely the double init is caused by my application or local environment setting. Anywhere I should look at? I am very puzzled. Thanks. I will try to replicate this. Regards -Rashmi - 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: Context started twice
I tested your code, the init is called exactly once, when Tomcat starts. Try one of these: 1) Change log.info(TestServlet init); log.info(TestServlet destroy); to something else like log.info(TestServlet init ## ); log.info(TestServlet destroy ##); Re-compile, re-start TC if necessary and check if you see 2 different outputs on the console. 2) If you see the same output twice, that is if you see log.info(TestServlet init ## ); log.info(TestServlet init ## ); log.info(TestServlet destroy ##); log.info(TestServlet destroy ##); then check web.xml if the same Servlet is defined twice under different names. 3) Globally search for TestServlet init and see if it appears in more than one Servlet that may be visible to the current installation of Tomcat. -Regards Rashmi On 4/30/07, Rashmi Rubdi [EMAIL PROTECTED] wrote: On 4/30/07, sc [EMAIL PROTECTED] wrote: As you suggested, I started from scratch. I downloaded tomcat 6 from apache.org. changed $catalina_home to point to the new directory. Under $catalina_home/webapps, I created a new folder, which only has one servlet TestServlet Do a global search on your projects and also on C: or Home drive to see if this line of code is defined in an additional Servlet that is visible to the current installation of Tomcat: log.info(TestServlet init); I know you mentioned that there's only one Servlet under webapps, but just in case... I also see super.init(config); but that shouldn't cause the TestServlet's init method to be called twice. public class TestServlet extends HttpServlet { private Log log = LogFactory.getLog(this.getClass().getName()); //public void init() throws ServletException public void init(ServletConfig config) throws ServletException { super.init(config); log.info(TestServlet init); } public void destroy() { log.info(TestServlet destroy); } } My web.xml as following: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; version=2.5 display-nameHello, World Application/display-name description This is a simple web application with a source code organization based on the recommendations of the Application Developer's Guide. /description servlet servlet-nametest/servlet-name servlet-classcom.trip.view.TestServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nametest/servlet-name url-pattern/test/url-pattern /servlet-mapping /web-app I didn't do any changes to the new installation of tomcat. Then I started tomcat and shutdown it. The log showed the following entries: 2007-04-30 12:35:27,968 [main] INFO com.cutetrip.view.TestServlet - TestServlet init 2007-04-30 12:35:27,968 [main] INFO com.cutetrip.view.TestServlet - TestServlet init 2007-04-30 12:35:40,046 [main] INFO com.cutetrip.view.TestServlet - TestServlet destroy 2007-04-30 12:35:40,046 [main] INFO com.cutetrip.view.TestServlet - TestServlet destroy Since I just downloaded Tomcat, it is likely the double init is caused by my application or local environment setting. Anywhere I should look at? I am very puzzled. Thanks. I will try to replicate this. Regards -Rashmi - 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: Runtime.getRuntime().****Memory()
You will need to enable GC Stats for your JVM either on command line or set in JVM_OPTS env variable or handcode in %JAVA_HOME%/jre/lib/i386/jvm.cfg e.g. java -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails and then use a GCStatAnalyzer to look at ObjectAllocation and ObjectPromotion/younggenCollectionTime e.g. PrintGCStats -v ncpu=n [-v interval=seconds] [-v verbose=1] gc_log_file http://java.sun.com/developer/technicalArticles/Programming/turbo/index.html Does this help? Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: users users@tomcat.apache.org Sent: Monday, April 30, 2007 6:37 AM Subject: Runtime.getRuntime().Memory() As i wrote in my previous messages i'm experiencing OutOfMemory heap problems. I added a Runtime.getRuntime().totalMemory() and Runtime.getRuntime().freeMemory() at the end of the main client thread that is created when a client connects to the webapp. I noticed that when i deply the webapp i got those values: Total Memory: 43425792. Free Memory left: 17827832 After about an hour the values drop to: Total Memory: 43425792. Free Memory left: 6898584 and keep getting lower. After 1 hour and half i got that: Total Memory: 43425792. Free Memory left: 439248 so i thought that this would go to OutOfMemory soon, but after some mins i got: Total Memory: 58986496. Free Memory left: 25538936 so i went to catalina.out logs and looked what happen: [Unloading class sun.reflect.GeneratedMethodAccessor44] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor10] [Unloading class sun.reflect.GeneratedMethodAccessor48] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor14] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor8] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor11] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor13] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor9] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor15] [Unloading class org.apache.jsp.admin_jsp] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor12] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor7] [Loaded com.mysql.jdbc.Messages from file:/usr/local/jakarta/jakarta-tomcat-5.5.9/common/lib/mysql-connector-java-5.0.5-bin.jar] [Loaded sun.reflect.GeneratedSerializationConstructorAccessor16 from __JVM_DefineClass__] [Loaded sun.reflect.GeneratedSerializationConstructorAccessor17 from __JVM_DefineClass__] Why total memory increased? it adjusted the heap memory to not go out of memory? from 43mb to 58mb there is 15mb of difference, why the free space raised to 25mb then? the garabge collection wasn't efficent? I started the server with java -server -Xms512m -Xmx1024m so the heap will be resized untill it reaches 1024mb? I'm using db connection pooling, is there a chance that it's getting a lot of resources? i followed the tutorials to create and close db connections for pooling reuse: if i used them wrong, shouldn't i get another error message? It's some weeks i'm trying to figure out what's the problem of those OutOfMemory heap errors, any help is appreciated. -- Leggi GRATIS le tue mail con il telefonino i-modeT di Wind http://i-mode.wind.it/ - 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]
How to share static content across multiple tomcat webapps
Hi, This seems like an obvious question but I'd appreciate any answers. I have several webapps running under tomcat that need to be able to include the same sidebar in their .jps. if the sidebar is within the context, this works fine: %@ include file=sidebar.html % However this requires me to keep a copy of sidebar.html (and all the images) in each .war. I'd rather keep a single copy of sidebar.html. If I make a new context static in tomcat and place the sidebar + images there, I can access it fine in my browser with the url: http://localhost:8080/static/sidebar.html but the naive change to the jsp: %@ include file=../static/sidebar.html % fails with the path specifies a resource outside the web application. Using jstl and import: c:import url=../static/sidebar.html/ leads to: javax.servlet.jsp.JspTagException: /../static/sidebar.html However, if I use the absolute path: c:import url=http://localhost:8080/static/sidebar.html/ the page is fine, but because the paths to the images are copied directly from sidebar.html and included in the .jsp they are incorrect. It seems to me that what I'm trying to accomplish is a fairly common thing; I'd appreciate any pointers. Thanks, Martin -- Martin Jones Bioinformatics Team Centres for Cardiovascular Science and Inflammation Research, University of Edinburgh, Queen's Medical Research Institute, 47 Little France Crescent Edinburgh EH16 4TJ United Kingdom T: +44 131 242 6700 - 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: One login only
Greetings from across the Pond I thought this was rather an ingenious solution http://www.simongbrown.com/blog/2004/11/04/1099588633312.html Create a Principal object Authenticate Principal object to Tomcat Realm via 'Role' then use SSOValve to create Principal from supplied RequestHeaders Does this help? Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, April 30, 2007 6:47 AM Subject: One login only Hi, I'm currently trying to configure Tomcat to only allow a user to log in once. If the same user tries to log in when already logged in (from another machine for example) I want to cancel the login request and present an explanation to the user. I'm using the FORM based authentication and have searched the web for a solution to this problem to no avail. Any help would be much appreciated, Jamie This email and any files attached are intended for the addressee and may contain information of a confidential nature. If you are not the intended recipient, be aware that this email was sent to you in error and you should not disclose, distribute, print, copy or make other use of this email or its attachments. Such actions, in fact, may be unlawful. In compliance with the various Regulations and Acts, General Dynamics United Kingdom Limited reserves the right to monitor (and examine for viruses) all emails and email attachments, both inbound and outbound. Email communications and their attachments may not be secure or error- or virus-free and the company does not accept liability or responsibility for such matters or the consequences thereof. General Dynamics United Kingdom Limited, Registered Office: 100 New Bridge Street, London EC4V 6JA. Registered in England and Wales No: 1911653. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exception with Comet in Tomcat with high load
Hi all, I have been testing Tomcat comet support during the last days. I've created a test application that simulates data streaming to multiple clients. Clients open a connection to the server and the connection is hold open. In the server there are several sender threads that leverage comet support to periodically send stream updates to the subscribed clients. Once a client receives a specified amount of data the communication is closed. So, I'm running the test with tomcat svn version from 1 week ago. I have configured 150 tomcat threads, plus 25 acceptor threads. Tomcat runs in a Sun-Fire-V240 box with 2 CPU cores. I have 75 sender threads that periodically sleep (100ms) to try to reduce the CPU usage. Once a sender thread wakes up, it will send all the data to the assigned clients. So basically the story is that the box is able to manage about 3500 persistent comet connections smoothly. But when I raise the level to 4000 (80% CPU usage, 1.2G mem.) I start to get these exceptions for some (not all) connections: Exception in thread MessageSender[] java.lang.NullPointerException at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB( InternalNioOutputBuffer.java:607) at org.apache.coyote.http11.InternalNioOutputBuffer.commit( InternalNioOutputBuffer.java:600) at org.apache.coyote.http11.Http11NioProcessor.action( Http11NioProcessor.java:1032) at org.apache.coyote.Response.action(Response.java:181) at org.apache.coyote.http11.InternalNioOutputBuffer.doWrite( InternalNioOutputBuffer.java:571) at org.apache.coyote.Response.doWrite(Response.java:560) at org.apache.catalina.connector.OutputBuffer.realWriteBytes( OutputBuffer.java:353) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java :434) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349) at org.apache.catalina.connector.OutputBuffer.writeBytes( OutputBuffer.java:381) at org.apache.catalina.connector.OutputBuffer.write( OutputBuffer.java:370) at org.apache.catalina.connector.CoyoteOutputStream.write( CoyoteOutputStream.java:89) at org.apache.catalina.connector.CoyoteOutputStream.write( CoyoteOutputStream.java:83) at com.cognotec.streaming.CometRateSender.run(CometRateSender.java :86) at java.lang.Thread.run(Thread.java:595) So well, does anybody knows what can be the problem? Any suggestions? It can be also my problem, so I will be happy to provide more information. Cheers, Martin
session time out
Hello Does application WEB-INF/web.xml override default conf/web.xml setting? specifically session time out , but want to know if other setting is overriden. and can we disable this through server.xml ? Thanks Adam - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session timeout
Hi. I have my session-timeout set to 60 minutes in web.xml. The page in question is dynamically rendered based on what's currently in the session and the user adds items one at a time. So they fill out a form, submit it to a Struts Action which adds it to the Session object and then forwards back to that page where the new item is added to a list or an error message is given. Everything works fine except that the session will time-out and then they are forwarded to the session-timeout-login-again page. Since the data is written to the DB after they have added all items some people are losing their work if they happen to hit that 60 minutes. Does submitting a new Request not constitute a reset of the session-timeout? The page should not be cached since a new item is added or an error message is given after every form submit. Thanks in advance for any help / advice. All the best. - 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: How to share static content across multiple tomcat webapps
Hi Martin, On 4/30/07, Martin Jones [EMAIL PROTECTED] wrote: Hi, This seems like an obvious question but I'd appreciate any answers. I have several webapps running under tomcat that need to be able to include the same sidebar in their .jps. if the sidebar is within the context, this works fine: %@ include file=sidebar.html % However this requires me to keep a copy of sidebar.html (and all the images) in each .war. I'd rather keep a single copy of sidebar.html. If I make a new context static in tomcat and place the sidebar + images there, I can access it fine in my browser with the url: http://localhost:8080/static/sidebar.html but the naive change to the jsp: %@ include file=../static/sidebar.html % The include directive is out of the question because according to it's syntax http://java.sun.com/products/jsp/syntax/2.0/syntaxref209.html#1003408 it only accepts URLs that are relative to the web application (a.k.a Context). fails with the path specifies a resource outside the web application. Using jstl and import: c:import url=../static/sidebar.html/ JSTL's c:import tag has an attribute called context, http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/import.html which allows one to access resources from other contexts (a.k.a web applications) , however in order to function properly the crossContext attribute of the web application's Context node must be enabled (set to true). From my experience setting crossContext to true has caused other conflicts when 2 resources (Java Classes) have the same name in 2 different web applications that have crossContext enabled it could be that there was something wrong in my configuration. But, I'm just letting you know about it. leads to: javax.servlet.jsp.JspTagException: /../static/sidebar.html However, if I use the absolute path: c:import url=http://localhost:8080/static/sidebar.html/ the page is fine, but because the paths to the images are copied directly from sidebar.html and included in the .jsp they are incorrect. In this case you would also need to change the URLs of the images to be the absolute URL. It seems to me that what I'm trying to accomplish is a fairly common thing; I'd appreciate any pointers. Normally it is considered bad practice to hardcode the entire URL, you may want to store the domain etc in a constant and prefix it to the rest of the URL. Also, there might be better ways to accomplish this. I don't know much about JNDI but it comes to mind, is it possible to store images as a global JNDI resource. Thanks, Martin -Regards Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat as a windows service
We are upgrading from 5.0 to 5.5. Previously I was using windows env variables to set the java home and catalina home paths. In version 5.5 do I still need to use env variables or can I use the Tomcat service configuration Java options? Thanks Will Holmes Programmer Analyst Fremont Insurance Company Ph: 231-924-0302 Ext. 145 E-Mail: [EMAIL PROTECTED]
Re: session time out
On the Connector you can set connectionTimeout = 0 for indefinite timeout also a keepAliveTimeout on the Sender which I believe defaults to 60 sec http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html also a tcpSelectorTimeout on the Receiver which I believe defaults to 100 sec web.xml (webapp) specific session-config session-timeout30/session-timeout /session-config HTH M This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Tomcat [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, April 30, 2007 10:27 AM Subject: session time out Hello Does application WEB-INF/web.xml override default conf/web.xml setting? specifically session time out , but want to know if other setting is overriden. and can we disable this through server.xml ? Thanks Adam - 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: Runtime.getRuntime().****Memory()
On my box if i use the Xms20m and Xmx20m the Runtime.getRuntime().totalMemory() gives: Total Memory: 20840448. Free Memory left: 1618328 I see from remote box (where the webapp should work) log that the memory results, just after the application is started, gives: Total Memory: 15679488. Free Memory left: 4928976 15mb total and only 5 free. I notice that when free memory get low, total memory resize a bit, but today it thrown the first out of memory of heap when the situation was: Total Memory: 66650112. Free Memory left: 451216 It means it allocated only 66mb while according to the configuration it should allocate at least 256mb The question is easy: if i used xms, shouldn't the total memory be at least that value when the application is boot? You will need to enable GC Stats for your JVM either on command line or set in JVM_OPTS env variable or handcode in %JAVA_HOME%/jre/lib/i386/jvm.cfg e.g. java -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails and then use a GCStatAnalyzer to look at ObjectAllocation and ObjectPromotion/younggenCollectionTime e.g. PrintGCStats -v ncpu=n [-v interval=seconds] [-v verbose=1] gc_log_file http://java.sun.com/developer/technicalArticles/Programming/turbo/index.html Does this help? Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: users users@tomcat.apache.org Sent: Monday, April 30, 2007 6:37 AM Subject: Runtime.getRuntime().Memory() As i wrote in my previous messages i'm experiencing OutOfMemory heap problems. I added a Runtime.getRuntime().totalMemory() and Runtime.getRuntime().freeMemory() at the end of the main client thread that is created when a client connects to the webapp. I noticed that when i deply the webapp i got those values: Total Memory: 43425792. Free Memory left: 17827832 After about an hour the values drop to: Total Memory: 43425792. Free Memory left: 6898584 and keep getting lower. After 1 hour and half i got that: Total Memory: 43425792. Free Memory left: 439248 so i thought that this would go to OutOfMemory soon, but after some mins i got: Total Memory: 58986496. Free Memory left: 25538936 so i went to catalina.out logs and looked what happen: [Unloading class sun.reflect.GeneratedMethodAccessor44] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor10] [Unloading class sun.reflect.GeneratedMethodAccessor48] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor14] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor8] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor11] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor13] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor9] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor15] [Unloading class org.apache.jsp.admin_jsp] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor12] [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor7] [Loaded com.mysql.jdbc.Messages from file:/usr/local/jakarta/jakarta-tomcat-5.5.9/common/lib/mysql-connector-java-5.0.5-bin.jar] [Loaded sun.reflect.GeneratedSerializationConstructorAccessor16 from __JVM_DefineClass__] [Loaded sun.reflect.GeneratedSerializationConstructorAccessor17 from __JVM_DefineClass__] Why total memory increased? it adjusted the heap memory to not go out of memory? from 43mb to 58mb there is 15mb of difference, why the free space raised to 25mb then? the garabge collection wasn't efficent? I started the server with java -server -Xms512m -Xmx1024m so the heap will be resized untill it reaches 1024mb? I'm using db connection pooling, is there a chance that it's getting a lot of resources? i followed the tutorials to create and close db connections for pooling reuse: if i used them wrong, shouldn't i get another error message? It's some weeks i'm trying to figure out what's the problem of those OutOfMemory heap errors, any help is appreciated. -- Leggi GRATIS le tue mail con il telefonino i-modeT di Wind http://i-mode.wind.it/ - 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: session time out
On 4/30/07, Tomcat [EMAIL PROTECTED] wrote: Hello Does application WEB-INF/web.xml override default conf/web.xml setting? specifically session time out , but want to know if other setting is overriden. Specifically the session time out in /WEB-INF/web.xml overrides /conf/web.xml Don't know about other parameters, but they can be easily tested. The Servlet 2.4 specification shows all web.xml nodes on page 136. and can we disable this through server.xml ? So far there doesn't seem to be a setting in server.xml to disable this, so I guess not. Thanks Adam -Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
PLZ Help with java.net.SocketException: Connection reset
Hello. I have this error over and over again, but I have no clue about its meaning or where to start? Can anyone help me? After the error is my web.xml. I am using Tomcat 5.5.16. Thanks very much, Regards, Lorenzo ERROR - 2007-04-30 00:16:26,395 [http-198.64.153.30-80-Processor34] WARN org.apache.catalina.core.ContainerBase.[Catalina].[registro.nacion.com] - Exception Processing ErrorPage[errorCode=404, location=/paginanoexiste.jsp] ClientAbortException: java.net.SocketException: Connection reset at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:311) at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293) at org.apache.catalina.connector.Response.flushBuffer(Response.java:537) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:286) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:746) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:348) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:769) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:125) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:579) at org.apache.coyote.Response.doWrite(Response.java:559) at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361) ... 16 more WEB.XML --- ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; !-- ** -- !-- Standard Action Servlet Configuration (with debugging) -- servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param load-on-startup1/load-on-startup /servlet !-- ** -- !-- Standard Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping !-- ** -- !-- Session and access -- servlet-mapping servlet-nameNewServlet/servlet-name url-pattern/NewServlet/url-pattern /servlet-mapping servlet-mapping servlet-nametestCookies/servlet-name url-pattern/testCookies/url-pattern /servlet-mapping !-- ** -- !-- Manejo de errores en la ejecución -- servlet servlet-nameExceptionHandlerServlet/servlet-name servlet-classcom.nacion.excepciones.ExceptionHandlerServlet/servlet-class /servlet servlet-mapping servlet-nameExceptionHandlerServlet/servlet-name url-pattern/ExceptionHandlerServlet/url-pattern
Re: session time out
Hello Martin, my main question was : Does application WEB-INF/web.xml override default conf/web.xml setting? I mean in a container containing several applications, can each of them set session time out in their /WEB-INF/web.xml and is that over ride the default setting which is set in /conf/web.xml Cheers Adam Martin Gainty wrote: On the Connector you can set connectionTimeout = 0 for indefinite timeout also a keepAliveTimeout on the Sender which I believe defaults to 60 sec http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html also a tcpSelectorTimeout on the Receiver which I believe defaults to 100 sec web.xml (webapp) specific session-config session-timeout30/session-timeout /session-config HTH M This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Tomcat [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, April 30, 2007 10:27 AM Subject: session time out Hello Does application WEB-INF/web.xml override default conf/web.xml setting? specifically session time out , but want to know if other setting is overriden. and can we disable this through server.xml ? Thanks Adam - 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] - 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: PLZ Help with java.net.SocketException: Connection reset
This generally means that the client aborted the connection before the server completed its response. Most of the time that means a user clicking Stop as a page loads, but I have seen it other times due to resource loading issues. For example, Dojo, at least through 0.3.1, was notorious for causing these because of its dependency loading mechanism, and I never did figure out why. I've seen it at other times with other libraries, and my own client-side code, as well. In any case, they are generally not something you need to be overly concerned with. Certainly it's true that they consume resources, if for no other reason than the JVM needing to deal with the exception, but it's rare that you can do anything to stop these, and if anyone knows differently I for one would be extremely interested to hear about it :) I've never heard of it being a performance issue or anything like that (except I guess filling up a log file if its happening *that* much). Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Mon, April 30, 2007 11:46 am, Lorenzo Jiménez wrote: Hello. I have this error over and over again, but I have no clue about its meaning or where to start? Can anyone help me? After the error is my web.xml. I am using Tomcat 5.5.16. Thanks very much, Regards, Lorenzo ERROR - 2007-04-30 00:16:26,395 [http-198.64.153.30-80-Processor34] WARN org.apache.catalina.core.ContainerBase.[Catalina].[registro.nacion.com] - Exception Processing ErrorPage[errorCode=404, location=/paginanoexiste.jsp] ClientAbortException: java.net.SocketException: Connection reset at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:366) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433) at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:311) at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:293) at org.apache.catalina.connector.Response.flushBuffer(Response.java:537) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:286) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:746) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:433) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:348) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:769) at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:125) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:579) at org.apache.coyote.Response.doWrite(Response.java:559) at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:361) ... 16 more WEB.XML --- ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; !-- ** -- !-- Standard Action Servlet Configuration (with debugging) -- servlet servlet-nameaction/servlet-name
Re: Class is not a servlet
Ok, thank you all very much. I'm still too newbie to make my servlet work (some problems with xindice) but I've changed my java code and now it's really a servlet! Grazie ancora, bye - Original Message - From: Pid [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, April 28, 2007 11:33 AM Subject: Re: Class is not a servlet Seriously, David's recommendation is the way forwards. When he said, 'read the spec', he was indicating that you should at least have a basic familiarity with what a Servlet is. There are *extensive* and complete tutorials from basic to advanced to found for free online. Search Google (other search engines are available). Clue: Servlets are not written like a bean Class, you do not use the main(...) method. rgds Pid Luca Sabbio wrote: Thank you very much for the two answers. I don't know Java servlet enough to make PartsXupdate work but now I have a way to follow. I highly recommend reading the servlet spec. There you will see a servlet extends HttpServlet and overrides one or more of it's methods. http://jcp.org/en/jsr/detail?id=154 --David Now that I've changed the class file, and re-do the deployment, Tomcat first show me HTTP Status 405 - HTTP method POST is not supported by this URL than I modify PartsXupdate.java as below and only work the out.println import org.xmldb.api.base.*; import org.xmldb.api.modules.*; import org.xmldb.api.*; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class PartsXupdate extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(Commento Inserito); } public static void main(String[] args) throws Exception { Collection col = null; try { String driver = org.apache.xindice.client.xmldb.DatabaseImpl; Class c = Class.forName(driver); Database database = (Database) c.newInstance(); DatabaseManager.registerDatabase(database); col = DatabaseManager.getCollection(xmldb:xindice://localhost:8080/db/test); String xupd = xupdate:modifications version=\1.0\ xmlns:xupdate=\http://www.xmldb.org/xupdate\; + xupdate:insert-after select=\/scheda/info\ + xupdate:element name=\commento\Bel libro!/xupdate:element + /xupdate:insert-after + /xupdate:modifications; String nome = 4.xml; /* We are using XUpdateQueryService */ XUpdateQueryService service = (XUpdateQueryService) col.getService(XUpdateQueryService, 1.0); service.updateResource(nome, xupd); } catch (XMLDBException e) { System.err.println(XML:DB Exception occurred + e.errorCode); } finally { if (col != null) { col.close();} } } } From: Luca Sabbio [mailto:[EMAIL PROTECTED] public class PartsXupdate extends HttpServlet { ... - Peter - 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] - 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: Exception with Comet in Tomcat with high load
Hi, I had the same problems. It was a synchronization issue with me. What I did was make a synchronized output stream wrapper (see attached file) which wraps all access to the output stream, and I synchronized on this output stream whenever I called event.close() on the Comet event (especially in the READ event). When doing serveral IO operations on the output stream which should not be interrupted, you can simply synchronize on it (since SynchronizedOutputStream locks on itself). Regards, Sebastiaan Martin Perez wrote: Hi all, I have been testing Tomcat comet support during the last days. I've created a test application that simulates data streaming to multiple clients. Clients open a connection to the server and the connection is hold open. In the server there are several sender threads that leverage comet support to periodically send stream updates to the subscribed clients. Once a client receives a specified amount of data the communication is closed. So, I'm running the test with tomcat svn version from 1 week ago. I have configured 150 tomcat threads, plus 25 acceptor threads. Tomcat runs in a Sun-Fire-V240 box with 2 CPU cores. I have 75 sender threads that periodically sleep (100ms) to try to reduce the CPU usage. Once a sender thread wakes up, it will send all the data to the assigned clients. So basically the story is that the box is able to manage about 3500 persistent comet connections smoothly. But when I raise the level to 4000 (80% CPU usage, 1.2G mem.) I start to get these exceptions for some (not all) connections: Exception in thread MessageSender[] java.lang.NullPointerException at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB( InternalNioOutputBuffer.java:607) at org.apache.coyote.http11.InternalNioOutputBuffer.commit( InternalNioOutputBuffer.java:600) at org.apache.coyote.http11.Http11NioProcessor.action( Http11NioProcessor.java:1032) at org.apache.coyote.Response.action(Response.java:181) at org.apache.coyote.http11.InternalNioOutputBuffer.doWrite( InternalNioOutputBuffer.java:571) at org.apache.coyote.Response.doWrite(Response.java:560) at org.apache.catalina.connector.OutputBuffer.realWriteBytes( OutputBuffer.java:353) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java :434) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349) at org.apache.catalina.connector.OutputBuffer.writeBytes( OutputBuffer.java:381) at org.apache.catalina.connector.OutputBuffer.write( OutputBuffer.java:370) at org.apache.catalina.connector.CoyoteOutputStream.write( CoyoteOutputStream.java:89) at org.apache.catalina.connector.CoyoteOutputStream.write( CoyoteOutputStream.java:83) at com.cognotec.streaming.CometRateSender.run(CometRateSender.java :86) at java.lang.Thread.run(Thread.java:595) So well, does anybody knows what can be the problem? Any suggestions? It can be also my problem, so I will be happy to provide more information. Cheers, Martin package com.sebster.tunnel.util.io; import java.io.IOException; import java.io.OutputStream; /** * This output stream simply wraps another output stream and synchronizes access * to the underlying output stream. The synchronization is done on the instance * of this class. * * @author sebster */ public class SynchronizedOutputStream extends OutputStream { private final OutputStream out; public SynchronizedOutputStream(final OutputStream out) { if (out == null) { throw new NullPointerException(out); //$NON-NLS-1$ } this.out = out; } public synchronized void write(final byte[] b) throws IOException { out.write(b); } public synchronized void write(final byte[] b, final int off, final int len) throws IOException { out.write(b, off, len); } public synchronized void write(final int b) throws IOException { out.write(b); } public synchronized void flush() throws IOException { out.flush(); } public synchronized void close() throws IOException { out.close(); } } - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Server redirected too many times (20)
Hi, I can't understand why Tomcat gives me this error message when I try to reload my app: Server redirected too many times (20) Is my app getting too big ( 400 files) ? It seems to happen more and more often. Usually a server restart fixes it. Sometimes I have to restart my machine. At the moment, I have to reload, I get the error message, I stop and start Tomcat, and then I can see whatever changes I have made. It's a bit tedious though. And oddly, once my app is running, no problems. Any suggestions? Thanks, John Tomcat 6.10 windows 2000 Java 1.6 - 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: Server redirected too many times (20)
Hi John, On 4/30/07, John Pedersen [EMAIL PROTECTED] wrote: Hi, I can't understand why Tomcat gives me this error message when I try to reload my app: Server redirected too many times (20) Is my app getting too big ( 400 files) ? The conversation on this http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4458085 bug should help. It seems to happen more and more often. Usually a server restart fixes it. Sometimes I have to restart my machine. At the moment, I have to reload, I get the error message, I stop and start Tomcat, and then I can see whatever changes I have made. It's a bit tedious though. And oddly, once my app is running, no problems. Any suggestions? There might be an infinite redirect in your application that is raising this error. Can you find the location of this error, the full stack trace in the log files may offer some clues. Thanks, John Tomcat 6.10 windows 2000 Java 1.6 -Regards Rashmi - 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: Server redirected too many times (20)
Hi John in your init() method System.setProperty( http.maxRedirects, Integer.toString( DEFAULT_MAX_REDIRECTS ) ); //whereas DEFAULT_MAX_REDIRECTS defaults to 20 M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: John Pedersen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, April 30, 2007 12:53 PM Subject: Server redirected too many times (20) Hi, I can't understand why Tomcat gives me this error message when I try to reload my app: Server redirected too many times (20) Is my app getting too big ( 400 files) ? It seems to happen more and more often. Usually a server restart fixes it. Sometimes I have to restart my machine. At the moment, I have to reload, I get the error message, I stop and start Tomcat, and then I can see whatever changes I have made. It's a bit tedious though. And oddly, once my app is running, no problems. Any suggestions? Thanks, John Tomcat 6.10 windows 2000 Java 1.6 - 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]
Configuring mod_jk with Apache on Linux.
Hi, I am trying to configure mod_jk with Apache on Linux machine ( Redhat Linux 4.0) . The Apache version is 2.0.52. The mod_jk I have picked up is mod_jk-1.2.21-apache-2.2.x-linux-i686.so. When I try to start the httpd I get the Error message that the mod_jk.so is garbled. Could someone let me know what may be wrong ?? Here are the details: [EMAIL PROTECTED] logs]# service httpd start Starting httpd: Syntax error on line 195 of /etc/httpd/conf/httpd.conf: API module structure `jk_module' in file /etc/httpd/modules/mod_jk- 1.2.21-apache -2.2.x-linux-i686.so is garbled - perhaps this is not an Apache module DSO? [FAILED] Thank you Shaline.
RE: run two versions of tomcat as windows services at the same time
Charles, I wanted to thank you for your help as your tips helped me find the right solution. I was trying to use the .exe instead of the zip and with the zip I was able to correctly change the environment variables. Thanks for your time. Bryan Rood IT Manager Quantros Inc. [EMAIL PROTECTED] www.quantros.com (408) 957 - 3300 ext. 230 -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 26, 2007 8:04 PM To: Tomcat Users List Subject: RE: run two versions of tomcat as windows services at the same time From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: run two versions of tomcat as windows services at the same time how to install and run tomcat 5.0.27 and 5.5.23 as windows services at the same time on single machine? We already discussed something very like this earlier today. Take a look at this: http://marc.info/?l=tomcat-userm=117762730021810w=2 - 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: Tomcat as a windows service
Will, I run Tomcat as a window's service. My understanding is that when you run Tomcat as a window's service, setting an env var in the Tomcat service options that also exists as part of windows will supersede the windows var. As long as you have it set somewhere before the service needs the var it doesn't matter where it is set. If you are using multiple java homes, then it becomes important where it set, otherwise I don't think it matters, Bryan Rood IT Manager Quantros Inc. [EMAIL PROTECTED] www.quantros.com (408) 957 - 3300 ext. 230 -Original Message- From: Will Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 7:57 AM To: users@tomcat.apache.org Subject: Tomcat as a windows service We are upgrading from 5.0 to 5.5. Previously I was using windows env variables to set the java home and catalina home paths. In version 5.5 do I still need to use env variables or can I use the Tomcat service configuration Java options? Thanks Will Holmes Programmer Analyst Fremont Insurance Company Ph: 231-924-0302 Ext. 145 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]
How to set keep alive on the TCP socket?
We (and some of our customers) have firewalls that disconnect inactive connections, so all requests that take more than some time to complete get silently disconnected and never return. I think soKeepAlive is supposed to fix that problem, but I do not see how to configure it. The only references I could find are for cluster configuration. - Alexey. -- Alexey N. Solofnenko http://trelony.cjb.net/ Pleasant Hill, CA (GMT-8 usually) smime.p7s Description: S/MIME Cryptographic Signature
.hprof and jhat
I got a .hprof file with the -XX:+HeapDumpOnOutOfMemoryError option. I opened it with jhat but understand how to find the bottleneck is quite difficult. Is there any guide or anybody that could help me finding the problem please? -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - 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: Tomcat as a windows service
Microsoft (more specifically the Windows registry) has god rights so any information entered into Windows registry is considered system wide Of course you can overwrite the SAME ENVIRONMENT VARIABLE locally (e.g. %CATALINA_HOME%) in your cmd.exe command shell by SET CATALINA_HOME=new_var HTH M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Bryan Rood [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, April 30, 2007 2:35 PM Subject: RE: Tomcat as a windows service Will, I run Tomcat as a window's service. My understanding is that when you run Tomcat as a window's service, setting an env var in the Tomcat service options that also exists as part of windows will supersede the windows var. As long as you have it set somewhere before the service needs the var it doesn't matter where it is set. If you are using multiple java homes, then it becomes important where it set, otherwise I don't think it matters, Bryan Rood IT Manager Quantros Inc. [EMAIL PROTECTED] www.quantros.com (408) 957 - 3300 ext. 230 -Original Message- From: Will Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 7:57 AM To: users@tomcat.apache.org Subject: Tomcat as a windows service We are upgrading from 5.0 to 5.5. Previously I was using windows env variables to set the java home and catalina home paths. In version 5.5 do I still need to use env variables or can I use the Tomcat service configuration Java options? Thanks Will Holmes Programmer Analyst Fremont Insurance Company Ph: 231-924-0302 Ext. 145 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] - 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: Session timeout
If the user is clicking a submit button on the form, then the browser is sending a request to the server, and that should reset the timer for the session timeout. I haven't used Struts so I don't know if that changes the session handling somehow. With my own webapp, the session stays active as long as I send requests periodically. Maybe you should do some logging to figure out what's happening. You can use Tomcat's AccessLogValve to verify that requests are coming in within the timeout interval, and your own code could log some session info like getCreationTime, getLastAccessedTime. -- Len On 4/30/07, Rashmi Rubdi [EMAIL PROTECTED] wrote: On 4/30/07, Chris Edwards [EMAIL PROTECTED] wrote: Hi. I have my session-timeout set to 60 minutes in web.xml. The page in question is dynamically rendered based on what's currently in the session and the user adds items one at a time. So they fill out a form, submit it to a Struts Action which adds it to the Session object and then forwards back to that page where the new item is added to a list or an error message is given. Everything works fine except that the session will time-out and then they are forwarded to the session-timeout-login-again page. Since the data is written to the DB after they have added all items some people are losing their work if they happen to hit that 60 minutes. In the above case it is the ~same~ request within same browser instance, the session times-out after an inactive interval. So if they add things to the cart but the browser stays idle for more than 60 minutes, then the session times out. However if you implement http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html , it sends a notification when the Session is about to be invalidated ( JavaEE 5) , on receiving the notification you can choose to either commit or rollback the transaction or save it temporarily. Does submitting a new Request not constitute a reset of the session-timeout? new Request -- yes (if HTTP Redirect is used, it is a new Request) same Request -- no (if HTTP Forward is used, it is the same Request) Most likely you are navigating from one page to the next with Http Forward, which maintains the ~same~ Http Request throughout the navigation. The page should not be cached since a new item is added or an error message is given after every form submit. Thanks in advance for any help / advice. All the best. ~~~ When Http Redirect is used a new session is created and it resets the session timeout interval Session ID : F98B9FA599811B0A206C73316B970EB0 Session was created at : Mon Apr 30 12:52:03 EDT 2007 Perform Http Redirect Session ID : 4779909EE1A36F003E381D6C913B31E5 Session was created at : Mon Apr 30 12:52:08 EDT 2007 Notice a new session is created above, thus resets the timeout interval. ^^ When Http Forward is used the same request and thus the same session exists throughout, so the session timeout interval of the session created by this request remains the same. Session ID : 55FD6EF762C1AFC549F2EBBFB7CC5208 Session was created at : Mon Apr 30 12:54:09 EDT 2007 Perform Http Forward Session ID : 55FD6EF762C1AFC549F2EBBFB7CC5208 Session was created at : Mon Apr 30 12:54:09 EDT 2007 ^^ -Regards Rashmi - 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: Access logging, multiple web applications, single virtual host
Can anyone tell me is the below possible? Thanks, Monica [EMAIL PROTECTED] ats.com To 04/27/2007 02:36 users@tomcat.apache.org PM cc Subject Please respond to Access logging, multiple web Tomcat Users applications, single virtual host List [EMAIL PROTECTED] che.org | | | Hello everyone, | | | I am attempting to create access logs on a per web application basis, | using a single virtual host in my server.xml file. Here is what I have so| far: | | | Host name=www.example.com autoDeploy=false | deployOnStartup=false deployXML=false alias | www.example.com/alias Valve | className=org.apache.catalina.valves.AccessLogValve | prefix=example_access suffix=.log pattern=common | directory=${jboss.server.home.dir}/log/ Context path= | docBase=html debug=0 reloadable=true/ DefaultContext | cookies=true crossContext=true override=true/ Context | path=/Web1 docBase=C:\jboss-4.0.1RC2\server\default\deploy debug=0 | reloadable=true Valve | className=org.apache.catalina.valves.AccessLogValve | directory=${jboss.server.home.dir}/log prefix=example_web1 | suffix=.log resolveHosts=false pattern=combined/ | | | /Context Context path=/images appBase= | docBase=C:\jboss-4.0.1RC2\server\default\images debug=99 | /Context Context path=/Web2 docBase=C:\jboss-4.0.1 | RC2\server\default\deploy debug=0 reloadable=true | Valve className=org.apache.catalina.valves.AccessLogValve | directory=${jboss.server.home.dir}/log prefix=example_web2 | suffix=.log resolveHosts=false pattern=combined/ | | /Context /Host | | | Everything appears to be working as it should, the logs are all being | created. The problem is that when I hit www.example.com/Web1 or | www.example.com/Web2 the only log that gets updated is | example_access.log. | | | Can someone please explain to me how to go about writing to the | example_web1.log and example_web2.log files for those applications? | | | Thanks, | Monica | | --| *** This communication may be confidential and privileged and the views expressed herein may be personal and are not necessarily the views of Coats plc. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any distribution, copying or use of this communication or the information in it is strictly prohibited. If you have received this communication in error, please notify us by email ([EMAIL PROTECTED]) or telephone our technical support helpdesk at Coats plc. +44 (0)20 8210 5100 (UK 0830H - 1800H, Mon-Fri, GMT) and then delete the email and any copies of it. *** - 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: Session timeout
How do I limit the amount of messages I receive? I'd like to be able to turn on and off the reception of messages of the mailing list without having to unsubscribe. Unfortunately the mailing list FAQ email is empty. Thanks a lot :)
Re: .hprof and jhat
i knew how to start jhat, i don't know how to analyze the data i see. I found this site helpful http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html JHat -JOption NameOfHeapDumpFileToRead M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: users users@tomcat.apache.org Sent: Monday, April 30, 2007 2:42 PM Subject: .hprof and jhat I got a .hprof file with the -XX:+HeapDumpOnOutOfMemoryError option. I opened it with jhat but understand how to find the bottleneck is quite difficult. Is there any guide or anybody that could help me finding the problem please? -- Leggi GRATIS le tue mail con il telefonino i-modeT di Wind http://i-mode.wind.it/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Leggi GRATIS le tue mail con il telefonino i-mode di Wind http://i-mode.wind.it/ - 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: How to set keep alive on the TCP socket?
Thank you. But it looks like in 5.5 the parameter is only in the protocol: apache-tomcat-5.5.20-src/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java: public void setKeepAlive(boolean keepAlive) { apache-tomcat-5.5.20-src/connectors/http11/src/java/org/apache/coyote/http11/Http11BaseProtocol.java: public void setKeepAlive(boolean keepAlive) { apache-tomcat-5.5.20-src/connectors/jk/java/org/apache/ajp/tomcat4/Ajp13Connector.java: * socket.setKeepAlive(true); How to specify this parameter? Should I use connectionKeepAlive to use it similar to linger? - Alexey. Martin Gainty wrote: good info-- Also take a look at http://eip.gp.gov.tw/tomcat-docs/catalina/docs/api/org/apache/coyote/tomcat5/CoyoteConnector.html#setConnectionLinger(int) also setKeepAlive() method for CoyoteConnector M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Alexey N. Solofnenko [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, April 30, 2007 2:37 PM Subject: How to set keep alive on the TCP socket? We (and some of our customers) have firewalls that disconnect inactive connections, so all requests that take more than some time to complete get silently disconnected and never return. I think soKeepAlive is supposed to fix that problem, but I do not see how to configure it. The only references I could find are for cluster configuration. - Alexey. -- Alexey N. Solofnenko http://trelony.cjb.net/ Pleasant Hill, CA (GMT-8 usually) - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alexey N. Solofnenko http://trelony.cjb.net/ Pleasant Hill, CA (GMT-8 usually) smime.p7s Description: S/MIME Cryptographic Signature
Re: Session timeout
On 4/30/07, orn amental [EMAIL PROTECTED] wrote: How do I limit the amount of messages I receive? Please create a new thread instead of hijacking this one I'd like to be able to turn on and off the reception of messages of the mailing list without having to unsubscribe. Unfortunately the mailing list FAQ email is empty. Thanks a lot :) - 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: Access logging, multiple web applications, single virtual host
Hi Monica, We are unable to see your message, instead we see a set of pipes | It could be that your e-mail client is using Rich Text , please change it to Plain Text and try again. -Regards Rashmi On 4/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: | | | Hello everyone, | | | I am attempting to create access logs on a per web application basis, | using a single virtual host in my server.xml file. Here is what I have so| far: | | | Host name=www.example.com autoDeploy=false | deployOnStartup=false deployXML=false - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jni not working with Tomcat 5.5
Hello all, I am new to using Tomcat. I have installed (on Windows XP) Apache 2.2 and Tomcat 5.5. I am using the mod_jk connector. I have the following Tomcat-related configuration in my httpd.conf: # Load mod_jk module LoadModulejk_module modules/mod_jk.so # Declare the module for IfModule directive (remove this line on Apache 2.0.x) # AddModule mod_jk.c # Where to find workers.properties JkWorkersFile conf/workers.properties # Where to put jk shared memory JkShmFile logs/mod_jk.shm # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevelinfo # Select the timestamp log format JkLogStampFormat [%a %b %d %H:%M:%S %Y] # Send servlet for context /examples to worker named worker1 JkMount /examples/servlet/* worker1 # Send JSPs for context /examples to worker named worker1 JkMount /examples/*.jsp worker1 And I have the following inside my workers.properties file: worker.list=worker1 worker.worker1.type=jni worker.worker1.host=localhost worker.worker1.port=8009 If I set the type to ajp13, everything works fine. But with jni, I get the following error message in logs/mod_jk.log: [error] jk_worker.c (137): Unknown worker type jni for worker worker1 I googled it and couldn't find anything useful. Could anyone help me on that? I *really* need it to be run in-process. Thank you in advance, -- César L. B. Silveira http://cesarbs.wordpress.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]
Access logging, multiple web applications, single virtual host
Hello everyone, I am attempting to create access logs on a per web application basis, using a single virtual host in my server.xml file. Here is what I have so far: Host name=www.example.com autoDeploy=false deployOnStartup=false deployXML=false aliaswww.example.com/alias Valve className=org.apache.catalina.valves.AccessLogValve prefix=example_access suffix=.log pattern=common directory=${jboss.server.home.dir}/log/ Context path= docBase=html debug=0 reloadable=true/ DefaultContext cookies=true crossContext=true override=true/ Context path=/Web1 docBase=C:\jboss-4.0.1RC2\server\default\deploy debug=0 reloadable=true Valve className=org.apache.catalina.valves.AccessLogValve directory=${jboss.server.home.dir}/log prefix=example_web1 suffix=.log resolveHosts=false pattern=combined/ /Context Context path=/images appBase= docBase=C:\jboss-4.0.1 RC2\server\default\images debug=99 /Context Context path=/Web2 docBase=C:\jboss-4.0.1 RC2\server\default\deploy debug=0 reloadable=true Valve className=org.apache.catalina.valves.AccessLogValve directory=${jboss.server.home.dir}/log prefix=example_web2 suffix=.log resolveHosts=false pattern=combined/ /Context /Host Everything appears to be working as it should, the logs are all being created. The problem is that when I hit www.example.com/Web1 or www.example.com/Web2 the only log that gets updated is example_access.log. Can someone please explain to me how to go about writing to the example_web1.log and example_web2.log files for those applications? Thanks, Monica *** This communication may be confidential and privileged and the views expressed herein may be personal and are not necessarily the views of Coats plc. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any distribution, copying or use of this communication or the information in it is strictly prohibited. If you have received this communication in error, please notify us by email ([EMAIL PROTECTED]) or telephone our technical support helpdesk at Coats plc. +44 (0)20 8210 5100 (UK 0830H - 1800H, Mon-Fri, GMT) and then delete the email and any copies of it. *** - 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: Access logging, multiple web applications, single virtual host
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Subject: Access logging, multiple web applications, single virtual host Everything appears to be working as it should, the logs are all being created. The problem is that when I hit www.example.com/Web1 or www.example.com/Web2 the only log that gets updated is example_access.log. Can someone please explain to me how to go about writing to the example_web1.log and example_web2.log files for those applications? What level of Tomcat is this? (Or is it Tomcat at all, since a rather old version of JBoss seems to be involved?) If it's a current Tomcat, look here: http://tomcat.apache.org/tomcat-5.5-doc/logging.html - 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: Access logging, multiple web applications, single virtual host
differing ValveClasses for same Host works Same ValveClass for differing Hosts I dont know if you can use the same AccessValve for same Host Anyone else? M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, April 30, 2007 3:49 PM Subject: Access logging, multiple web applications, single virtual host Hello everyone, I am attempting to create access logs on a per web application basis, using a single virtual host in my server.xml file. Here is what I have so far: Host name=www.example.com autoDeploy=false deployOnStartup=false deployXML=false aliaswww.example.com/alias Valve className=org.apache.catalina.valves.AccessLogValve prefix=example_access suffix=.log pattern=common directory=${jboss.server.home.dir}/log/ Context path= docBase=html debug=0 reloadable=true/ DefaultContext cookies=true crossContext=true override=true/ Context path=/Web1 docBase=C:\jboss-4.0.1RC2\server\default\deploy debug=0 reloadable=true Valve className=org.apache.catalina.valves.AccessLogValve directory=${jboss.server.home.dir}/log prefix=example_web1 suffix=.log resolveHosts=false pattern=combined/ /Context Context path=/images appBase= docBase=C:\jboss-4.0.1 RC2\server\default\images debug=99 /Context Context path=/Web2 docBase=C:\jboss-4.0.1 RC2\server\default\deploy debug=0 reloadable=true Valve className=org.apache.catalina.valves.AccessLogValve directory=${jboss.server.home.dir}/log prefix=example_web2 suffix=.log resolveHosts=false pattern=combined/ /Context /Host Everything appears to be working as it should, the logs are all being created. The problem is that when I hit www.example.com/Web1 or www.example.com/Web2 the only log that gets updated is example_access.log. Can someone please explain to me how to go about writing to the example_web1.log and example_web2.log files for those applications? Thanks, Monica *** This communication may be confidential and privileged and the views expressed herein may be personal and are not necessarily the views of Coats plc. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s), please note that any distribution, copying or use of this communication or the information in it is strictly prohibited. If you have received this communication in error, please notify us by email ([EMAIL PROTECTED]) or telephone our technical support helpdesk at Coats plc. +44 (0)20 8210 5100 (UK 0830H - 1800H, Mon-Fri, GMT) and then delete the email and any copies of it. *** - 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: -XX:+HeapDumpOnOutOfMemoryError
working directory is the bin directory Filip [EMAIL PROTECTED] wrote: In the working directory of the process. Of course you need enough free disk space. working directory means something like: /TomcatServer/work/Catalina/localhost/webapp_name/ ? because there is nothing there :( and there is enough free space. There is also -XX:HeapDumpPath=DIRECTORY_OR_FILE (Caution: I don't know, if all JVM versions that implement -XX:+HeapDumpOnOutOfMemoryError, implement this one too). You should check in the process table (if it's a unix like system) if your switches are picked up appropriately. /usr/local/jdk/bin/java -server -Xms512m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/jakarta/jakarta-tomcat-5.5.9/common/endorsed -classpath :/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/bootstrap.jar:/usr/local/jakarta/jakarta-tomcat-5.5.9/bin/commons-logging-api.jar -Dcatalina.base=/usr/local/jakarta/jakarta-tomcat-5.5.9 -Dcatalina.home=/usr/local/jakarta/jakarta-tomcat-5.5.9 -Djava.io.tmpdir=/usr/local/jakarta/jakarta-tomcat-5.5.9/temp org.apache.catalina.startup.Bootstrap start is the process info. Any clue why it didn't get generated? Also you can check their function by wrinting a simple java app, that has an unterminated loop allocating objects and setting the heap size to a small value, which should prodice an OurOfmemoryError and a heap dump. Regards, Rainer [EMAIL PROTECTED] schrieb: I specified that parameter in JAVA_OPTS variable, but after the first java.lang.OutOfMemoryError: Java heap space error, no dump file was created. Where should that file be created by default? any clue? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind http://i-mode.wind.it/ - 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]
Redirecting URL request to Tomcat to folder containing Cruise Control
I have Cruise Control setup to run my machine and am able to access it through Tomcat using... http://localhost:8080/cruisecontrol/ I would like to be able to access this same URL using the format... http://localhost:8080/standard/ Is this possible under Tomcat? And if so how might I go about doing something like this? Any help is greatly appreciated. Robert Segal Tools Developer CryptoLogic Inc. 55 St. Clair Ave W., 3rd Floor Toronto, Ontario Canada M4V 2Y7 tel. + 1.416.545.1455 x5896 fax. + 1.416.545.1454 This message, including any attachments, is confidential and/or privileged and contains information intended only for the person(s) named above. Any other distribution, copying or disclosure is strictly prohibited. If you are not the intended recipient or have received this message in error, please notify us immediately by reply email and permanently delete the original transmission from all of your systems and hard drives, including any attachments, without making a copy.
Encrypting passwords in the connection pool setup
I'm using Tomcat 5.5 to run a web application. I have the connection pools set up and working in the context.xml but the password is in plain text. Does anyone know of a way to encrypt the password and username to the database?
Re: session time out
Martin, Martin Gainty wrote: On the Connector you can set connectionTimeout = 0 for indefinite timeout also a keepAliveTimeout on the Sender which I believe defaults to 60 sec http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html Once again, irrelevant and incorrect. The OP is asking about the session timeout, and you are telling him about request connection timeouts which are in no way related. To answer your question, Adam, the web.xml supplied with your application should be able to override any of the defaults set in TOMCAT_HOME/conf/web.xml, including your session timeout. I don't believe there is a way to disable the ability to override any particular configuration parameter using something like server.xml. -chris signature.asc Description: OpenPGP digital signature
Re: Tomcat as a windows service
No, you do not need to set those variables. I'm running 5.5, and I don't set them. I use the Tomcat configuration utility to specify the location of the JRE and Tomcat. -- Len On 4/30/07, Will Holmes [EMAIL PROTECTED] wrote: We are upgrading from 5.0 to 5.5. Previously I was using windows env variables to set the java home and catalina home paths. In version 5.5 do I still need to use env variables or can I use the Tomcat service configuration Java options? Thanks Will Holmes Programmer Analyst Fremont Insurance Company Ph: 231-924-0302 Ext. 145 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: Configuring mod_jk with Apache on Linux.
Shaline, shaline omprakash wrote: The Apache version is 2.0.52. The mod_jk I have picked up is mod_jk-1.2.21-apache-2.2.x-linux-i686.so. You have mismatched versions. Your Apache version is 2.0.x and your mod_jk is for Apache 2.2.x. You need to pick up a mod_jk version that has ...apache-2.0.x-... in its filename. Better yet, download the source and compile it yourself. It's easy and you always get a version that is 100% compatible with your install. -chris signature.asc Description: OpenPGP digital signature
Re: Session timeout
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Len, Len Popp wrote: I haven't used Struts so I don't know if that changes the session handling somehow. FYI: Struts doesn't tough session management, so it should act normally. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGNml79CaO5/Lv0PARAgUsAKCirPgnt1Hs6K5gh1sUSc9bv9nOYQCfZSB0 biyC0Ic7LzIXwmAzv3AzWp8= =DwdQ -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: Encrypting passwords in the connection pool setup
Kelly J Flowers wrote: I'm using Tomcat 5.5 to run a web application. I have the connection pools set up and working in the context.xml but the password is in plain text. Does anyone know of a way to encrypt the password and username to the database? This is nearly always pointless. A couple of points to consider: 1. If the password is encrypted, where do you store the decryption key? 2. If an attacker can read the context.xml file they probably have shell access to your box. In this case you have bigger problems. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
setup
I just installed tomat 5.5 on my Fedora http://www.fedoraproject.org/ 5 box it is up and running . I would like to know how to add a user for the admin page ? and aloso I would like to know where the webapps/ROOT/index.jsp is ?
Re: setup
Hi William, On 4/30/07, William Biggs [EMAIL PROTECTED] wrote: I just installed tomat 5.5 on my Fedora http://www.fedoraproject.org/ 5 box it is up and running . I would like to know how to add a user for the admin page ? Under Tomcat's folder /conf/tomcat-users.xml is where the users are defined. The file already contains entries that show examples of syntax. and aloso I would like to know where the webapps/ROOT/index.jsp is ? By default, it is under Tomcat's webapps/ROOT/ folder , in my instance of Tomcat 5.5.x Other possible location would be defined in the docBase of ROOT.xml file , which may be located at Tomcat's conf/Catalina/[Host]/ROOT.xml -Regards Rashmi - 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: Context started twice
All my mistake. I apologize for my stupidity. It turns out it wasn't invoked twice. It just prints twice. I had the following in log4j.properties. log4j.rootLogger=ERROR, TRIP log4j.logger.org.hibernate=WARN, TRIP log4j.logger.net.sf.hibernate=INFO, TRIP log4j.logger.com.cutetrip=DEBUG, TRIP I commented out log4j.rootLogger and it prints only one init now. Thanks for your help. This is my first time using nabble.com and surprised to see how prompt I can get response. Thanks again. Rashmi Rubdi-2 wrote: I tested your code, the init is called exactly once, when Tomcat starts. Try one of these: 1) Change log.info(TestServlet init); log.info(TestServlet destroy); to something else like log.info(TestServlet init ## ); log.info(TestServlet destroy ##); Re-compile, re-start TC if necessary and check if you see 2 different outputs on the console. 2) If you see the same output twice, that is if you see log.info(TestServlet init ## ); log.info(TestServlet init ## ); log.info(TestServlet destroy ##); log.info(TestServlet destroy ##); then check web.xml if the same Servlet is defined twice under different names. 3) Globally search for TestServlet init and see if it appears in more than one Servlet that may be visible to the current installation of Tomcat. -Regards Rashmi On 4/30/07, Rashmi Rubdi [EMAIL PROTECTED] wrote: On 4/30/07, sc [EMAIL PROTECTED] wrote: As you suggested, I started from scratch. I downloaded tomcat 6 from apache.org. changed $catalina_home to point to the new directory. Under $catalina_home/webapps, I created a new folder, which only has one servlet TestServlet Do a global search on your projects and also on C: or Home drive to see if this line of code is defined in an additional Servlet that is visible to the current installation of Tomcat: log.info(TestServlet init); I know you mentioned that there's only one Servlet under webapps, but just in case... I also see super.init(config); but that shouldn't cause the TestServlet's init method to be called twice. public class TestServlet extends HttpServlet { private Log log = LogFactory.getLog(this.getClass().getName()); //public void init() throws ServletException public void init(ServletConfig config) throws ServletException { super.init(config); log.info(TestServlet init); } public void destroy() { log.info(TestServlet destroy); } } My web.xml as following: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; version=2.5 display-nameHello, World Application/display-name description This is a simple web application with a source code organization based on the recommendations of the Application Developer's Guide. /description servlet servlet-nametest/servlet-name servlet-classcom.trip.view.TestServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nametest/servlet-name url-pattern/test/url-pattern /servlet-mapping /web-app I didn't do any changes to the new installation of tomcat. Then I started tomcat and shutdown it. The log showed the following entries: 2007-04-30 12:35:27,968 [main] INFO com.cutetrip.view.TestServlet - TestServlet init 2007-04-30 12:35:27,968 [main] INFO com.cutetrip.view.TestServlet - TestServlet init 2007-04-30 12:35:40,046 [main] INFO com.cutetrip.view.TestServlet - TestServlet destroy 2007-04-30 12:35:40,046 [main] INFO com.cutetrip.view.TestServlet - TestServlet destroy Since I just downloaded Tomcat, it is likely the double init is caused by my application or local environment setting. Anywhere I should look at? I am very puzzled. Thanks. I will try to replicate this. Regards -Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Context-started-twice-tf3664516.html#a10264243 Sent from the Tomcat - User mailing list archive at Nabble.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]
RE: setup
From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Subject: Re: setup and aloso I would like to know where the webapps/ROOT/index.jsp is ? By default, it is under Tomcat's webapps/ROOT/ folder , in my instance of Tomcat 5.5.x Well, not really. The source to index.jsp is there, but the .jsp is precompiled and the resulting class (what's really executed to generate the default Tomcat home page) is in webapps/ROOT/WEB-INF/lib/catalina-root.jar. If you actually want to use index.jsp, you must get rid of the jar and remove the servlet mapping in webapps/ROOT/WEB-INF/web.xml. Note that in 6.0, index.jsp (and the jar) is replaced by an index.html file. Other possible location would be defined in the docBase of ROOT.xml file , which may be located at Tomcat's conf/Catalina/[Host]/ROOT.xml There is no conf/Catalina/[host]/ROOT.xml in a standard Tomcat download. - 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: Context started twice
On 4/30/07, sc [EMAIL PROTECTED] wrote: All my mistake. I apologize for my stupidity. It turns out it wasn't invoked twice. It just prints twice. I had the following in log4j.properties. log4j.rootLogger=ERROR, TRIP log4j.logger.org.hibernate=WARN, TRIP log4j.logger.net.sf.hibernate=INFO, TRIP log4j.logger.com.cutetrip=DEBUG, TRIP I would never have guessed that :-) , thanks for sharing your solution. I commented out log4j.rootLogger and it prints only one init now. Thanks for your help. This is my first time using nabble.com and surprised to see how prompt I can get response. Thanks again. -Cheers Rashmi - 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: Context started twice
From: sc [mailto:[EMAIL PROTECTED] Subject: Re: Context started twice This is my first time using nabble.com and surprised to see how prompt I can get response. Nabble has nothing to do with it - it's merely a web-based GUI for several mailing lists, including Tomcat-user. My personal preference for a searchable Tomcat mailing list is: http://marc.info/?l=tomcat-user - 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: setup
Hi Chuck, On 5/1/07, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Rashmi Rubdi [mailto:[EMAIL PROTECTED] Subject: Re: setup and aloso I would like to know where the webapps/ROOT/index.jsp is ? By default, it is under Tomcat's webapps/ROOT/ folder , in my instance of Tomcat 5.5.x Well, not really. The source to index.jsp is there, but the .jsp is precompiled and the resulting class (what's really executed to generate the default Tomcat home page) is in webapps/ROOT/WEB-INF/lib/catalina-root.jar. If you actually want to use index.jsp, you must get rid of the jar and remove the servlet mapping in webapps/ROOT/WEB-INF/web.xml. You are right. I just looked at what appeared on the surface. You've made a very good observation. Note that in 6.0, index.jsp (and the jar) is replaced by an index.html file. Other possible location would be defined in the docBase of ROOT.xml file , which may be located at Tomcat's conf/Catalina/[Host]/ROOT.xml There is no conf/Catalina/[host]/ROOT.xml in a standard Tomcat download. - Chuck -Regards Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]