servlet porting problem [urgent]


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: servlet porting problem [urgent]

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Posts
    4

    servlet porting problem [urgent]

    I had a problem with a web app.. I had a servlet to manage files on the server.. with a jsp calling it with proper parameters.. but I get a server error.. 500

    the files are simple xml files that i use as simple database system, so i must create, read and write them. They are in databases/dbdir/dbfile.xml

    it works on tomcat for Windows but give errors when I copy the app to my tomcat linux...

    any idea?

    web message:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception
    java.lang.IllegalStateException
    org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWra pperInclude.java:62)
    org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
    org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9


    and now catalina.log:

    ov 18, 2005 3:01:24 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Nov 18, 2005 3:01:24 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 752 ms
    Nov 18, 2005 3:01:24 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Nov 18, 2005 3:01:24 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    Nov 18, 2005 3:01:24 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Nov 18, 2005 3:01:25 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Nov 18, 2005 3:01:25 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Nov 18, 2005 3:01:25 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/23 config=null
    Nov 18, 2005 3:01:25 PM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    Nov 18, 2005 3:01:25 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 1795 ms


    localhost.log:

    Nov 18, 2005 3:01:24 PM org.apache.catalina.core.ApplicationContext log
    INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Nov 18, 2005 3:01:25 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Nov 18, 2005 3:01:29 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet default threw exception
    java.lang.IllegalStateException
    at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWra pperInclude.java:62)
    at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
    at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja va:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja va:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    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.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:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Pr otocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.jav a:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    Nov 18, 2005 3:01:29 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalStateException
    at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWra pperInclude.java:62)
    at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:770)
    at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:335)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja va:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:306)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja va:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    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.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:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Pr otocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.jav a:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)


    I'm connecting to the remote computer with tomcat and my webapp with Firefox 1.0.7 - the webapp seems to work.. but I get that error when the app tries to load a db present (the app uses normal XML files as db)
    Thank you in advance!

    note: I'm getting out of head with this problem!

  2. #2
    Join Date
    Nov 2005
    Posts
    4
    no one able to help?

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    255
    An IllegalStateException is thrown while getting the ServletOutputStream when the getWriter() has already been invoked on the response. You should use either getOutputStream() or getWriter() method on the ServletResponse, not both.
    Happiness is good health and a bad memory.

  4. #4
    Join Date
    Nov 2005
    Posts
    4
    thank you.. I'll try it...

    but seems related to the recall of a specific servlet, the recManServlet... a servlet that I use as "wrapper" to uso recMan class methods (to manage my simple XML DB)... If I enter the HTML relative to an empty form the app works.. when I try to enter a form of a non-empty DB I get that error...

  5. #5
    Join Date
    Nov 2005
    Posts
    4
    some news... I've found the source of the error,
    this line in my index.jsp:

    <jsp:include page='<%= "database/"+dbn+"/db_rec.xml" %>' />

    if the file exists I get the error...

    I've used another include just before this one:
    <jsp:include page='<%= "database/"+dbn+"/htmlform.jsp" %>' />

    this works, but the second one (mentioned before) give this error:
    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    java.lang.IllegalStateException
    org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWra pperInclude.java:62)
    org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:783)
    org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:348)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:307)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
    Apache Tomcat/5.5.12

Similar Threads

  1. Java Applet Compiler problem?
    By mdl in forum Java
    Replies: 3
    Last Post: 03-07-2005, 02:34 AM
  2. Replies: 1
    Last Post: 01-18-2002, 03:31 PM
  3. problem with recordset from Sybase and Oracle
    By substring in forum VB Classic
    Replies: 2
    Last Post: 07-24-2001, 02:29 PM
  4. Replies: 1
    Last Post: 08-10-2000, 12:35 PM
  5. Replies: 0
    Last Post: 07-25-2000, 03:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center