Hi everyone.

Sorry it took some time but here it is. It actually looks like changing the 
variables to method variables fixed the problem. It has been running for 3 days 
now without any problems.

Thanks everyone.


Best Regards

Geoffrey

Phone Norway:  +47 45 86 53 83
Fileflow Technologies AS
Ole Deviks vei 35, 0668 Oslo, Norway

-------------------------------------



On 25 Nov 2009, at 15:39, Pid wrote:

> On 25/11/2009 14:05, geoff...@fileflow.com wrote:
>> 
>> 
>> 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.
> 
> Mmm. Yes...
> 
> 
> p
> 
> 
> 
> 
>>> 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
>>> 
>>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to