1 Reply Latest reply on Jun 30, 2002 10:42 AM by Julian Gosnell

    IllegalStateException when posting data to Jetty

    Panagiotis Korros Newbie

      I want to post some data to a servlet. I use the following code in the doPost method implementation:

      request.setCharacterEncoding("UTF-8");
      response.setContentType("text/xml");
      String cmd = request.getParameter("cmd");
      Reader r = request.getReader();
      ............


      I am using JBoss 3.0 Final the same code works ok the JBoss-Tomcat version

      i get the following exception:

      java.lang.IllegalStateException
      at org.mortbay.jetty.servlet.ServletHttpRequest.getReader(ServletHttpRequest.java:710)
      at ecentric.ws.TreeWebService.doPost(TreeWebService.java:177)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:371)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:607)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1387)
      at org.mortbay.jetty.servlet.FilterHandler$Chain.doFilter(FilterHandler.java:368)
      at ecentric.filters.NoCacheFilter.doFilter(NoCacheFilter.java:34)
      at org.mortbay.jetty.servlet.FilterHandler$Chain.doFilter(FilterHandler.java:297)
      at org.mortbay.jetty.servlet.FilterHandler.handle(FilterHandler.java:228)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1387)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1326)
      at org.mortbay.http.HttpServer.service(HttpServer.java:757)
      at org.jboss.jetty.Jetty.service(Jetty.java:527)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:742)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:915)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:757)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:151)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
      at java.lang.Thread.run(Thread.java:536)