Tomcat: forwarding error.

User b8eed45673

02-11-2006 15:41:52

I made simply search page:





Code:



<%@page import=


"chemaxon.util.ConnectionHandler,


chemaxon.jchem.db.*,


chemaxon.jchem.db.JChemSearch"


%>





<jsp:useBean id="connect1" class="ConnectToDb" scope="session" />


<jsp:useBean id="query1" class="QueryData" scope="session" />





<%


String mol = "CCNCC";





JChemSearch searcher = new JChemSearch();


searcher.setQueryStructure(mol);


searcher.setConnectionHandler(connect1.getConnectionHandler());


searcher.setStructureTable("base");


searcher.setWaitingForResult(true);


searcher.setSearchType(query1.getSearchFlag());


searcher.setDissimilarityThreshold(query1.getDissimilarityThreshold());


searcher.setMaxTime(query1.getMaxTime());


searcher.setMaxResultCount(query1.getMaxResultCount());





searcher.setFilterQuery(query1.getFilterQuery());


searcher.run();








session.setAttribute("searcher",searcher);


%>


<jsp:forward page="index.jsp?r=result"/>








I got some error messages:





02.11.2006 17:22:02 org.apache.catalina.core.StandardWrapperValve invoke


SEVERE: Servlet.service() for servlet jsp threw exception


java.lang.IllegalStateException: Cannot forward after response has been committed


at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:314)


at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)


at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:691)


at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:658)


at org.apache.jsp.nof.search_jsp._jspService(org.apache.jsp.nof.search_jsp:107)


at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)


at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)


at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)


at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)


at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:673)


at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)


at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:500)


at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)


at org.apache.jsp.nof.index_jsp._jspService(org.apache.jsp.nof.index_jsp:496)


at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)


at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)


at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)


at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)


at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)


at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)


at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)


at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)


at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)


at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)


at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)


at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)


at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)


at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)


at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)


at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)


at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)


at java.lang.Thread.run(Unknown Sourcei)






Can anybody tell me what i do wrong?





P.S. Using Tomcat 5.5.7; JChem 3.1.6

ChemAxon 9c0afc9aaf

03-11-2006 12:01:29

Hi,





The problem does not seem to be JChem-specific.


It may be worth to remove ChemAxon classes (but leave in your beans).


Most likely the error will persist.





We are primarily not Tomcat experts, so maybe it's also worth to ask on their forum too or try Google.





In fact I did some research on Google, but did not find a definite answer.





The most common suggestion is that the page buffer gets full before the forwarding. You do not produce a lot of HTML output, so it can only occur if you have set it to 0 size.





The other thing worth to mention is that it can be a secondary result of some other problem. In one case the user had problem in some of the taglibs, and that surfaced like this.





Best regards,





Szilard