Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7
On 15 June 2011 18:54, Konstantin Kolinko wrote: > The request and response objects must never be accessed outside the > request processing cycle. The objects are recycled and cleared or > reused for subsequent request and responses, and are not guaranteed to > be thread-safe. The consequences can be severe. I was interested by this. So: private Service service; @Override public void init() throws ServletException { super.init(); service = (Service) WebApplicationContextUtils.getWebApplicationContext(getServletContext()).getBean("service"); } protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { service.logHit(request); } is a bad thing? Could you explain why? I would assume that a new request object is created each time, and that while something has a reference to it, it will be fine, and when logHit has finished with it, it will be eligible for garbage collection. Calum - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat 5.5 ------ log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
I can run without problem locally for app testPhoenix in eclipse server, but when deploy to linux box, I got error like below 20-Jun-2011 9:19:24 AM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart 20-Jun-2011 9:19:24 AM org.apache.catalina.core.StandardContext start SEVERE: Context [/testPhoenix] startup failed due to previous errors log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository. This error is very short and I googled online for this error, but can not figure out either. how to make this error more clarified? thanks in advance. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat 5.5 ------ log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
2011/6/20 WEIQUAN YUAN : > I can run without problem locally for app testPhoenix in eclipse > server, but when deploy to linux box, I got error like below > > > 20-Jun-2011 9:19:24 AM org.apache.catalina.core.StandardContext start > SEVERE: Error listenerStart > 20-Jun-2011 9:19:24 AM org.apache.catalina.core.StandardContext start > SEVERE: Context [/testPhoenix] startup failed due to previous errors > log4j:ERROR LogMananger.repositorySelector was null likely due to > error in class reloading, using NOPLoggerRepository. > > > This error is very short and I googled online for this error, but can > not figure out either. how to make this error more clarified? > 1. What exact version of Tomcat 5.5.x you are using? 2. It says that it is class loading issue. What jars to you have on the server ind in your webapp? And what version of log4j you are using? 3. How logging is configured in your webapp and in Tomcat? 4. Have you tried log4j mailing list? http://logging.apache.org/log4j/ Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat 5.5 ------ log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
> 1. What exact version of Tomcat 5.5.x you are using? 5.5.17.0 > 2. It says that it is class loading issue. What jars to you have on > the server ind in your webapp? there are a lot of jars i used for this webapp, including spring, dwr, log4j, mail, esapi, jstl, json, common, activation, . > And what version of log4j you are using? log4j-1.2.15.jar, > 3. How logging is configured in your webapp and in Tomcat? using -Dlog4j.configuration=log4j.xml in tomcat startup script and put log4j.xml in WEB-INF/classes > 4. Have you tried log4j mailing list? > http://logging.apache.org/log4j/ No, I didn't try to put in this question to log4j mailing list. On Mon, Jun 20, 2011 at 9:58 AM, Konstantin Kolinko wrote: > 2011/6/20 WEIQUAN YUAN : >> I can run without problem locally for app testPhoenix in eclipse >> server, but when deploy to linux box, I got error like below >> >> >> 20-Jun-2011 9:19:24 AM org.apache.catalina.core.StandardContext start >> SEVERE: Error listenerStart >> 20-Jun-2011 9:19:24 AM org.apache.catalina.core.StandardContext start >> SEVERE: Context [/testPhoenix] startup failed due to previous errors >> log4j:ERROR LogMananger.repositorySelector was null likely due to >> error in class reloading, using NOPLoggerRepository. >> >> >> This error is very short and I googled online for this error, but can >> not figure out either. how to make this error more clarified? >> > > 1. What exact version of Tomcat 5.5.x you are using? > > 2. It says that it is class loading issue. What jars to you have on > the server ind in your webapp? > > And what version of log4j you are using? > > 3. How logging is configured in your webapp and in Tomcat? > > 4. Have you tried log4j mailing list? > http://logging.apache.org/log4j/ > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- Weiquan Yuan Located in Ottawa - Capital Region of Canada Email: weiquan.y...@gmail.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Adding a webapp via the API to a running instance
I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. After it is running, I'm trying to add another webapp with .addWebapp. The addWebapp call logs: 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO org.apache.catalina.util.LifecycleBase - The start() method was called on component [Realm[Simple]] after start() had already been called. The second call will be ignored. 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO org.apache.catalina.startup.ContextConfig - No global web.xml found This second message is odd, since there is a global web.xml sitting in the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. However, this is followed in quick succession by an NPE. In ContextConfig.java, jspServlet is null. Does it make sense that the problem is the failure to find the global web.xml, since it would define the jsp servlet? And, if so, why does this work for my first webpp (defined before 'start') and not for my second? java.lang.NullPointerException at org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) at org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Adding a webapp via the API to a running instance
Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, String, String), I don't understand the following: // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); Why is this being used to prevent the code from seeing a web.xml in the basedir/conf? On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies wrote: > I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. > > After it is running, I'm trying to add another webapp with .addWebapp. > > The addWebapp call logs: > > 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO > org.apache.catalina.util.LifecycleBase - The start() method was called > on component [Realm[Simple]] after start() had already been called. > The second call will be ignored. > 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO > org.apache.catalina.startup.ContextConfig - No global web.xml found > > This second message is odd, since there is a global web.xml sitting in > the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. > > However, this is followed in quick succession by an NPE. In > ContextConfig.java, jspServlet is null. Does it make sense that the > problem is the failure to find the global web.xml, since it would > define the jsp servlet? And, if so, why does this work for my first > webpp (defined before 'start') and not for my second? > > java.lang.NullPointerException > at > org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) > at > org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) > at > org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) > at > org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) > at > org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) > at > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) > at > org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) > at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) > at > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) > at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) > at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) > at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Calum, On 6/20/2011 6:12 AM, Calum wrote: > On 15 June 2011 18:54, Konstantin Kolinko wrote: >> The request and response objects must never be accessed outside the >> request processing cycle. The objects are recycled and cleared or >> reused for subsequent request and responses, and are not guaranteed to >> be thread-safe. The consequences can be severe. > > I was interested by this. > So: > > private Service service; > > @Override > public void init() throws ServletException { > super.init(); > service = (Service) > WebApplicationContextUtils.getWebApplicationContext(getServletContext()).getBean("service"); > } > > protected void processRequest(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > service.logHit(request); > > } > > > is a bad thing? That depends on what Service.logHit does. If it only uses the HttpServletRequest object during the method's lifetime, then everything is fine. If it retains a reference to the request object, you will probably end up with a problem. > Could you explain why? Tomcat re-uses the same request and response objects for a long time, and so multiple request processor threads will see the same object over the life of the server. If any of that code retains a reference to the request, by the time the object is re-referenced by the same code for whatever reason, the object will have "moved on" and will almost certainly be invalid (from the perspective of the code that cached it) and might /actually/ be invalid (because it is between requests and Tomcat has actively invalidated it). > I would assume that a new request object is created each time, and > that while something has a reference to it, it will be fine, and when > logHit has finished with it, it will be eligible for garbage > collection. Nope: see Konstantin's and me comments above. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEUEARECAAYFAk3/bwUACgkQ9CaO5/Lv0PBaLQCWLMYh41usETP5XWpEvGWF+Y1d mwCfSA9l2qR27DGT+tKi7MgrwUwKowc= =Sgfb -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
A servlet named jsp
This is related to another thread I started, but it's a different question. Some experimentation shows that Tomcat.java disables the default web.xml for a good reason; if I force one back into place, I get a duplicate name error. However, whatever it ends up using does not include a servlet named 'jsp', and then org.apache.catalina.startup.ContextConfig.convertJsps(WebXml) ends up with an NPE with a webapp (in this case solr) that has any jsp servlets. I'm continuing to dig. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomact 5.5 Clustering
Hi Cluster did start , but I am getting exception : INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 20, 2011 11:44:31 AM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Exception in thread "Cluster-MembershipReceiver" java.lang.OutOfMemoryError: Java heap space at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:174) at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:242) at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.ja va:330) Thanks Tauqir Akhtar 212 801 8039 -Original Message- From: János Löbb [mailto:janos.l...@yale.edu] Sent: Thursday, June 09, 2011 12:37 PM To: Tomcat Users List Subject: Re: Tomact 5.5 Clustering On Jun 9, 2011, at 10:30 AM, Tauqir Akhtar wrote: > Hi > > I am running two Tomcat (5.5.27) Instances on two different machines > deploying the same Java Application. > > I have made changes in server.xml to specify the Port on which Tomcat should > run on the two machines. > > On Machine 1 : > On Machine 2 : > Both the Instances are running fine. > > What other configuration changes (In which files) do I need to make to run > these two Tomcat Instances in one Cluster? > > I have following variables set in the machine environment: > > CATALINA_OPTS : -Xms512m -Xmx1024m > JAVA_OPTS : -Xmx768m > JAVA_HOME : C:\Program Files\Java\jdk1.5.0_11 > > What other changes I need to make to run more Tomcat Instances from the same > Installation on each machine? > > For Example: > On Machine 1 : > On Machine 2 : > I want to run all these instances in a cluster. > > Your help will be highly appreciated. > > > Thanks > > Tauqir Akhtar > Are the two machines in the same subnet ? Is multicasting work ? What do you see in the logs ? Are there any memberships established ? Etc... - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org ## NOTICE: The contents of this e-mail and any attachments to it may contain privileged and confidential information from The Jones Group Inc. or its affiliates. This information is only for the viewing or use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of, or the taking of any action in reliance upon, the information contained in this e-mail, or any of the attachments to this e-mail, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this message and delete it from your system. ### - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[cluster] jvmRoute question
Hi, To take a tomcat instance out from a cluster, now I have a no-cluster.xml and in content it is exactly the same as the server.xml, except the tag is commented out. The question is should I also take out the jvmRoute="tc24x" variable from the tag or leave it there. My workers.properties file remain the same whether a tomcat instance is member of a cluster or not, so I incline to leave it there. On the other hand I did testing as this variable was removed and I have not experienced any problem. The hierarchy is Server > Service > Engine > Cluster Any good suggestion is highly appreciated. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Adding a webapp via the API to a running instance
Hi Benson, On 20.06.2011 17:51, Benson Margulies wrote: > Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, > String, String), I don't understand the following: > > // prevent it from looking ( if it finds one - it'll have dup error ) > ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); > > Why is this being used to prevent the code from seeing a web.xml in > the basedir/conf? I'd say it is not. Have a look at ourr test suite. It uses the jsp servlet without programmatically configuring. I'm pretty sure it comes from the global web.xml. The test suite also logs ... org.apache.catalina.startup.ContextConfig webConfig ... INFO: No global web.xml found but that doesn't keep it from executing JSPs. For instance TestAbstractHttp11Processor deploys test/webapp-3.0 and calls /echo-params.jsp. The basics are in TomcatBaseTest. So I'd say there's something wrong in your setup. HTH. Rainer > On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies > wrote: >> I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. >> >> After it is running, I'm trying to add another webapp with .addWebapp. >> >> The addWebapp call logs: >> >> 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO >> org.apache.catalina.util.LifecycleBase - The start() method was called >> on component [Realm[Simple]] after start() had already been called. >> The second call will be ignored. >> 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO >> org.apache.catalina.startup.ContextConfig - No global web.xml found >> >> This second message is odd, since there is a global web.xml sitting in >> the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. >> >> However, this is followed in quick succession by an NPE. In >> ContextConfig.java, jspServlet is null. Does it make sense that the >> problem is the failure to find the global web.xml, since it would >> define the jsp servlet? And, if so, why does this work for my first >> webpp (defined before 'start') and not for my second? >> >> java.lang.NullPointerException >>at >> org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) >>at >> org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) >>at >> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) >>at >> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) >>at >> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) >>at >> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) >>at >> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) >>at >> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) >>at >> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) >>at >> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) >>at >> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) >>at >> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) >>at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) >>at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) >>at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [cluster] jvmRoute question
On 20.06.2011 18:35, János Löbb wrote: > Hi, > > To take a tomcat instance out from a cluster, now I have a no-cluster.xml and > in content it is exactly the same as the server.xml, except the > > tag is commented out. > > The question is should I also take out the jvmRoute="tc24x" variable from > the tag or leave it there. My workers.properties file remain > the same whether a tomcat instance is member of a cluster or not, so I > incline to leave it there. On the other hand I did testing as this variable > was removed and I have not experienced any problem. > > The hierarchy is Server > Service > Engine > Cluster > > Any good suggestion is highly appreciated. All it does is adding the value of the jvmRoute attribute at the end of each session ID. Usually it is used by load balancers to implement stickyness, e.g. sending follow-on requests for the same session to the node on which the session was generated. If there's no load balancing involved in routing to theis node, then you won't need the jvmRoute - but it won't hurt either. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Adding a webapp via the API to a running instance
Hi, I set up a testcase at https://github.com/bimargulies/Tomcat-Solr-Test-Case. Note that this is NOT a 3.0 webapp. I read the code, and the failing path is in the if statement for 'pre-3.0'. Please have a look at the single Java class in there and tell me what is wrong, since it seems quite straightforward to me. On Mon, Jun 20, 2011 at 12:56 PM, Rainer Jung wrote: > Hi Benson, > > On 20.06.2011 17:51, Benson Margulies wrote: >> Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, >> String, String), I don't understand the following: >> >> // prevent it from looking ( if it finds one - it'll have dup error ) >> ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); >> >> Why is this being used to prevent the code from seeing a web.xml in >> the basedir/conf? > > I'd say it is not. > > Have a look at ourr test suite. It uses the jsp servlet without > programmatically configuring. I'm pretty sure it comes from the global > web.xml. The test suite also logs > > ... org.apache.catalina.startup.ContextConfig webConfig > ... INFO: No global web.xml found > > but that doesn't keep it from executing JSPs. > > For instance TestAbstractHttp11Processor deploys test/webapp-3.0 and > calls /echo-params.jsp. The basics are in TomcatBaseTest. > > So I'd say there's something wrong in your setup. > HTH. > > Rainer > >> On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies >> wrote: >>> I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. >>> >>> After it is running, I'm trying to add another webapp with .addWebapp. >>> >>> The addWebapp call logs: >>> >>> 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO >>> org.apache.catalina.util.LifecycleBase - The start() method was called >>> on component [Realm[Simple]] after start() had already been called. >>> The second call will be ignored. >>> 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO >>> org.apache.catalina.startup.ContextConfig - No global web.xml found >>> >>> This second message is odd, since there is a global web.xml sitting in >>> the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. >>> >>> However, this is followed in quick succession by an NPE. In >>> ContextConfig.java, jspServlet is null. Does it make sense that the >>> problem is the failure to find the global web.xml, since it would >>> define the jsp servlet? And, if so, why does this work for my first >>> webpp (defined before 'start') and not for my second? >>> >>> java.lang.NullPointerException >>> at >>> org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) >>> at >>> org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) >>> at >>> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) >>> at >>> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) >>> at >>> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) >>> at >>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) >>> at >>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) >>> at >>> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) >>> at >>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) >>> at >>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) >>> at >>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) >>> at >>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) > > - > 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: Adding a webapp via the API to a running instance
Ranier, I don't have a problem executing jsps. I have a problem configuring a webapp with entire servlets defined by jsps. My code works perfectly fine launching another webapp with jsps in it which are not declared in elements. --benson On Mon, Jun 20, 2011 at 12:56 PM, Rainer Jung wrote: > Hi Benson, > > On 20.06.2011 17:51, Benson Margulies wrote: >> Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, >> String, String), I don't understand the following: >> >> // prevent it from looking ( if it finds one - it'll have dup error ) >> ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); >> >> Why is this being used to prevent the code from seeing a web.xml in >> the basedir/conf? > > I'd say it is not. > > Have a look at ourr test suite. It uses the jsp servlet without > programmatically configuring. I'm pretty sure it comes from the global > web.xml. The test suite also logs > > ... org.apache.catalina.startup.ContextConfig webConfig > ... INFO: No global web.xml found > > but that doesn't keep it from executing JSPs. > > For instance TestAbstractHttp11Processor deploys test/webapp-3.0 and > calls /echo-params.jsp. The basics are in TomcatBaseTest. > > So I'd say there's something wrong in your setup. > HTH. > > Rainer > >> On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies >> wrote: >>> I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. >>> >>> After it is running, I'm trying to add another webapp with .addWebapp. >>> >>> The addWebapp call logs: >>> >>> 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO >>> org.apache.catalina.util.LifecycleBase - The start() method was called >>> on component [Realm[Simple]] after start() had already been called. >>> The second call will be ignored. >>> 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO >>> org.apache.catalina.startup.ContextConfig - No global web.xml found >>> >>> This second message is odd, since there is a global web.xml sitting in >>> the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. >>> >>> However, this is followed in quick succession by an NPE. In >>> ContextConfig.java, jspServlet is null. Does it make sense that the >>> problem is the failure to find the global web.xml, since it would >>> define the jsp servlet? And, if so, why does this work for my first >>> webpp (defined before 'start') and not for my second? >>> >>> java.lang.NullPointerException >>> at >>> org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) >>> at >>> org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) >>> at >>> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) >>> at >>> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) >>> at >>> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) >>> at >>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) >>> at >>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) >>> at >>> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) >>> at >>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) >>> at >>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) >>> at >>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) >>> at >>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) > > - > 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
Running an old servlet with Tomcat 7.0.16 embedded API
Ranier, I've now demonstrated that this is not about 'deferred launch' but rather about an old servlet failing to be configured with the embedded Tomcat class. https://github.com/bimargulies/Tomcat-Solr-Test-Case has been simplified. It makes the few required calls to set up the Tomcat object. Then it calls addWebapp for the solr webapp, and it failed with an NPE, due to the lack of the 'jsp' servlet from the usual global web.xml. The test cases you mentioned didn't bear on this case at all, I'll look for some others. --benson On Mon, Jun 20, 2011 at 12:56 PM, Rainer Jung wrote: > Hi Benson, > > On 20.06.2011 17:51, Benson Margulies wrote: >> Reading org.apache.catalina.startup.Tomcat.addWebapp(Host, String, >> String, String), I don't understand the following: >> >> // prevent it from looking ( if it finds one - it'll have dup error ) >> ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML"); >> >> Why is this being used to prevent the code from seeing a web.xml in >> the basedir/conf? > > I'd say it is not. > > Have a look at ourr test suite. It uses the jsp servlet without > programmatically configuring. I'm pretty sure it comes from the global > web.xml. The test suite also logs > > ... org.apache.catalina.startup.ContextConfig webConfig > ... INFO: No global web.xml found > > but that doesn't keep it from executing JSPs. > > For instance TestAbstractHttp11Processor deploys test/webapp-3.0 and > calls /echo-params.jsp. The basics are in TomcatBaseTest. > > So I'd say there's something wrong in your setup. > HTH. > > Rainer > >> On Mon, Jun 20, 2011 at 11:31 AM, Benson Margulies >> wrote: >>> I'm using import org.apache.catalina.startup.Tomcat to embed tomcat. >>> >>> After it is running, I'm trying to add another webapp with .addWebapp. >>> >>> The addWebapp call logs: >>> >>> 2011-06-20 11:23:23,385 ["http-bio-9167"-exec-2] INFO >>> org.apache.catalina.util.LifecycleBase - The start() method was called >>> on component [Realm[Simple]] after start() had already been called. >>> The second call will be ignored. >>> 2011-06-20 11:23:23,387 ["http-bio-9167"-exec-2] INFO >>> org.apache.catalina.startup.ContextConfig - No global web.xml found >>> >>> This second message is odd, since there is a global web.xml sitting in >>> the conf subdirectory of the pathname I passed to Tomcat.setBaseDir. >>> >>> However, this is followed in quick succession by an NPE. In >>> ContextConfig.java, jspServlet is null. Does it make sense that the >>> problem is the failure to find the global web.xml, since it would >>> define the jsp servlet? And, if so, why does this work for my first >>> webpp (defined before 'start') and not for my second? >>> >>> java.lang.NullPointerException >>> at >>> org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1360) >>> at >>> org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1339) >>> at >>> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330) >>> at >>> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881) >>> at >>> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316) >>> at >>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) >>> at >>> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) >>> at >>> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103) >>> at >>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) >>> at >>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) >>> at >>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) >>> at >>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483) >>> at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171) > > - > 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: Tomact 5.5 Clustering
Hi My Clustering Fails : SEVERE: Unable to send replicated message to member [org.apache.catalina.cluster.mcast.McastMember[t cp://172.28.9.109:4001,catalina,172.28.9.109,4001, alive=1813]], has only senders for [] Jun 20, 2011 1:52:57 PM org.apache.catalina.cluster.tcp.ReplicationTransmitter sendMessage server.xml for the Instance running on Machine 1 : Server.xml for the Instance running on Machine 2 : Any help would be highly appreciated. Thanks Tauqir Akhtar 212 801 8039 -Original Message- From: Tauqir Akhtar [mailto:takh...@jny.com] Sent: Monday, June 20, 2011 12:15 PM To: 'Tomcat Users List' Subject: RE: Tomact 5.5 Clustering Hi Cluster did start , but I am getting exception : INFO: membership mbean registered (Catalina:type=ClusterMembership,host=localhost) Jun 20, 2011 11:44:31 AM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Exception in thread "Cluster-MembershipReceiver" java.lang.OutOfMemoryError: Java heap space at org.apache.catalina.cluster.mcast.McastMember.getMember(McastMember.java:174) at org.apache.catalina.cluster.mcast.McastServiceImpl.receive(McastServiceImpl.java:242) at org.apache.catalina.cluster.mcast.McastServiceImpl$ReceiverThread.run(McastServiceImpl.ja va:330) Thanks Tauqir Akhtar 212 801 8039 -Original Message- From: János Löbb [mailto:janos.l...@yale.edu] Sent: Thursday, June 09, 2011 12:37 PM To: Tomcat Users List Subject: Re: Tomact 5.5 Clustering On Jun 9, 2011, at 10:30 AM, Tauqir Akhtar wrote: > Hi > > I am running two Tomcat (5.5.27) Instances on two different machines > deploying the same Java Application. > > I have made changes in server.xml to specify the Port on which Tomcat should > run on the two machines. > > On Machine 1 : > On Machine 2 : > Both the Instances are running fine. > > What other configuration changes (In which files) do I need to make to run > these two Tomcat Instances in one Cluster? > > I have following variables set in the machine environment: > > CATALINA_OPTS : -Xms512m -Xmx1024m > JAVA_OPTS : -Xmx768m > JAVA_HOME : C:\Program Files\Java\jdk1.5.0_11 > > What other changes I need to make to run more Tomcat Instances from the same > Installation on each machine? > > For Example: > On Machine 1 : > On Machine 2 : > I want to run all these instances in a cluster. > > Your help will be highly appreciated. > > > Thanks > > Tauqir Akhtar > Are the two machines in the same subnet ? Is multicasting work ? What do you see in the logs ? Are there any memberships established ? Etc... - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org ## NOTICE: The contents of this e-mail and any attachments to it may contain privileged and confidential information from The Jones Group Inc. or its affiliates. This information is only for the viewing or use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of, or the taking of any action in reliance upon, the information contained in this e-mail, or any of the attachments to this e-mail, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this message and delete it from your system. ### - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org ## NOTICE: The contents of this e-mail and any attachments to it may contain privileged and confidential information from The Jones Group Inc. or its affiliates. This information is only for the viewing or use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of, or the taking of any action in reliance upon, the information contained in this e-mail, or any of the attachments to this e-ma
Slower start with Tomcat 7.0.14 and higher
Start up takes around 20 seconds longer with Tomcat 7.0.14 and 7.0.16 than it did with 7.0.12. This appears to be due to time spent scanning jars for annotations, etc. We have a number of /very /large jar files in both the base classloader for Tomcat (which we're embedding) and in our web apps. This raises 2 questions: 1. Was jar scanning not working for such uses cases in 7.0.12, e.g. was the scanning incomplete? 2. Did something change to make the performance of the scanning perform much worse in 7.0.14 /and /7.0.16 than in 7.0.12? * The release notes suggest that 7.0.14 had an issue and that it was resolved in 7.0.16, but we're seeing both 7.0.14 and 7.0.16 being approximately equally slow to start up. Clearly the answer to both questions could be "yes". If only #2 is a "yes", then I'd really like to get this resolved and get back to the previous performance. If, however, #1 explains much of the degradation, then I'll need to look into excluding jars from scanning, etc. -- Jess Holle
Re: Slower start with Tomcat 7.0.14 and higher
On 20/06/2011 20:12, Jess Holle wrote: > Start up takes around 20 seconds longer with Tomcat 7.0.14 and 7.0.16 > than it did with 7.0.12. > > This appears to be due to time spent scanning jars for annotations, > etc. We have a number of /very /large jar files in both the base > classloader for Tomcat (which we're embedding) and in our web apps. > > This raises 2 questions: > > 1. Was jar scanning not working for such uses cases in 7.0.12, e.g. > was the scanning incomplete? Not that I am aware of. > 2. Did something change to make the performance of the scanning > perform much worse in 7.0.14 /and /7.0.16 than in 7.0.12? It should have improved for the majority of use cases in 7.0.14 but at the price of making it worse for JARs in CATALINA_[HOME_BASE]/lib. 7.0.16 should have returned scanning of JARs in CATALINA_[HOME_BASE]/lib to the pre 7.0.14 performance levels. > * The release notes suggest that 7.0.14 had an issue and that >it was resolved in 7.0.16, but we're seeing both 7.0.14 and >7.0.16 being approximately equally slow to start up. > > Clearly the answer to both questions could be "yes". If only #2 is a > "yes", then I'd really like to get this resolved and get back to the > previous performance. If, however, #1 explains much of the degradation, > then I'll need to look into excluding jars from scanning, etc. It looks like there may still be an issue. Profiling data on where the time is being spent would be useful. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
On 6/20/2011 2:16 PM, Mark Thomas wrote: It should have improved for the majority of use cases in 7.0.14 but at the price of making it worse for JARs in CATALINA_[HOME_BASE]/lib. 7.0.16 should have returned scanning of JARs in CATALINA_[HOME_BASE]/lib to the pre 7.0.14 performance levels. We're embedding Tomcat in a larger server process and the base classloader includes a lot more than CATALINA_BASE/lib. Some of these jars are huge -- and the intent (and effect) is that these are shared by any/all web app instances. My initial guess is that the 7.0.16 fix may have overlooked this possibility and be special-cased for jars in CATALINA_BASE/lib vs. applying to any jar coming from the base classloader and a file: (vs. HTTP or JNDI) URL. It looks like there may still be an issue. Profiling data on where the time is being spent would be useful. I should be able to drum up such a profile here in a bit... -- Jess Holle
Tomcat6/7 virtual hosting - yet again
This is my 4th day trying to setup virtual hosting on Linux-Debian; even trying Tomcat6 after failing on Tomcat7. Yes I have read everything that I can find in Tomcat documentation - including the obtuse: http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html what I found on this forum for March: http://mail-archives.apache.org/mod_mbox/tomcat-users/ as well as all as many, many well intended explanations located on the Web. Please acknowledge my stupidity, but help anyway. This is long indeed. On purpose. I believe we need a detailed description how to do it correct. Note, I do NOT use WAR-file deployment. [It is not clear to me whether that is relevant ...] I test using a windows XP box which allows to create a bogus domain in the file: C:\WINDOWS\system32\drivers\etc\hosts It has the line: 206.41.127.116 www.testzzz.com Using a browser (on that box) to access that bogus domain www.testzzz.com "works" but gives an unexpected response: Index of / [ICO] Name Last modified Size Description Apache/2.2.9 (Debian) Server at www.testzzz.com Port 80 The site, apparently, was able to get to the right place, but ... I expected to access an index.html file under a ROOT directory, see below. Here the testzzz directory structure: /home/ddc/test /home/ddc/test/ROOT /home/ddc/test/host-manager /home/ddc/test/manager /home/ddc/test/ROOT/index.html /home/ddc/test/ROOT/WEB-INF /home/ddc/test/ROOT/WEB-INF/web.xml No, there are no errors in catalina.out. That log does have a line showing that ROOT.xml is activated: INFO: Deploying configuration descriptor ROOT.xml I do NOT see deployment of www.testzzz.com. Under webapps/ I see auto generated directories for: ROOT, docs, examples, host-manager, manager In logs, I see empty logs for: manager host-manager localhost testzzz access log I expected that the testzzz log would grow. Here is what I have in server.xml (pruned): Under .../Catalina: www.testzzz.com www.testzzz.com/ROOT.xml www.testzzz.com/manager.xml www.testzzz.com/host-manager.xml Inside ROOT.xml: Now what? And what would be the layout for a 2nd virtual host? THANKS ... Home page: rs6.risingnet.net/~ddcc Health Info Anytime for Everyone: www.HealthCheck4Me.info Exercise for the Mind: www.SuDoKuChallenge.us Marketing site: www.OntoOO.com >> Do NOT buy Dell, Mac, Ford, Chrysler << >> Boycott Chinese Products <<
Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7
On Wed, 15 Jun 2011, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jocelyn, On 6/15/2011 1:43 PM, Jocelyn Ireson-Paine wrote: ResponseHolder rh = (ResponseHolder)this_session.getAttribute( "response_holder" ); Here is the beginning of your errors. By saving a reference to the response that was used for your first page access, you have set yourself up for errors for future responses, and not just in the JSP at hand: you could potentially cause errors in the responses of other requests down the line that re-use the response object. That may sound entirely insane, and it kind of is, unless you understand that Tomcat, in order to manage the application's heap more efficiently, re-uses both HttpServletRequest and HttpServletResponse objects. ... Christopher, and also Konstantin and Martin, thank you for your postings on this. As it happened, my original code that crashed, and from which I derived the demo code that I posted, had a bug. I do put a reference to the response into an instance, in order that I can give my main processing method all the data it needs (including the response) as one single parameter. But I'd intended to put the response into this instance every time my JSP is accessed, and not merely the first time. Until you pointed it out, I didn't notice that I wasn't, even with my simplified code. So thanks for that. That said, I think I was expecting that it wouldn't matter, since the response "ought" to be the same instance on each processing cycle anyway. It's interesting to see why Tomcat violates the principle of least surprise - and I see it's still being discussed... Jocelyn - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat6/7 virtual hosting - yet again
On Mon, Jun 20, 2011 at 12:58 PM, Dennis de Champeaux wrote: > This is my 4th day trying to setup virtual hosting on Linux-Debian; > Yes I have read everything that I can find in Tomcat documentation - > Using a browser (on that box) to access that bogus domain > www.testzzz.com "works" but gives an unexpected response: > Apache/2.2.9 (Debian) Server at www.testzzz.com Port 80 Uh, "unexpected" because that's obviously not a Tomcat server at all that you're accessing, or something else? :-) -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
On 20.06.2011 21:41, Jess Holle wrote: > On 6/20/2011 2:16 PM, Mark Thomas wrote: >> It should have improved for the majority of use cases in 7.0.14 but at >> the price of making it worse for JARs in CATALINA_[HOME_BASE]/lib. >> 7.0.16 should have returned scanning of JARs in CATALINA_[HOME_BASE]/lib >> to the pre 7.0.14 performance levels. > We're embedding Tomcat in a larger server process and the base > classloader includes a lot more than CATALINA_BASE/lib. Some of these > jars are huge -- and the intent (and effect) is that these are shared by > any/all web app instances. > > My initial guess is that the 7.0.16 fix may have overlooked this > possibility and be special-cased for jars in CATALINA_BASE/lib vs. > applying to any jar coming from the base classloader and a file: (vs. > HTTP or JNDI) URL. >> It looks like there may still be an issue. Profiling data on where the >> time is being spent would be useful. > I should be able to drum up such a profile here in a bit... Sure we want to make scaning as fast as possible. But did you realize, that you can exclude Jars from being scanned? There's a list f exclusions defined in catalina.properties. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
On 6/20/2011 2:41 PM, Jess Holle wrote: On 6/20/2011 2:16 PM, Mark Thomas wrote: It should have improved for the majority of use cases in 7.0.14 but at the price of making it worse for JARs in CATALINA_[HOME_BASE]/lib. 7.0.16 should have returned scanning of JARs in CATALINA_[HOME_BASE]/lib to the pre 7.0.14 performance levels. We're embedding Tomcat in a larger server process and the base classloader includes a lot more than CATALINA_BASE/lib. Some of these jars are huge -- and the intent (and effect) is that these are shared by any/all web app instances. My initial guess is that the 7.0.16 fix may have overlooked this possibility and be special-cased for jars in CATALINA_BASE/lib vs. applying to any jar coming from the base classloader and a file: (vs. HTTP or JNDI) URL. It looks like there may still be an issue. Profiling data on where the time is being spent would be useful. I should be able to drum up such a profile here in a bit... There's a lot more data in the profile than I really want to post/share, but with heavy/frequent (20ms) VisualVM sampling profiler overhead, I see that ~31 seconds are spent on ContextConfig.webConfig() -- mostly in ContextConfig.processAnnotations(), etc. I also see ~8 seconds spent on TldConfig.execute(). The numbers are clearly inflated from the original metrics due to the crude sampling approach, but the overhead is clearly in these areas. -- Jess Holle
Re: Slower start with Tomcat 7.0.14 and higher
On 6/20/2011 3:16 PM, Rainer Jung wrote: Sure we want to make scaning as fast as possible. But did you realize, that you can exclude Jars from being scanned? There's a list f exclusions defined in catalina.properties. Yes -- and I'll go there is the speed from 7.0.12 (which was quite reasonable despite scanning all our jars) cannot be re-attained. I might go there anyway for *some* of our jars, but I will likely want to start doing more via annotations and less via web.xml as well -- and would like to minimize the startup performance penalty entailed in doing so. -- Jess Holle - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat6/7 virtual hosting - yet again
TX, for the quick response: >Uh, "unexpected" because that's obviously not a Tomcat server at all >that you're accessing, or something else? :-) And what would be the fix ? Home page: rs6.risingnet.net/~ddcc Health Info Anytime for Everyone: www.HealthCheck4Me.info Exercise for the Mind: www.SuDoKuChallenge.us Marketing site: www.OntoOO.com >> Do NOT buy Dell, Mac, Ford, Chrysler << >> Boycott Chinese Products << --- On Mon, 6/20/11, Hassan Schroeder wrote: From: Hassan Schroeder Subject: Re: Tomcat6/7 virtual hosting - yet again To: "Tomcat Users List" Date: Monday, June 20, 2011, 1:13 PM On Mon, Jun 20, 2011 at 12:58 PM, Dennis de Champeaux wrote: > This is my 4th day trying to setup virtual hosting on Linux-Debian; > Yes I have read everything that I can find in Tomcat documentation - > Using a browser (on that box) to access that bogus domain > www.testzzz.com "works" but gives an unexpected response: >Apache/2.2.9 (Debian) Server at www.testzzz.com Port 80 Uh, "unexpected" because that's obviously not a Tomcat server at all that you're accessing, or something else? :-) -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
when sending status 304 last-modified header is missing using mod_jk
Hi, When I send a 304 response status, i send also the lastmodified header. It shows on tomcat directly via 8080. But via mod_jk/apache http server it's missing... Is this correct behaviour or some bug? Example url: http://www.rsscockpit.com/sitemap.do?action=subject&subjectid=52&language=nl Configuration: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_jk/1.2.28 Tomcat 6.0.29 Regards, Edwin Eversdijk - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat6/7 virtual hosting - yet again
Let add that Tomcat was responding on port 8080 with out of the box server.xml. Home page: rs6.risingnet.net/~ddcc Health Info Anytime for Everyone: www.HealthCheck4Me.info Exercise for the Mind: www.SuDoKuChallenge.us Marketing site: www.OntoOO.com >> Do NOT buy Dell, Mac, Ford, Chrysler << >> Boycott Chinese Products << --- On Mon, 6/20/11, Hassan Schroeder wrote: From: Hassan Schroeder Subject: Re: Tomcat6/7 virtual hosting - yet again To: "Tomcat Users List" Date: Monday, June 20, 2011, 1:13 PM On Mon, Jun 20, 2011 at 12:58 PM, Dennis de Champeaux wrote: > This is my 4th day trying to setup virtual hosting on Linux-Debian; > Yes I have read everything that I can find in Tomcat documentation - > Using a browser (on that box) to access that bogus domain > www.testzzz.com "works" but gives an unexpected response: >Apache/2.2.9 (Debian) Server at www.testzzz.com Port 80 Uh, "unexpected" because that's obviously not a Tomcat server at all that you're accessing, or something else? :-) -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat6/7 virtual hosting - yet again
> From: Dennis de Champeaux [mailto:atlantisic...@yahoo.com] > Subject: Re: Tomcat6/7 virtual hosting - yet again > Let add that Tomcat was responding on port 8080 with out > of the box server.xml. As expected. What makes you think it will magically respond on port 80? (Especially since you have httpd listening on port 80.) - 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: Tomcat6/7 virtual hosting - yet again
On Mon, Jun 20, 2011 at 2:07 PM, Dennis de Champeaux wrote: > Let add that Tomcat was responding on port 8080 with out of the box > server.xml. So you pretty obviously need to continue to use port 8080, eh? e.g. http://www.testzzz.com:8080/ or turn off the Apache httpd running on port 80 and change your TC connector configuration -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Setting SSL for login pages
So guy, I want the user to be redirected to HTTPS once he hits an authenticated page. So I think it would be natural something like this: SSL login /login/* CONFIDENTIAL FORM MyRealm /login/login.jsp /login/error.jsp The problem is the FormAuthenticator Valve uses a forward, so the URL used is the one of the target page, not the login page. That means that the /login/login.jsp URL is never requested and the security constraint is never applied. The same way an Apache HTTPD proxy can't know whether the request resulted in a login page or not. As I see, the way it is, all authenticated pages must be set to CONFIDENTIAL also (in case the user is not authenticated and ends up in the login page). But if the user IS authenticated he is forced to use HTTPS too, and that I was trying to avoid. Am I missing something? -- Rafael Liu +55 61 9608-7722 http://rafaelliu.net
Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jocelyn, On 6/20/2011 4:11 PM, Jocelyn Ireson-Paine wrote: > I do put a reference to > the response into an instance, in order that I can give my main > processing method all the data it needs (including the response) as one > single parameter. But I'd intended to put the response into this > instance every time my JSP is accessed, and not merely the first time. > Until you pointed it out, I didn't notice that I wasn't, even with my > simplified code. So thanks for that. No problem. If you need all your data from scratch, anyway, why bother caching anything at all? If your data is always ephemeral, these issues evaporate and your code (often) becomes cleaner, too. > That said, I think I was expecting that it wouldn't matter, since the > response "ought" to be the same instance on each processing cycle > anyway. I would actually expect something different: that Tomcat always gives me a brand new, never-before-used and never-to-be-used-again object. The fact that Tomcat plays some tricks to reduce heap churn (that is, allocating/initing/deallocating lots of "temporary" objects) should be entirely transparent to the webapp if it's playing by the rules. The servlet spec clearly states that the request and response objects are only valid during a particular transaction. > It's interesting to see why Tomcat violates the principle of > least surprise - and I see it's still being discussed... Ignorance of the spec will certainly cause a lot of "surprises" :) I'm not convinced that this should be surprising, anyway. If I write a method like this: public void foo(Bar bar) { ... } Why should the method foo() expect that each invocation will always have the same Bar object passed-into it? By extension: public void doGet(HttpServletRequest req, HttpServletResponse rsp) { ... } Should this one be treated any differently? If the object is always going to be the same, why bother having it as a parameter instead of part of the object's state? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3/u7gACgkQ9CaO5/Lv0PBNzwCfY0SpILBVc49KPQn1gpjgVl2P 8YIAmwaX5CPtfQVdeicXoFW3j1B9tfwo =FL9q -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jess, On 6/20/2011 3:41 PM, Jess Holle wrote: > On 6/20/2011 2:16 PM, Mark Thomas wrote: >> It should have improved for the majority of use cases in 7.0.14 but at >> the price of making it worse for JARs in CATALINA_[HOME_BASE]/lib. >> 7.0.16 should have returned scanning of JARs in CATALINA_[HOME_BASE]/lib >> to the pre 7.0.14 performance levels. > > We're embedding Tomcat in a larger server process and the base > classloader includes a lot more than CATALINA_BASE/lib. Some of these > jars are huge -- and the intent (and effect) is that these are shared by > any/all web app instances. Couldn't you place the libraries in question at a level /higher/ than Tomcat's base ClassLoader? Or, do you need some of those libraries to be scanned for annotations but not all. Maybe you could move /some/ of them? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3/vR8ACgkQ9CaO5/Lv0PCeKgCfbB795HYTMgkBneId0vXMt0cx ohMAoLU9qbtny5RUTbejsX5LcO2ddnm2 =y23R -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
On 6/20/2011 4:35 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jess, On 6/20/2011 3:41 PM, Jess Holle wrote: On 6/20/2011 2:16 PM, Mark Thomas wrote: It should have improved for the majority of use cases in 7.0.14 but at the price of making it worse for JARs in CATALINA_[HOME_BASE]/lib. 7.0.16 should have returned scanning of JARs in CATALINA_[HOME_BASE]/lib to the pre 7.0.14 performance levels. We're embedding Tomcat in a larger server process and the base classloader includes a lot more than CATALINA_BASE/lib. Some of these jars are huge -- and the intent (and effect) is that these are shared by any/all web app instances. Couldn't you place the libraries in question at a level /higher/ than Tomcat's base ClassLoader? Or, do you need some of those libraries to be scanned for annotations but not all. Maybe you could move /some/ of them? The libraries in question are actually loaded by the application classloader -- as is Tomcat's Bootstrap class. And, yes, eventually I'll want to scan some of these jars for annotations -- but not all unless this is really fast/cheap. -- Jess Holle - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Setting SSL for login pages
> From: Rafael Liu [mailto:rafael...@gmail.com] > Subject: Setting SSL for login pages > I think it would be natural something like this: > > > SSL login > /login/* > > > CONFIDENTIAL > > The login pages are usually not specified in the ; only the pages to be protected. Login pages are not normally directly accessed by a user, but are only presented when the user attempts to access a protected page. > As I see, the way it is, all authenticated pages must be set > to CONFIDENTIAL also Not also, instead. > But if the user IS authenticated he is forced to use HTTPS > too, and that I was trying to avoid. Think about it: if the secure traffic is only for the login page, anyone could access the not-really-protected pages by sniffing the sessionid used on the unsecure connection - you would have no security. - 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: when sending status 304 last-modified header is missing using mod_jk
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Edwin, On 6/20/2011 5:01 PM, Edwin Eversdijk wrote: > When I send a 304 response status, i send also the lastmodified header. It > shows > on tomcat directly via 8080. But via mod_jk/apache http server it's > missing... I see the same behavior with this simple JSP in Tomcat 6.0.32: <% response.setHeader("Last-Modified", "Tue, 15 Nov 1994 12:45:26 GMT"); response.setHeader("X-Test-Header", "12345"); response.setHeader("Connection", "close"); response.setHeader("Content-Location", "http://www.google.com/";); response.setHeader("Vary", "Content-Length"); response.setHeader("Expires", "Tue, 21 Jun 2011 12:00:00 GMT"); response.setHeader("Cache-Control", "foo"); response.setStatus(304); %> Neither Last-Modified nor X-Test-Header come back to my browser, though I was able to set the Connection, Content-Location, Vary, and Expires headers. > Is this correct behaviour or some bug? Looks like httpd is following the spec while Tomcat is not: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 Specifically: " If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers. " Read that very carefully: basically, no entity-headers other than those explicitly mentioned in that section (Date, ETag, Content-Location, Expires, Cache-Control, Vary) "RFC SHOULD" be returned under any circumstances, and, in most circumstances entity-headers other than those "RFC MUST NOT" be sent. If anything, I'd say that Tomcat was out-of-spec by allowing those additional headers to get through. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3/wzYACgkQ9CaO5/Lv0PAcYQCeLU9gxEZ00UHfvejHS9LSe3F1 PIIAoLLhBZCIAAwsbYuFlfPMM1Er0CnZ =im/i -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jess, On 6/20/2011 5:47 PM, Jess Holle wrote: > On 6/20/2011 4:35 PM, Christopher Schultz wrote: >> >> Maybe you could move /some/ of them? > > The libraries in question are actually loaded by the application > classloader -- as is Tomcat's Bootstrap class. Application being that which embeds Tomcat, or the webapp(s) eventually deployed by Tomcat? ;) > And, yes, eventually I'll want to scan some of these jars for > annotations -- but not all unless this is really fast/cheap. Understood. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk3/xD4ACgkQ9CaO5/Lv0PBtRgCeKEYB7FTVUwmYdLAB/vdmx4zk JpQAn3PeX7nefRt6jMxjZrke5BdoFskW =NpC7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Setting SSL for login pages
Good point Chuck. I agree with you, the webapp wouldn't be all secured. But there are 2 different things here: * the issue with the plain password * the issue with session hijacking The first one first gives the hacker a private information about the user (which can even the used by the user somewhere else). The hacker will have the actual user's credentials, and will be able to login at will. The second one doesn't necessarily exposes user's informations. The hacker can pretend to be the user, but only for the time of the session. Even tho there are tricks to keep the session alive [almos] forever, this is essentially different from having the user's credential. I see them at different levels of security. Using the same logic, one can say that there's no point in using DIGEST authentication if there's still room for session hijacking. Much like BASIC / DIGEST or CONFIDENTIAL / INTEGRAL provides different levels of security, I think the two cases mentioned also do.Giving these kind of options to the webapp can make NFR (like performance) easier to meet and infrastructure easier to configure (like rewriting on Apache). What do you think? On Jun 20, 2011 6:50 PM, "Caldarale, Charles R" wrote: >> From: Rafael Liu [mailto:rafael...@gmail.com] >> Subject: Setting SSL for login pages > >> I think it would be natural something like this: > >> >> >> SSL login >> /login/* >> >> >> CONFIDENTIAL >> >> > > The login pages are usually not specified in the ; only the pages to be protected. Login pages are not normally directly accessed by a user, but are only presented when the user attempts to access a protected page. > >> As I see, the way it is, all authenticated pages must be set >> to CONFIDENTIAL also > > Not also, instead. > >> But if the user IS authenticated he is forced to use HTTPS >> too, and that I was trying to avoid. > > Think about it: if the secure traffic is only for the login page, anyone could access the not-really-protected pages by sniffing the sessionid used on the unsecure connection - you would have no security. > > - 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: Tomcat6/7 virtual hosting - yet again
- Original Message - > From: Dennis de Champeaux > To: users@tomcat.apache.org > Cc: dennis > Sent: Monday, June 20, 2011 12:58 PM > Subject: Tomcat6/7 virtual hosting - yet again > >T his is my 4th day trying to setup virtual hosting on Linux-Debian; > even trying Tomcat6 after failing on Tomcat7. > > Yes I have read everything that I can find in Tomcat documentation - > including the obtuse: > http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html > what I found on this forum for March: > http://mail-archives.apache.org/mod_mbox/tomcat-users/ > as well as all as many, many well intended explanations located on the > Web. Please acknowledge my stupidity, but help anyway. > > This is long indeed. On purpose. I believe we need a detailed > description how to do it correct. Note, I do NOT use WAR-file > deployment. [It is not clear to me whether that is relevant ...] > > > I test using a windows XP box which allows to create a bogus domain in > the file: > C:\WINDOWS\system32\drivers\etc\hosts > It has the line: > 206.41.127.116 www.testzzz.com > > Using a browser (on that box) to access that bogus domain > www.testzzz.com "works" but gives an unexpected response: > Index of / > [ICO] Name Last modified Size Description > Apache/2.2.9 (Debian) Server at www.testzzz.com Port 80 > The site, apparently, was able to get to the right place, but ... > I expected to access an index.html file under a ROOT directory, see > below. > > > Here the testzzz directory structure: > /home/ddc/test > /home/ddc/test/ROOT > /home/ddc/test/host-manager > /home/ddc/test/manager > /home/ddc/test/ROOT/index.html > /home/ddc/test/ROOT/WEB-INF > /home/ddc/test/ROOT/WEB-INF/web.xml > > > No, there are no errors in catalina.out. > > That log does have a line showing that ROOT.xml is activated: > INFO: Deploying configuration descriptor ROOT.xml > > I do NOT see deployment of www.testzzz.com. > > Under webapps/ I see auto generated directories for: > ROOT, docs, examples, host-manager, manager > > In logs, I see empty logs for: > manager > host-manager > localhost > testzzz access log > I expected that the testzzz log would grow. > > > Here is what I have in server.xml (pruned): > defaultHost="www.testzzz.com"> > appBase="/home/ddc/test" > unpackWARs="true" autoDeploy="true" > xmlValidation="false" > xmlNamespaceAware="false"> > > > Under .../Catalina: > www.testzzz.com > www.testzzz.com/ROOT.xml > www.testzzz.com/manager.xml > www.testzzz.com/host-manager.xml > > Inside ROOT.xml: > > crossContext="false"> > > > > Now what? > And what would be the layout for a 2nd virtual host? Here's a reasonably detailed description for the Tomcat part (using Tomcat 6.0.26 on Fedora and Windows). http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts I've not written up how to map this to Apache HTTPD virtual hosts, but basically that should just be placing the right JkMount directives in the correct Apache HTTPD virtual hosts. As other people have pointed out, if you want to access your web sites on port 80, you'll either have to use something like mod_jk, mod_proxy_ajp, or mod_proxy_http with Apache HTTPD. Or you can shut down your Apache web server and change Tomcat to run on port 80. Hope that helps. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Slower start with Tomcat 7.0.14 and higher
On 6/20/2011 5:05 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jess, On 6/20/2011 5:47 PM, Jess Holle wrote: On 6/20/2011 4:35 PM, Christopher Schultz wrote: Maybe you could move /some/ of them? The libraries in question are actually loaded by the application classloader -- as is Tomcat's Bootstrap class. Application being that which embeds Tomcat, or the webapp(s) eventually deployed by Tomcat? ;) The embedding application, i.e. the system classloader. -- Jess Holle - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org