0

I have been asked to take over the hosting of a Java webapp, i have never used Java before and i was informed Tomcat was the way to go, so i have a windows server with Tomcat 6 on, i have uploaded the website and created the virtual hosting and the website appeared to work fine for me, then i get a call and there is an issue with the language verification on editlead.jsp and adding -xverify:none` to the boot of tomcat resolved that,

now today the server had crashed, i couldn't restart the service i had to task manager the old service and start it up again, after this happening twice the server stopped crashing, even trying to replicate what they might have done in the office to see if i could cause it to crash but no.

i have tried reading the logs and it baffles me, so i have pasted them below if anyone can help.

2015-08-04 11:29:15 Commons Daemon procrun stderr initialized   
Aug 04, 2015 11:29:16 AM org.apache.catalina.core.AprLifecycleListener init 
INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1. 
Aug 04, 2015 11:29:16 AM org.apache.catalina.core.AprLifecycleListener init 
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].    
Aug 04, 2015 11:29:16 AM org.apache.tomcat.util.digester.SetPropertiesRule begin    
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.  
Aug 04, 2015 11:29:17 AM org.apache.catalina.core.AprLifecycleListener initializeSSL    
INFO: OpenSSL successfully initialized with version OpenSSL 1.0.1m 19 Mar 2015  
Aug 04, 2015 11:29:17 AM org.apache.coyote.http11.Http11AprProtocol init    
INFO: Initializing Coyote HTTP/1.1 on http-80   
Aug 04, 2015 11:29:17 AM org.apache.coyote.ajp.AjpAprProtocol init  
INFO: Initializing Coyote AJP/1.3 on ajp-8009   
Aug 04, 2015 11:29:17 AM org.apache.catalina.startup.Catalina load  
INFO: Initialization processed in 2007 ms   
Aug 04, 2015 11:29:17 AM org.apache.catalina.core.StandardService start 
INFO: Starting service Catalina 
Aug 04, 2015 11:29:17 AM org.apache.catalina.core.StandardEngine start  
INFO: Starting Servlet Engine: Apache Tomcat/6.0.44 
Aug 04, 2015 11:29:17 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor CMD.xml    
Aug 04, 2015 11:29:19 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor host-manager.xml   
Aug 04, 2015 11:29:19 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor manager.xml    
Aug 04, 2015 11:29:20 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor ROOT.xml   
Aug 04, 2015 11:29:20 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory BIN   
Aug 04, 2015 11:29:20 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory docs  
Aug 04, 2015 11:29:20 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory examples  
Aug 04, 2015 11:29:22 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor CMD.xml    
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor host-manager.xml   
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.HostConfig deployDescriptor    
INFO: Deploying configuration descriptor manager.xml    
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.HostConfig deployDescriptor    
WARNING: A docBase C:\Tomcat 6.0\webapps\manager inside the host appBase has been specified, and will be ignored    
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory BIN   
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory docs  
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.HostConfig deployDirectory 
INFO: Deploying web application directory examples  
Aug 04, 2015 11:29:23 AM org.apache.catalina.core.ApplicationContext log    
INFO: ContextListener: contextInitialized() 
Aug 04, 2015 11:29:23 AM org.apache.catalina.core.ApplicationContext log    
INFO: SessionListener: contextInitialized() 
Aug 04, 2015 11:29:23 AM org.apache.coyote.http11.Http11AprProtocol start   
INFO: Starting Coyote HTTP/1.1 on http-80   
Aug 04, 2015 11:29:23 AM org.apache.coyote.ajp.AjpAprProtocol start 
INFO: Starting Coyote AJP/1.3 on ajp-8009   
Aug 04, 2015 11:29:23 AM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 6129 ms 
Aug 04, 2015 11:29:58 AM org.apache.catalina.core.StandardWrapperValve invoke   
SEVERE: Servlet.service() for servlet LeadHandlerServlet threw exception    
java.lang.IllegalStateException: Cannot forward after response has been committed   
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:312)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at LeadHandlerServlet.doPost(LeadHandlerServlet.java:338)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1778)
at java.lang.Thread.run(Unknown Source)
f_puras
  • 2,521
  • 4
  • 33
  • 38
  • `java.lang.IllegalStateException: Cannot forward after response has been committed` you wrote something to the ouput (could be a header, could be text/html) before trying to forward to a different jsp/servlet – developerwjk Aug 04 '15 at 20:05
  • This is just a bug in the web application's code. Tell the responsible web developer to carefully read the answer to http://stackoverflow.com/questions/2123514/java-lang-illegalstateexception-cannot-forward-after-response-has-been-committe and fix the code accordingly. This all is at least beyond Tomcat's and serveradmin's responsibility. None of your business thus. – BalusC Aug 04 '15 at 20:14
  • I would have to second BalusC - if you're a serveradmin and not a Java developer, the onus shouldn't be on you to pick through someone's buggy code (even though a PHB might be making this your problem anyway). – jtiscione Aug 05 '15 at 14:20

1 Answers1

0

It's hard to tell what's going on here without seeing what's going on in LeadHandlerServlet. I'm guessing you've got something like this in doPost() around line 338:

RequestDispatcher appDispatcher = getServletContext().getRequestDispatcher(someURL); appDispatcher.forward(request,response);

I can't see the code. But this might be a second call to forward(). If it is, it's going to blow a gasket. In general you need to keep your grubby little hands off the response after calling forward(). Usually people stick a return statement immediately after invoking it, and let subsequent incoming threads handle whatever logic might be underneath.

jtiscione
  • 1,131
  • 8
  • 13