Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
Hi All, I followed the instruction below http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support to config Tomcat7's *APR Connectors *SSL, but get error: Error initializing endpoint java.lang.Exception: Unable to load certificate key conf/key1cert.pem (error:02001003:system library:fopen:No such process) and the steps as follow, step 1: D:\OpenSSL-Win32\binopenssl genrsa -des3 -out key1.pem 2048 enter pwd: test, to get a file : key1.pem step 2: req -new -x509 -key key1.pem -out key1cert.pem -days 1095 to get another file : key1cert.pem step 3: put these two files to apache-tomcat-7.0.4\conf step 4: update server.xml as follow: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources 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 !--SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol-- Service name=Catalina Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLSv1 SSLEnabled=true SSLEngine=on SSLCertificateFile=conf/key1.pem SSLCertificateKeyFile=conf/key1cert.pem SSLPassword=test / Connector port=8009 enableLookups=false redirectPort=443 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.LockOutRealm Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Realm Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=localhost_access_log. suffix=.txt pattern=%h %l %u %t quot;%rquot; %s %b resolveHosts=false/ /Host /Engine /Service /Server step 5: start tomcat, and result: 2010-11-24 16:21:13 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key conf/key1cert.pem (error:02001003:system library:fopen:No such process) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 16:21:13 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key conf/key1cert.pem (error:02001003:system library:fopen:No such process) at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
Re: clearThreadLocalMap and NullPointerException
On 24/11/2010 01:28, Blair Zajac wrote: On Nov 23, 2010, at 4:49 PM, Blair Zajac wrote: On Nov 23, 2010, at 2:24 AM, Mark Thomas wrote: Do let us know what the problem was when you find it. Does JNA provide its own clean up methods that I could run at shutdown? I haven't looked yet to see. I found the cause, it's an issue with JNA, they should be providing a real iterator() implementation, not one that just returns null. Not that they expected anyone to call toString() on it. http://article.gmane.org/gmane.comp.java.jna.user/4347 I guess it's up to you if you want to handle a case like this. I could see other projects not bothering to provide real implementations of things if they don't expect anything to go looking into their internals. Thanks for getting back with details of the problem. I agree with you that there are likely to be other libraries doing similar things. I think the general handling now in place is the right way to go. Hopefully, the issues it highlights in third party libraries they will get reported and fixed. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Server affinity instead of session affinity
On 23/11/2010 23:34, André Warnier wrote: Andrew Hole wrote: I'm reading about domain directive in worker properties. I can setup different workers to be in the same domain (p.e. a machine) and have domain affinity. Do you have some idea how it really works? No, but it kind of sounds like what you want to achieve, doesn't it ? You could try it, and see how it goes. It sounds like you would need to add one directive to each worker, like worker.tomcatA.domain=machine1 worker.tomcatB.domain=machine1 worker.tomcatC.domain=machine2 worker.tomcatD.domain=machine2 and it would then balance between machine1 and machine2, instead of between the workers themselves. But it also sounds like tomcatA and tomcatB would have to be configured as a cluster, and have some provision to share and replicate sessions between them. That may be more work than you're aiming for. (I'm not sure, just guessing). That isn't going to help keep sessions for app1 and sessions for app2 on the same machine since httpd/IIS treats each application independently. What it will do is require you to have clustering using the delta manager (all sessions replicated to all nodes) working across all of the nodes on a machine. That adds a lot of overhead for little benefit and requires all applications are installed on every node. Again, you'll need to look at an alternative LB approach. I've already mentioned the client IP based approach. The other approach is adding your own cookie (with path =/ so it applies to all apps) that you use to make the LB sticky to a machine. You'll need to do a little config in httpd.conf but it is quite simple. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: the memory puzzle me....
On 24/11/2010 05:47, Caldarale, Charles R wrote: From: xu cheng [mailto:xcheng@gmail.com] Subject: Re: the memory puzzle me by the way, do you know *any tool that can monitor the permanent generation*, such what's now resident in the perm gen? I presume you mean on Windows, since you already found one for Linux. I suspect the more sophisticated profilers like YourKit will do it, but I'm not sure. Others on the list use YourKit regularly, so they might be able to be more definitive when they wake up in an hour or two. Yep. It shows used, current and max for each memory pool. It doesn't explicitly break down objects by pool but if you work on the basis all the class objects are in permgen then you have all you need (list of class objects and their size). Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Unable to find WEB INF
On 24/11/2010 06:56, Sandip Hirwale wrote: Hello i am new to tomcat i deployed my application by copy it into webapps folder in tomcat now i have to make some change in index file but unable to find that directory with application name where is it located ??? thanks You'll need to provide more information than that if you want the folks here to help you. Try reading this http://www.catb.org/~esr/faqs/smart-questions.html and then re-phrase your question. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
On 24/11/2010 08:22, Scott Li wrote: SSLCertificateFile=conf/key1.pem SSLCertificateKeyFile=conf/key1cert.pem You have these the wrong way around. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
Hi Scott, My working HTTPS connector using APR settings as below: Connector port=8443 protocol=org.apache.coyote.http11.Http11AprProtocol SSLEnabled=true maxThreads=150 scheme=https secure=true SSLCertificateFile=C:\usr\tomcat\tomcat.crt SSLCertificateKeyFile=C:\usr\tomcat\tomcat.key SSLPassword=123456 / Try to remove SSLEngine attribute and add protocol attribute, then re-start Tomcat. 2010/11/24 Scott Li scott...@gwghk.com Hi All, I followed the instruction below http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support to config Tomcat7's *APR Connectors *SSL, but get error: Error initializing endpoint java.lang.Exception: Unable to load certificate key conf/key1cert.pem (error:02001003:system library:fopen:No such process) and the steps as follow, step 1: D:\OpenSSL-Win32\binopenssl genrsa -des3 -out key1.pem 2048 enter pwd: test, to get a file : key1.pem step 2: req -new -x509 -key key1.pem -out key1cert.pem -days 1095 to get another file : key1cert.pem step 3: put these two files to apache-tomcat-7.0.4\conf step 4: update server.xml as follow: ?xml version='1.0' encoding='utf-8'? Server port=8005 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources 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 !--SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol-- Service name=Catalina Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLSv1 SSLEnabled=true SSLEngine=on SSLCertificateFile=conf/key1.pem SSLCertificateKeyFile=conf/key1cert.pem SSLPassword=test / Connector port=8009 enableLookups=false redirectPort=443 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.LockOutRealm Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Realm Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=localhost_access_log. suffix=.txt pattern=%h %l %u %t quot;%rquot; %s %b resolveHosts=false/ /Host /Engine /Service /Server step 5: start tomcat, and result: 2010-11-24 16:21:13 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key conf/key1cert.pem (error:02001003:system library:fopen:No such process) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 16:21:13 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key conf/key1cert.pem (error:02001003:system library:fopen:No such process) at org.apache.catalina.connector.Connector.initInternal(Connector.java:875)
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
thanks Mark Thomas and Goo Sam Kong I followed Goo Sam Kong 's config still have errors: Loaded APR based Apache Tomcat Native library 1.1.20. 2010-11-24 17:38:43 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2010-11-24 17:38:43 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 17:38:43 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) update config as follow, Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol SSLCertificateFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1.pem SSLCertificateKeyFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem SSLPassword=test / Connector port=8009 enableLookups=false redirectPort=443 protocol=AJP/1.3 / I find my SSLCertificateFile is *.pem, and Goo Sam Kong's crt, key, how do you create these files, not use OpenSSL? 在 2010年11月24日 下午5:10,Goo Sam Kong skgo...@gmail.com写道: Hi Scott, My working HTTPS connector using APR settings as below: Connector port=8443 protocol=org.apache.coyote.http11.Http11AprProtocol SSLEnabled=true maxThreads=150 scheme=https secure=true SSLCertificateFile=C:\usr\tomcat\tomcat.crt SSLCertificateKeyFile=C:\usr\tomcat\tomcat.key SSLPassword=123456 / Try to remove SSLEngine attribute and add protocol attribute, then re-start Tomcat. -- Thanks Regards, Scott Li
Re: create[8005]: java.net.BindException: error occured while starting tomcat on Ubuntu Plateform
I have exatly same error in my tomcat, and I am getting it in every 10 minutes, I added localhost entry in the hosts file, but still the issue is happening, please help me Following is the crash... INFO: Creating MBeanServer Nov 17, 2010 1:10:05 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8800 Starting service Tomcat-Standalone Apache Tomcat/4.1.27-LE-jdk14 HTTP Message Charset: utf-8 SNMP Encoding: ISO8859_1 Starting DashBoard ! Local time zone US/Mountain Loading Managed Object Base... Nov 17, 2010 1:10:22 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Nov 17, 2010 1:10:22 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Nov 17, 2010 1:10:23 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Nov 17, 2010 1:10:24 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8800 Nov 17, 2010 1:10:24 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8802 Nov 17, 2010 1:10:24 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=2/303 config=/opt/bmc/PATROL_DashBoard/tomcat/conf/jk2.properties StandardServer.await: create[8801]: java.net.BindException: Cannot assign requested address java.net.BindException: Cannot assign requested address at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.init(ServerSocket.java:185) at org.apache.catalina.core.StandardServer.await(StandardServer.java:510) at org.apache.catalina.startup.Catalina.start(Catalina.java:521) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) Stopping service Tomcat-Standalone DashBoard is about to shutdown. Waiting for current actions to end... Waiting for client servlets to end... Saving unsaved information on disk ... java.lang.NullPointerException at perform.janet.servlets.admin.GenericAdminServlet.stopActivities(GenericAdminServlet.java:665) at perform.janet.servlets.admin.DashboardContextListener.run(DashboardContextListener.java:115) at java.lang.Thread.run(Thread.java:619) PATROL DashBoard is still running. CompilerOracle: unrecognized line exclude oracle/sql/NUMBER _isPositive Unrecognized text after command: CompilerOracle: unrecognized line exclude com/inprise/vbroker/IIOP/ProtocolConnection receive_reply Unrecognized text after command: CompilerOracle: unrecognized line exclude oracle/xml/parser/v2/Step matchPattern Unrecognized text after command: CompilerOracle: unrecognized line exclude perform/dm/core/topology/resolution/validation/SwitchesJoining getCommonEntry Unrecognized text after command: CompilerOracle: unrecognized line exclude perform/dm/core/topology/resolution/validation/ValidationCriterium sortForwardings Unrecognized text after command: CompilerOracle: unrecognized line exclude perform/util/log/FileQueryHandler prepareFilter Unrecognized text after command: Nov 17, 2010 1:20:05 PM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Nov 17, 2010 1:20:05 PM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Nov 17, 2010 1:20:06 PM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Nov 17, 2010 1:20:07 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8800 Starting service Tomcat-Standalone Apache Tomcat/4.1.27-LE-jdk14 HTTP Message Charset: utf-8 SNMP Encoding: ISO8859_1 Starting DashBoard ! Local time zone US/Mountain Loading Managed Object Base... Nov 17, 2010 1:20:21 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Nov 17, 2010 1:20:21 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Nov 17, 2010 1:20:22 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Nov 17, 2010 1:20:23 PM
Re: create[8005]: java.net.BindException: error occured while starting tomcat on Ubuntu Plateform
Hi. In the logs below, I see references to JK2. That seems to be a reference to the mod_jk2 connector, which to my knowledge is old, not developed or maintained anymore. If that's the case, then you should change your configuration to use mod_jk1.x, of which the current version is downloadable at http://tomcat.apache.org/ (see Connectors). Also, it seems that you are using Tomcat 4.1. That is pretty much the same thing. You should be using a more recent version, that one is probably 10 years old or so. What I am saying is that you will not get much help with these versions. Most people here are too young to even remember them. See : http://tomcat.apache.org/whichversion.html ikhan wrote: I have exatly same error in my tomcat, and I am getting it in every 10 minutes, I added localhost entry in the hosts file, but still the issue is happening, please help me Following is the crash... INFO: Creating MBeanServer Nov 17, 2010 1:10:05 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8800 Starting service Tomcat-Standalone Apache Tomcat/4.1.27-LE-jdk14 HTTP Message Charset: utf-8 SNMP Encoding: ISO8859_1 Starting DashBoard ! Local time zone US/Mountain Loading Managed Object Base... Nov 17, 2010 1:10:22 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Nov 17, 2010 1:10:22 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Nov 17, 2010 1:10:23 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Nov 17, 2010 1:10:24 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8800 Nov 17, 2010 1:10:24 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8802 Nov 17, 2010 1:10:24 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=2/303 config=/opt/bmc/PATROL_DashBoard/tomcat/conf/jk2.properties StandardServer.await: create[8801]: java.net.BindException: Cannot assign requested address java.net.BindException: Cannot assign requested address at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.init(ServerSocket.java:185) at org.apache.catalina.core.StandardServer.await(StandardServer.java:510) at org.apache.catalina.startup.Catalina.start(Catalina.java:521) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) Stopping service Tomcat-Standalone DashBoard is about to shutdown. Waiting for current actions to end... Waiting for client servlets to end... Saving unsaved information on disk ... java.lang.NullPointerException at perform.janet.servlets.admin.GenericAdminServlet.stopActivities(GenericAdminServlet.java:665) at perform.janet.servlets.admin.DashboardContextListener.run(DashboardContextListener.java:115) at java.lang.Thread.run(Thread.java:619) PATROL DashBoard is still running. CompilerOracle: unrecognized line exclude oracle/sql/NUMBER _isPositive Unrecognized text after command: CompilerOracle: unrecognized line exclude com/inprise/vbroker/IIOP/ProtocolConnection receive_reply Unrecognized text after command: CompilerOracle: unrecognized line exclude oracle/xml/parser/v2/Step matchPattern Unrecognized text after command: CompilerOracle: unrecognized line exclude perform/dm/core/topology/resolution/validation/SwitchesJoining getCommonEntry Unrecognized text after command: CompilerOracle: unrecognized line exclude perform/dm/core/topology/resolution/validation/ValidationCriterium sortForwardings Unrecognized text after command: CompilerOracle: unrecognized line exclude perform/util/log/FileQueryHandler prepareFilter Unrecognized text after command: Nov 17, 2010 1:20:05 PM org.apache.commons.modeler.Registry loadRegistry INFO: Loading registry information Nov 17, 2010 1:20:05 PM org.apache.commons.modeler.Registry getRegistry INFO: Creating new Registry instance Nov 17, 2010 1:20:06 PM org.apache.commons.modeler.Registry getServer INFO: Creating MBeanServer Nov 17, 2010 1:20:07 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8800 Starting
Re: org.apache.jasper.util.Entry object Heap Size
Hello Mark, Please find below information: Tomcat version: 7.0.2 JDK : Java 1.6 Class exists in the jar : jasper.jar Path: /lib/jasper.jar Thanks to feedback, Amit Mark Thomas wrote: On 23/11/2010 11:02, amitruwali wrote: In one of our internet applications we are getting the heap memory consumption of almost 1.3 GB for org.apache.jasper.util.Entry object during analyzing the heap dump via eclipse memory analyzer tool. Now internally this object is pointing to one of our jsp's. The reference is as follows: org.apache.jasper.util.Entry - content - jspURI - value = /custom/company.jsp The total number of objects of this class is 60,000. Could you please indicate from the Tomcat perspective - when are the objects of this class created and under what scenarios would heap usage be to this high level? There is no such class in any current Tomcat version. Since you haven't told us which version you are using, there is little more we can do to help. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/org.apache.jasper.util.Entry-object-Heap-Size-tp30283792p30295968.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
AW: Several hosts within one tomcat / catch-all problem
Hi Perhaps I don't understand, but I agree with Pid's suggestion: just use defaultHost -- that's what it's for, right? Yes, if you have only one. However we have the following setup: App1: domain1.tld, www.domain1.tld App2: domain2.tld, www.domain2.tld, additional.domain2.tld App3: domain3.tld, www.domain3.tld, another.domain3.tld Now, defaultHost resolves the issue for ONE of these. But what we really need id: App1: domain1.tld, *.domain1.tld App2: domain2.tld, *.domain2.tld App3: domain3.tld, *.domain3.tld This cannot be done with defaultHost, can it? Regards, Steffen smime.p7s Description: S/MIME cryptographic signature
Re: AW: Several hosts within one tomcat / catch-all problem
Steffen Heil wrote: Hi Perhaps I don't understand, but I agree with Pid's suggestion: just use defaultHost -- that's what it's for, right? Yes, if you have only one. However we have the following setup: App1: domain1.tld, www.domain1.tld App2: domain2.tld, www.domain2.tld, additional.domain2.tld App3: domain3.tld, www.domain3.tld, another.domain3.tld Now, defaultHost resolves the issue for ONE of these. But what we really need id: App1: domain1.tld, *.domain1.tld App2: domain2.tld, *.domain2.tld App3: domain3.tld, *.domain3.tld This cannot be done with defaultHost, can it? You are right, it cannot. But even if this is an outside opinion by a non-Java non-Tomcat expert, it should not be too difficult to find the code which matches hostnames and aliases with the request Host: header, and change it from an exact to a regexp match, no ? Or introduce a new AliasMatch tag ? (that may be more ambitious, but maybe more elegant) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Please help ... [MultiThreadedHttpConnectionManager cleanup]
Ever since we've upgraded to Tomcat 6 4 weeks ago, I've been fighting the following error on shutdown ... Nov 23, 2010 4:42:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak. We're using Tomcat 6.0.29 and it reproduces on both Windows and Linux. The application uses commons-httpclient-3.1. I've done so many different things to shut down the connection from the web application that I'm convinced that it is either something with the commons-httpclient-3.1 or Tomcat 6. Since this did not happen with Tomcat 5, I'm leaning towards Tomcat 6 problem. Please let me know if anyone has seen this before. Thanx!!! Chris | Emerson Team Lead Architect Information Technology - The Family of Orange Lake Resorts 8505 W. Irlo Bronson Memorial Hwy. Kissimmee, FL 34747 Ext 1705 www.orangelake.com DISCLAIMER: Orange Lake Resorts does not accept legal responsibility for the contents of this message. Orange Lake Resorts reserves the right to monitor the transmission of this message and to take corrective action against any misuse or abuse of its e-mail system or other components of its network. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution, or any action or act of forbearance taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender has been duly authorized to specifically state the content of the e-mail on behalf of Orange Lake Resorts. The recipient should check this e-mail and any attachments for the presence of viruses. Orange Lake Resorts accepts no liability for any damage caused by any viruses transmitted by this e-mail.
RE: Please help ... [MultiThreadedHttpConnectionManager cleanup]
Please let me know if anyone has seen this before. I bet whoever put that in as a feature is really glad for all the posts that followed. http://wiki.apache.org/tomcat/MemoryLeakProtection or a quick google will provide you with some explanation, but basically it's most likely your code ;o) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Please help ... [MultiThreadedHttpConnectionManager cleanup]
From: Emerson, Christopher [mailto:cemer...@orangelake.com] Subject: Please help ... [MultiThreadedHttpConnectionManager cleanup] Ever since we've upgraded to Tomcat 6 4 weeks ago, I've been fighting the following error on shutdown ... You've actually had the error all along, but it's only the recent Tomcat versions that have been detecting and reporting it. Nov 23, 2010 4:42:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak. Your webapp has started an auxiliary thread, but not terminated it promptly. You should be using a ServletContextListener that insures any such extra threads have terminated before returning from its contextDestroyed() method. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Please help ... [MultiThreadedHttpConnectionManager cleanup]
On 24/11/2010 14:41, Rob Gregory wrote: Please let me know if anyone has seen this before. I bet whoever put that in as a feature is really glad for all the posts that followed. http://wiki.apache.org/tomcat/MemoryLeakProtection or a quick google will provide you with some explanation, but basically it's most likely your code ;o) At least we're finding the source of the problems, rather than people blindly assuming that it's Tomcat's fault. Nov 23, 2010 4:42:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak. MultiThreadedHttpConnectionManager is a class from HTTP Client. p 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
RE: Please help ... [MultiThreadedHttpConnectionManager cleanup]
So if this is being started from Axis2 1.5.1 client, there's a bug in the client code generation or the supporting Axis2 jars? -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 24, 2010 9:41 AM To: Tomcat Users List Subject: RE: Please help ... [MultiThreadedHttpConnectionManager cleanup] From: Emerson, Christopher [mailto:cemer...@orangelake.com] Subject: Please help ... [MultiThreadedHttpConnectionManager cleanup] Ever since we've upgraded to Tomcat 6 4 weeks ago, I've been fighting the following error on shutdown ... You've actually had the error all along, but it's only the recent Tomcat versions that have been detecting and reporting it. Nov 23, 2010 4:42:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak. Your webapp has started an auxiliary thread, but not terminated it promptly. You should be using a ServletContextListener that insures any such extra threads have terminated before returning from its contextDestroyed() method. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org DISCLAIMER: Orange Lake Resorts does not accept legal responsibility for the contents of this message. Orange Lake Resorts reserves the right to monitor the transmission of this message and to take corrective action against any misuse or abuse of its e-mail system or other components of its network. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution, or any action or act of forbearance taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender has been duly authorized to specifically state the content of the e-mail on behalf of Orange Lake Resorts. The recipient should check this e-mail and any attachments for the presence of viruses. Orange Lake Resorts accepts no liability for any damage caused by any viruses transmitted by this e-mail. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Please help ... [MultiThreadedHttpConnectionManager cleanup]
Emerson, Christopher wrote: Ever since we've upgraded to Tomcat 6 4 weeks ago, I've been fighting the following error on shutdown ... Nov 23, 2010 4:42:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: A web application appears to have started a thread named [MultiThreadedHttpConnectionManager cleanup] but has failed to stop it. This is very likely to create a memory leak. We're using Tomcat 6.0.29 and it reproduces on both Windows and Linux. The application uses commons-httpclient-3.1. I've done so many different things to shut down the connection from the web application that I'm convinced that it is either something with the commons-httpclient-3.1 or Tomcat 6. Since this did not happen with Tomcat 5, I'm leaning towards Tomcat 6 problem. Let me see if I have got this right.. The reason why you are seeing the message above in Tomcat 6, and were not seeing it in Tomcat 5, is because in Tomcat 6 there is added code which detects this kind of thing, and prints messages in the logs about it. Under Tomcat 5, the root reason happened too, but was not detected so you just did not know about it. If really this happens only when you shut down Tomcat, I don't think it should matter, since you are stopping the whole JVM, including that rogue thread, the memory will get cleaned up and there will be no leak left anyway. The message is there in case you would just stop and restart this application, without stopping the JVM in-between. Then you would experience a memory leak, and then it could matter in the long run. This being said, it does indicate a cause for possible memory leaks in the future, so you /might/ want to investigate further. How am I doing ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Please help ... [MultiThreadedHttpConnectionManager cleanup]
From: Emerson, Christopher [mailto:cemer...@orangelake.com] Subject: RE: Please help ... [MultiThreadedHttpConnectionManager cleanup] So if this is being started from Axis2 1.5.1 client, there's a bug in the client code generation or the supporting Axis2 jars? Possibly, or possibly you don't have it configured properly. (E.g., missing listener declaration in WEB-INF/web.xml.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Please help ... [MultiThreadedHttpConnectionManager cleanup]
Thank you! I just wanted to eliminate Tomcat 6 as a variable and that this wasn't a known issue. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 24, 2010 9:53 AM To: Tomcat Users List Subject: RE: Please help ... [MultiThreadedHttpConnectionManager cleanup] From: Emerson, Christopher [mailto:cemer...@orangelake.com] Subject: RE: Please help ... [MultiThreadedHttpConnectionManager cleanup] So if this is being started from Axis2 1.5.1 client, there's a bug in the client code generation or the supporting Axis2 jars? Possibly, or possibly you don't have it configured properly. (E.g., missing listener declaration in WEB-INF/web.xml.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org DISCLAIMER: Orange Lake Resorts does not accept legal responsibility for the contents of this message. Orange Lake Resorts reserves the right to monitor the transmission of this message and to take corrective action against any misuse or abuse of its e-mail system or other components of its network. The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution, or any action or act of forbearance taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender has been duly authorized to specifically state the content of the e-mail on behalf of Orange Lake Resorts. The recipient should check this e-mail and any attachments for the presence of viruses. Orange Lake Resorts accepts no liability for any damage caused by any viruses transmitted by this e-mail. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Error Question
Hello all, I am in the process of developing a Servlet application. I am currently using Eclipse Helios and Tomcat 6.0.29 in my dev environment. When I start up Tomcat in Eclipse I get the following error pasted below. What does this mean and how do I resolve it? Thank you. --Omar ov 24, 2010 8:45:05 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:686) at org.apache.jasper.compiler.JspUtil.makeJavaIdentifier(JspUtil.java:996) at org.apache.jasper.JspCompilationContext.getServletClassName(JspCompilati onContext.java:374) at org.apache.jasper.JspCompilationContext.getServletJavaFileName(JspCompil ationContext.java:473) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:159) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:347) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:592) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:317) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2 98) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85 7) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process( Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619)
RE: Error Question
From: Omar A. Barrera [mailto:oma...@southtexascollege.edu] Subject: Error Question I am currently using Eclipse Helios and Tomcat 6.0.29 What JVM are you using? There was a known bug in 6u* that threw an erroneous string index out of bounds exception on occasion. The problem was fixed in 6u22 (or possibly earlier). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: ****SPAM**** RE: Error Question
I am currently at JVM 1.6.0_11 and am using JDK 1.6.20. So updating the JVM should resolve the issue? I will give it a try. Many thanks. Regards, --Omar Barrera -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 24, 2010 9:18 AM To: Tomcat Users List Subject: SPAM RE: Error Question From: Omar A. Barrera [mailto:oma...@southtexascollege.edu] Subject: Error Question I am currently using Eclipse Helios and Tomcat 6.0.29 What JVM are you using? There was a known bug in 6u* that threw an erroneous string index out of bounds exception on occasion. The problem was fixed in 6u22 (or possibly earlier). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: ****SPAM**** RE: Error Question
From: Omar A. Barrera [mailto:oma...@southtexascollege.edu] Subject: RE: SPAM RE: Error Question I am currently at JVM 1.6.0_11 and am using JDK 1.6.20. Not sure how you can be two places at once... So updating the JVM should resolve the issue? Might, rather than should. It would at least eliminate one possibility. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Starup Order [Filters -- Servlets -- Context]
Hi Guys, Am I correct in my assumption that servlet filters are started before servlets and that the context listeners are not fired until both the filters and servlets have been initialised? What I am trying to do is run some code before the context is started which is actually going to copy a mycontext.xml into another mysecondcontext.xml (using docBase=single_webapp_location). which would then get auto deployed into Tomcat creating the 2nd context. As part of this process I also need to copy some files from a 'location' into the docBase and suspect that this will cause Tomcat to reload both contexts. Is there any entry point during Tomcat startup where I can do some work before either contexts are started? Tomcat is 6.0.29 under JDK 1.6 Thanks for any assistance. Rob
Re: Starup Order [Filters -- Servlets -- Context]
On 24/11/2010 15:38, Rob Gregory wrote: Hi Guys, Am I correct in my assumption that servlet filters are started before servlets and that the context listeners are not fired until both the filters and servlets have been initialised? ServletContextListeners first, before Filters Servlets. What I am trying to do is run some code before the context is started which is actually going to copy a mycontext.xml into another mysecondcontext.xml (using docBase=single_webapp_location). which would then get auto deployed into Tomcat creating the 2nd context. I'm not sure that's such a good idea. As part of this process I also need to copy some files from a 'location' into the docBase and suspect that this will cause Tomcat to reload both contexts. Depends how you're configured. It might. Is there any entry point during Tomcat startup where I can do some work before either contexts are started? LifecycleListener? Look for examples at the beginning of server.xml. p Tomcat is 6.0.29 under JDK 1.6 Thanks for any assistance. Rob 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
RE: Starup Order [Filters -- Servlets -- Context]
Thanks Pid, see my comment below:- -Original Message- From: Pid [mailto:p...@pidster.com] Sent: 24 November 2010 17:05 To: Tomcat Users List Subject: Re: Starup Order [Filters -- Servlets -- Context] On 24/11/2010 15:38, Rob Gregory wrote: Hi Guys, Am I correct in my assumption that servlet filters are started before servlets and that the context listeners are not fired until both the filters and servlets have been initialised? ServletContextListeners first, before Filters Servlets. Ah, I was confusing the events being fired to the actual initialisation of the ServletContextListeners. What I am trying to do is run some code before the context is started which is actually going to copy a mycontext.xml into another mysecondcontext.xml (using docBase=single_webapp_location). which would then get auto deployed into Tomcat creating the 2nd context. I'm not sure that's such a good idea. Is there a specific reason why not? How is doing this any different to manually creating the two context.xml files if I can create them before the contexts are initialised? As part of this process I also need to copy some files from a 'location' into the docBase and suspect that this will cause Tomcat to reload both contexts. Depends how you're configured. It might. I have a number of watched resources so I think it will unless I can copy the files before the contexts are initialised. Is there any entry point during Tomcat startup where I can do some work before either contexts are started? LifecycleListener? Look for examples at the beginning of server.xml. Thanks for the pointer Pid. Most helpful. p Tomcat is 6.0.29 under JDK 1.6 Thanks for any assistance. Rob - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Starup Order [Filters -- Servlets -- Context]
On 24/11/2010 17:15, Rob Gregory wrote: Thanks Pid, see my comment below:- -Original Message- From: Pid [mailto:p...@pidster.com] Sent: 24 November 2010 17:05 To: Tomcat Users List Subject: Re: Starup Order [Filters -- Servlets -- Context] On 24/11/2010 15:38, Rob Gregory wrote: Hi Guys, Am I correct in my assumption that servlet filters are started before servlets and that the context listeners are not fired until both the filters and servlets have been initialised? ServletContextListeners first, before Filters Servlets. Ah, I was confusing the events being fired to the actual initialisation of the ServletContextListeners. What I am trying to do is run some code before the context is started which is actually going to copy a mycontext.xml into another mysecondcontext.xml (using docBase=single_webapp_location). which would then get auto deployed into Tomcat creating the 2nd context. I'm not sure that's such a good idea. Is there a specific reason why not? How is doing this any different to manually creating the two context.xml files if I can create them before the contexts are initialised? The deployment cycle is single threaded, the SCLs execute sequentially in order of definition in each application. If the SCL throws an uncaught exception, then the app won't start up at all. Does it need to happen in an SCL? As part of this process I also need to copy some files from a 'location' into the docBase and suspect that this will cause Tomcat to reload both contexts. Depends how you're configured. It might. I have a number of watched resources so I think it will unless I can copy the files before the contexts are initialised. If you're watching the file that gets copied, then yes, it'll cause a redeployment of app1, consequently of app2. Are you watching that file? p Is there any entry point during Tomcat startup where I can do some work before either contexts are started? LifecycleListener? Look for examples at the beginning of server.xml. Thanks for the pointer Pid. Most helpful. p Tomcat is 6.0.29 under JDK 1.6 Thanks for any assistance. Rob - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 0x62590808.asc Description: application/pgp-keys signature.asc Description: OpenPGP digital signature
Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
Hi This is my first post to tomcat user mailing list. I'm using Tomcat 6.0.24 on Linux RHELS release 5.3 (Tikanga) on a 64 bit OS. I have deployed a Web application within Tomcat. The Web App in the main sends dynamically created video content to a client over the HTTP1.1 Blocking Connector. I have configured Tomcat to use the Blocking IO HTTP Connector. Main Configuration parameters are the following maxThreads=1000 minSpareThreads=300 The use case is the following. HTTP Client uses HTTP Post to send video content to a Web App in Tomcat. Tomcat Web App Dynamically re-codes this video content and sends this video payload in the body of the HTTP Response (response to HTTP Post) to the client. As the Web App doesn't know the final size of the video content it sends so it does not add the HTTP Content-Length header in the HttpServletResponse. The Tomcat HTTP Connector (I presume) correctly knows to send this content as a HTTP Chunked response, i.e. Transfer-Encoding: Chunked. So this work well nearly all of the time, i.e. correct headers are sent and all the data is sent as chunked response. However when I am putting a load through the system e.g 40 or 50 concurrent threads processing content and I make another single HTTP request to the Web App that is normally rejected with a 500. However before the Tomcat thread finalizes it response to this specific request I terminate the client and its request (ctrl-c), then the next time this same Tomcat thread is re-used it will send the video in the HTTP response body as Un-Chunked and not Chunked as expected but the HTTP status code is 200 as expected. Also the Content-Length header is missing on this response and all the other HTTP headers that the Web App inserted are not sent. This then causes problems for the HTTP Client requesting said content. However the next time after this that we re-use this thread (3rd time used) then its back to working normally again sending HTTP Chunked response as exepcted. So the normal response is like this. Note chunked response and chunk size is 2000 hex about 8K. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 x-my-session-id: 1000128946853721720696116 Content-Type: video/x-flv Transfer-Encoding: chunked Date: Thu, 11 Nov 2010 09:42:17 GMT 2000 onMetaData totalduration canseekontime bytelength The problems response looks this this. Note no Content-length header or Chunked response. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Date: Wed, 10 Nov 2010 14:32:25 GMT Connection: close FLV... To replicate this issue is very much dependant on when I terminate the client request. If I terminate too late or too early I dont see this issue. It some sort of race condition. I upgraded to Tomcat 6.0.29 as I had seen some security issues relating to Transfer-Encodings, here http://tomcat.apache.org/security-6.html. However it didnt make any difference. I have also read the bug list and cannot see this same issue. Any ideas what the issue is here and is there anything I can do to mitigate it? Thanks Declan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
On 24 Nov 2010, at 18:07, declan harrison harrison.dec...@gmail.com wrote: Hi This is my first post to tomcat user mailing list. Hello. I'm using Tomcat 6.0.24 on Linux RHELS release 5.3 (Tikanga) on a 64 bit OS. Which JVM version? I have deployed a Web application within Tomcat. The Web App in the main sends dynamically created video content to a client over the HTTP1.1 Blocking Connector. How are you writing to the output of the response? I have configured Tomcat to use the Blocking IO HTTP Connector. Main Configuration parameters are the following maxThreads=1000 minSpareThreads=300 The use case is the following. HTTP Client uses HTTP Post to send video content to a Web App in Tomcat. Tomcat Web App Dynamically re-codes this video content and sends this video payload in the body of the HTTP Response (response to HTTP Post) to the client. As the Web App doesn't know the final size of the video content it sends so it does not add the HTTP Content-Length header in the HttpServletResponse. The Tomcat HTTP Connector (I presume) correctly knows to send this content as a HTTP Chunked response, i.e. Transfer-Encoding: Chunked. So this work well nearly all of the time, i.e. correct headers are sent and all the data is sent as chunked response. However when I am putting a load through the system e.g 40 or 50 concurrent threads processing content and I make another single HTTP request to the Web App that is normally rejected with a 500. What us the cause, and is there an exception stacktrace in the logs? However before the Tomcat thread finalizes it response to this specific request I terminate the client and its request (ctrl-c), then the next time this same Tomcat thread is re-used it will send the video in the HTTP response body as Un-Chunked and not Chunked as expected but the HTTP status code is 200 How are you determining that it is the same thread? as expected. Also the Content-Length header is missing on this response and all the other HTTP headers that the Web App inserted are not sent. This then causes problems for the HTTP Client requesting said content. However the next time after this that we re-use this thread (3rd time used) then its back to working normally again sending HTTP Chunked response as exepcted. That sounds like the thread is only being reset properly after it's been used a second time. So the normal response is like this. Note chunked response and chunk size is 2000 hex about 8K. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 x-my-session-id: 1000128946853721720696116 Content-Type: video/x-flv Transfer-Encoding: chunked Date: Thu, 11 Nov 2010 09:42:17 GMT 2000 onMetaData totalduration canseekontime bytelength The problems response looks this this. Note no Content-length header or Chunked response. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Date: Wed, 10 Nov 2010 14:32:25 GMT Connection: close FLV... To replicate this issue is very much dependant on when I terminate the client request. If I terminate too late or too early I dont see this issue. It some sort of race condition. Do you still see a 500 when you terminate, if so is it the same stacktrace? Do you have any part of the response stored as an instance field in your servlet? p I upgraded to Tomcat 6.0.29 as I had seen some security issues relating to Transfer-Encodings, here http://tomcat.apache.org/security-6.html. However it didnt make any difference. I have also read the bug list and cannot see this same issue. Any ideas what the issue is here and is there anything I can do to mitigate it? Thanks Declan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.jasper.util.Entry object Heap Size
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Amit, On 11/24/2010 6:31 AM, amitruwali wrote: Please find below information: Tomcat version: 7.0.2 JDK : Java 1.6 [Class is org.apache.jasper.util.Entry] Class exists in the jar : jasper.jar Path: /lib/jasper.jar $ wget 'http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.2-beta/bin/apache-tomcat-7.0.2.tar.gz' $ tar xzf apache-tomcat-7.0.2.tar.gz $ $ unzip -v apache-tomcat-7.0.2/lib/jasper.jar |grep /Entry 1501 Defl:N 592 61% 08-04-10 00:24 8d5f2d6a org/apache/jasper/util/Entry.class Yup, there it is. I'm trying to track down what happened to it. My svn-fu is not very good. In the meantime, you should probably upgrade to 7.0.4 which is the latest in the 7.0.x line. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkztbQkACgkQ9CaO5/Lv0PDm3ACdEEn8BihyZLb1nRh1kJFNpV8/ QMgAoKCd0ZSJDEuraAo+UoqURN+Wq5e1 =tc+Y -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: AW: Several hosts within one tomcat / catch-all problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steffan, On 11/24/2010 8:22 AM, Steffen Heil wrote: This cannot be done with defaultHost, can it? Now I understand, and you are correct. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkztbVAACgkQ9CaO5/Lv0PBoOACgv8nlpjcSJnF6gSBci+Zc3RR6 mDwAn2HsDSmJ21vvFYL2XDz9WMd46XOe =85fQ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: AW: Several hosts within one tomcat / catch-all problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 11/24/2010 8:38 AM, André Warnier wrote: But even if this is an outside opinion by a non-Java non-Tomcat expert, it should not be too difficult to find the code which matches hostnames and aliases with the request Host: header, and change it from an exact to a regexp match, no ? Or introduce a new AliasMatch tag ? (that may be more ambitious, but maybe more elegant) As Konstantin pointed out, all that stuff is in the Mapper (which is org.apache.tomcat.util.http.mapper.Mapper). I would say that using an AliasMatch would be a good idea because a) it mirrors httpd-style configuration where Foo does exact matches while FooMatch allows regular expressions, etc. and b) it shouldn't diminish performance of the existing Alias code -- that is, you only pay for it if you need it. Steffen, care to log an enhancement request in bugzilla? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkztbeQACgkQ9CaO5/Lv0PADLQCgnlWy5+D+3JdxyW65PG+ITlcf ey8AoJNxXJJE4KE6iehVMyGfj0gfe+/T =uhVA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: org.apache.jasper.util.Entry object Heap Size
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: org.apache.jasper.util.Entry object Heap Size In the meantime, you should probably upgrade to 7.0.4 which is the latest in the 7.0.x line. I'd recommend skipping 7.0.4 and getting Tomcat 7.0.5 from svn. Mark tagged it today, so you can get it from here: http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_5/ I would expect a 7.0.5 release sometime next week. The class in question is completely removed from 7.0.5, so whatever problem was causing the apparent memory leak won't happen again - at least in that form. - 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.
Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, On 11/24/2010 2:32 PM, Pid * wrote: That sounds like the thread is only being reset properly after it's been used a second time. +1 This can probably be replicated in a test by having a dummy servlet simply throw a ClientAbortException (or whatever it is that gets thrown when you try to write to a socket whose client has already hung up the phone). Declan, could you try to build a simple servlet that replicates these conditions and post it? That will go a long way towards getting this investigated and, if it's a problem with Tomcat, ultimately fixed. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkztbrsACgkQ9CaO5/Lv0PAH2gCdH/u7XLeA1Mh6uORcU7PlJQj1 lIQAn1mhJnnFc2Mo6lH5r0dYU90X4LRK =S+Ki -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.jasper.util.Entry object Heap Size
2010/11/24 Christopher Schultz ch...@christopherschultz.net: On 11/24/2010 6:31 AM, amitruwali wrote: Please find below information: Tomcat version: 7.0.2 JDK : Java 1.6 [Class is org.apache.jasper.util.Entry] Class exists in the jar : jasper.jar Path: /lib/jasper.jar $ wget 'http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.2-beta/bin/apache-tomcat-7.0.2.tar.gz' $ tar xzf apache-tomcat-7.0.2.tar.gz $ $ unzip -v apache-tomcat-7.0.2/lib/jasper.jar |grep /Entry 1501 Defl:N 592 61% 08-04-10 00:24 8d5f2d6a org/apache/jasper/util/Entry.class Yup, there it is. I'm trying to track down what happened to it. My svn-fu is not very good. http://svn.apache.org/viewvc?view=revisionrevision=1028396 Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: the memory puzzle me....
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 11/24/2010 12:47 AM, Caldarale, Charles R wrote: I suspect the more sophisticated profilers like YourKit will [show PermGen details], but I'm not sure. Others on the list use YourKit regularly, so they might be able to be more definitive when they wake up in an hour or two. I fired-up YourKit to see what I could find out through the memory inspection tools. I can't find anything specifically about PermGen in the live view, nor in a memory snapshot which lets you do much more interesting things without the confusion of everything changing all the time :) I wasn't able to find anything else other than a graph for non-heap memory. There is help on object generations but that actually has nothing to do with the heap generations that the GC uses. If anyone can tell me how to inspect the heap generations with YourKit, I'd certainly like to hear it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkztdKgACgkQ9CaO5/Lv0PBMQQCgkM3MAkP6TE7lgFGfAR4F+GXT jtIAnifQbMga1SpczL9iq5RZAnPtytvE =84xV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
On Wed, Nov 24, 2010 at 7:32 PM, Pid * p...@pidster.com wrote: On 24 Nov 2010, at 18:07, declan harrison harrison.dec...@gmail.com wrote: Hi This is my first post to tomcat user mailing list. Hello. Hi there I'm using Tomcat 6.0.24 on Linux RHELS release 5.3 (Tikanga) on a 64 bit OS. Which JVM version? java version 1.6.0_18 Java(TM) SE Runtime Environment (build 1.6.0_18-b07) Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode) I have deployed a Web application within Tomcat. The Web App in the main sends dynamically created video content to a client over the HTTP1.1 Blocking Connector. How are you writing to the output of the response? Im wrapping the response ServletOutputStream in a BufferedOutputStream; Something like this bufOutStream = new BufferedOutputStream(response.getOutputStream(),20480); I have configured Tomcat to use the Blocking IO HTTP Connector. Main Configuration parameters are the following maxThreads=1000 minSpareThreads=300 The use case is the following. HTTP Client uses HTTP Post to send video content to a Web App in Tomcat. Tomcat Web App Dynamically re-codes this video content and sends this video payload in the body of the HTTP Response (response to HTTP Post) to the client. As the Web App doesn't know the final size of the video content it sends so it does not add the HTTP Content-Length header in the HttpServletResponse. The Tomcat HTTP Connector (I presume) correctly knows to send this content as a HTTP Chunked response, i.e. Transfer-Encoding: Chunked. So this work well nearly all of the time, i.e. correct headers are sent and all the data is sent as chunked response. However when I am putting a load through the system e.g 40 or 50 concurrent threads processing content and I make another single HTTP request to the Web App that is normally rejected with a 500. What us the cause, and is there an exception stacktrace in the logs? It is expected for my Web App to reject this request with HTTP status code 500. The input request content is invalid. So typically the Web App will log the problem with the input content and then call response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR ); I dont have an error code setup in the web.xml file. After having setup some HTTP response headers and then return from the doPost method. There is no exception backtrace as such, logged by tomcat as far as I can see. do you think that Tomcat itself is logging a stacktrace somewhere. Theres nothing in my log file apart from the expected warning/error message that the Web App log explicitly. However before the Tomcat thread finalizes it response to this specific request I terminate the client and its request (ctrl-c), then the next time this same Tomcat thread is re-used it will send the video in the HTTP response body as Un-Chunked and not Chunked as expected but the HTTP status code is 200 How are you determining that it is the same thread? So in my Web App log file i log the client IP address and Port. So for the client request which I terminate manually I perform this from a different IP address than the one were all the other requests are made from. The log file also logs the ThreadId of each log event e.g. Nov 22 17:54:19 hostname [ProcessName][1001][26348][tomcat-exec-243] INFO Bla Bla... Here you can see tomcat-exec-243 is the thread Id. So then the next time a log event is performed that matches this threadId I see that it fails. as expected. Also the Content-Length header is missing on this response and all the other HTTP headers that the Web App inserted are not sent. This then causes problems for the HTTP Client requesting said content. However the next time after this that we re-use this thread (3rd time used) then its back to working normally again sending HTTP Chunked response as exepcted. That sounds like the thread is only being reset properly after it's been used a second time. Yes that correct. It appears to me that the state of the output stream in the thread is all setup to send a non chunked response as it would with the 500 error it didnt send and so sends the video response non chunked and its only after that does it resset its state. Does each thread maintain state between different HTTP requests. I also tried increasing linger time on each socket. So I tried 5 seconds and right enough it took 5 or more seconds before Tomcat re-used this thread but the bad result was the same. So the normal response is like this. Note chunked response and chunk size is 2000 hex about 8K. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 x-my-session-id: 1000128946853721720696116 Content-Type: video/x-flv Transfer-Encoding: chunked Date: Thu, 11 Nov 2010 09:42:17 GMT 2000 onMetaData totalduration canseekontime bytelength The problems response looks this this. Note no Content-length header or Chunked response. HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Date: Wed, 10
RE: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
From: declan harrison [mailto:harrison.dec...@gmail.com] Subject: Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked Do you have any part of the response stored as an instance field in your servlet? Yes I have a reference to the HttpServletResponse, response.getOutputStream(), which I close when Im done. Fatal error - don't ever do that. Multiple threads running through your servlet will walk over each other. It's fine to have local variables pointing to objects related to a request or response, but having instance or static variables do so is guaranteed to cause problems. Remember that each servlet (or filter) is instantiated *once* for the lifetime of the webapp, not once per request. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
On Wed, Nov 24, 2010 at 7:59 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, On 11/24/2010 2:32 PM, Pid * wrote: That sounds like the thread is only being reset properly after it's been used a second time. +1 This can probably be replicated in a test by having a dummy servlet simply throw a ClientAbortException (or whatever it is that gets thrown when you try to write to a socket whose client has already hung up the phone). Declan, could you try to build a simple servlet that replicates these conditions and post it? That will go a long way towards getting this investigated and, if it's a problem with Tomcat, ultimately fixed. Hi Christopher Yes, I can look to build a servlet to do this; to throw an exception when performing IO on the ServletoutputStream thats been tore down. Hopefully will get back tomorrow - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkztbrsACgkQ9CaO5/Lv0PAH2gCdH/u7XLeA1Mh6uORcU7PlJQj1 lIQAn1mhJnnFc2Mo6lH5r0dYU90X4LRK =S+Ki -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: clearThreadLocalMap and NullPointerException
On Nov 24, 2010, at 12:41 AM, Mark Thomas wrote: On 24/11/2010 01:28, Blair Zajac wrote: On Nov 23, 2010, at 4:49 PM, Blair Zajac wrote: On Nov 23, 2010, at 2:24 AM, Mark Thomas wrote: Do let us know what the problem was when you find it. Does JNA provide its own clean up methods that I could run at shutdown? I haven't looked yet to see. I found the cause, it's an issue with JNA, they should be providing a real iterator() implementation, not one that just returns null. Not that they expected anyone to call toString() on it. http://article.gmane.org/gmane.comp.java.jna.user/4347 I guess it's up to you if you want to handle a case like this. I could see other projects not bothering to provide real implementations of things if they don't expect anything to go looking into their internals. Thanks for getting back with details of the problem. I agree with you that there are likely to be other libraries doing similar things. I think the general handling now in place is the right way to go. Hopefully, the issues it highlights in third party libraries they will get reported and fixed. JNA just committed a fix for this and with the Tomcat improvement, we're all good. Thanks for the help! Blair - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
On Wed, Nov 24, 2010 at 10:23 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: declan harrison [mailto:harrison.dec...@gmail.com] Subject: Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked Do you have any part of the response stored as an instance field in your servlet? Yes I have a reference to the HttpServletResponse, response.getOutputStream(), which I close when Im done. Fatal error - don't ever do that. Multiple threads running through your servlet will walk over each other. It's fine to have local variables pointing to objects related to a request or response, but having instance or static variables do so is guaranteed to cause problems. Remember that each servlet (or filter) is instantiated *once* for the lifetime of the webapp, not once per request. - Chuck Hi Chuck Sorry for my misleading statement I meant I have local variable that reference the response output stream. I dont have a servlet attribute that holds a reference to the response stream THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked
From: declan harrison [mailto:harrison.dec...@gmail.com] Subject: Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked I meant I have local variable that reference the response output stream. Ok, you're off the hook on that one. Anything stored in the session that might allow intermingling of requests or responses? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
Hi Scott, The exception was caused by wrong setting in your original HTTPS connector settings... In Mark's email, you need to put conf/key1cert.pem in SSLCertificateFile attribute and conf/key1.pem in SSLCertificateKeyFile attribute. 2010/11/24 Scott Li scott...@gwghk.com thanks Mark Thomas and Goo Sam Kong I followed Goo Sam Kong 's config still have errors: Loaded APR based Apache Tomcat Native library 1.1.20. 2010-11-24 17:38:43 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2010-11-24 17:38:43 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 17:38:43 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) update config as follow, Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol SSLCertificateFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1.pem SSLCertificateKeyFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem SSLPassword=test / Connector port=8009 enableLookups=false redirectPort=443 protocol=AJP/1.3 / I find my SSLCertificateFile is *.pem, and Goo Sam Kong's crt, key, how do you create these files, not use OpenSSL? 在 2010年11月24日 下午5:10,Goo Sam Kong skgo...@gmail.com写道: Hi Scott, My working HTTPS connector using APR settings as below: Connector port=8443 protocol=org.apache.coyote.http11.Http11AprProtocol SSLEnabled=true maxThreads=150 scheme=https secure=true SSLCertificateFile=C:\usr\tomcat\tomcat.crt SSLCertificateKeyFile=C:\usr\tomcat\tomcat.key SSLPassword=123456 / Try to remove SSLEngine attribute and add protocol attribute, then re-start Tomcat. -- Thanks Regards, Scott Li
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
Dear Goo Sam Kong, It' OK now , Thank you very much! I changed the cert file config as below: Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol SSLCertificateFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem SSLCertificateKeyFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1.pem SSLPassword=test / and restart tomcat, but find another error below: Error initializing endpoint java.lang.Exception: Socket bind failed: [730048] ??×??(Э??é/??/??)í at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:412) at org.apache.coyote.ajp.AjpAprProtocol.init(AjpAprProtocol.java:89) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-25 9:17:14 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[AJP/1.3-8009]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Socket bind failed: [730048] ??×??(Э??é/??/??)í at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) I opened the task management, and closed all the javaw.exe processes, restart Tomcat again, https://localhost/ can open now, thx! 在 2010年11月25日 上午8:45,Goo Sam Kong skgo...@gmail.com写道: Hi Scott, The exception was caused by wrong setting in your original HTTPS connector settings... In Mark's email, you need to put conf/key1cert.pem in SSLCertificateFile attribute and conf/key1.pem in SSLCertificateKeyFile attribute. 2010/11/24 Scott Li scott...@gwghk.com thanks Mark Thomas and Goo Sam Kong I followed Goo Sam Kong 's config still have errors: Loaded APR based Apache Tomcat Native library 1.1.20. 2010-11-24 17:38:43 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2010-11-24 17:38:43 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 17:38:43 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key
No of sessions,current thread count and thread busy Logs in tomcat
I am Monitoring the tomcat application ,no. of session ,Current thread count and current thread busy using lambda probe. Is there any way to save these these datas in local machine for future reference for specfic interval. --rujin