On 25 Nov 2009, at 14:34, Felix Schumacher wrote:
> Am Dienstag, den 24.11.2009, 17:57 +0100 schrieb geoff...@fileflow.com: >> Hi everyone. >> >> >> I'm stuck with a problem I don't understand. We have a tomcat server >> and after redeploying our war file, we get this error: >> > ... > Are "in" and "out" instance variables? They should be method variables, > like > > public void doGet(...) { > ServletOutputStream out; > InputStream in; > ... > in = new FileInputStream(tmp); > ... > } > > else concurrent calls to your servlet will mixup your "out" and "in" > variables. They are actually instance variable. I'll check if moving them solves the problem. > > Hth > Felix >> >> Notice that there are no number on the first line and it is usually >> the case. >> The code that is "responsible is: >> >> >> private ServletOutputStream out; >> private InputStream in; >> ... >> in = new FileInputStream(tmp); >> ... >> out = response.getOutputStream(); >> byte[] buf = new byte[8 * 1024]; // 8K buffer >> int bytesRead; >> while((bytesRead = in.read(buf)) > 0) { >> out.write(buf, 0, bytesRead); >> } >> >> >> The updated code didn't change anything in that Servlet so I really >> have no clue what happened. It happens on tomcat 6.0.18 and 6.0.20. >> Java is 1.6.0_11. >> >> >> Thanks for any help. >> >> Best Regards >> >> >> Geoffrey >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
smime.p7s
Description: S/MIME cryptographic signature