I am trying to download files through a servlet using the classes from Jason Hunter. The webserver showed the following:- java.lang.IllegalStateException: getOutputStream has been called on this same request at ezj.g.a.h.getWriter(Unknown Source) at ezj.g.a.h.sendError(Unknown Source) at smallcon.jobcontrol.downloadfile.doPost(downloadfile.java:35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at ezj.engines.EZServletRunner.service(Unknown Source) at ezj.b.a.a(Unknown Source) at ezj.b.c.handleConnection(Unknown Source) at ezj.b.e.run(Unknown Source) Can anybody explain what the above mean and how to solve the problem?
Originally posted by Mark Leong: I am trying to download files through a servlet using the classes from Jason Hunter. The webserver showed the following:- java.lang.IllegalStateException: getOutputStream has been called on this same request at ezj.g.a.h.getWriter(Unknown Source) at ezj.g.a.h.sendError(Unknown Source) at smallcon.jobcontrol.downloadfile.doPost(downloadfile.java:35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at ezj.engines.EZServletRunner.service(Unknown Source) at ezj.b.a.a(Unknown Source) at ezj.b.c.handleConnection(Unknown Source) at ezj.b.e.run(Unknown Source) Can anybody explain what the above mean and how to solve the problem?
Your Test case or servlet would have alread opened a PrintWriter and now it iss trying to open the Stream. At any point of time either you can associate Writer or Stream with your response but not both. You will get IllegalstateException if u hold either Writer or Stream and try to open other. --Sridhar
Mark Leong
Ranch Hand
Joined: Dec 11, 2000
Posts: 60
posted
0
The download servlet worked on the test server. Wouldn't that make it work on the actual host?
sridhar satuloori
Ranch Hand
Joined: Nov 05, 2001
Posts: 144
posted
0
can you post the test case. what servers ypu are using for testing and hosting
Mark Leong
Ranch Hand
Joined: Dec 11, 2000
Posts: 60
posted
0
I have actually placed the application at webappcabaret.net. However it has not be listed at the application directory. The error is obtained from the log file. For development, I run RH7.1, Java 1.3.0_02, tomcat 3.2.1. Will make a test using tomcat 4.0.4 + Java 1.4
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.