### URGENT: duplicated servlet output ###
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, August 28, 2003 11:50 PM

Hello I'm usin cos.jar of servlets.com for file uploading. But, sometimes, the output of my servlets are duplicated. This problem doesn't occur everytime even if for the same uploaded files. Also, When I encounter this problem on my desktop, It runs on the other desktops without any problem. Here are my configurations and doPost(): Browser:Internet Explorer 5.0 OS: Windows 2000 Professional Servlet Engine: Resin 2.1.9 public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { itrprofThread iThread; iThread = new itrprofThread(r   More>>

Hello


I'm usin cos.jar of servlets.com for file uploading. But, sometimes, the output of my servlets are duplicated. This problem doesn't occur everytime even if for the same uploaded files. Also, When I encounter this problem on my desktop, It runs on the other desktops without any problem.


Here are my configurations and doPost():


Browser:Internet Explorer 5.0

OS: Windows 2000 Professional

Servlet Engine: Resin 2.1.9


public void doPost(HttpServletRequest request,
HttpServletResponse response)

throws ServletException, IOException

{

itrprofThread iThread;



iThread = new itrprofThread(request,response);

iThread.start();

try {

iThread.join();

} catch (InterruptedException e) {}

}


I'm sure that uploaded file is processed twice after the first entire process of the file is finished. Here is the proof:


CORRUPTED LINEs AND THEIR DEPENDENTs (2 of 2)


Errror code Line number Line

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

itp-05 [2] 99 (removed)

itp-05 [2] 353 (removed)

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


As you see above, the lines are the same lines. In fact, it's single line in the uploaded file. But, If you notice the line numbers of the lines, they are different. The first line number is correct. But, the second is wrong. Because, second line is duplicated.


Also, There are 252 lines in the file. But, line number of the second line is reported 353. This is not possible.


I'm now sure that uploaded file in the second phase is processed after the first phase is completed. Because:


Line number in the first phase: 99

Total line number in the file: 252

Line number in the second phase: 353



If I sum 99 and 252, it gives 351. It's proof the entire file is processed twice after the first phase is completed.


I had debugged Netscape and I had observed that netscape formats HTML forms data in a temporary file before sending HTML form data. If I'm not wrong, this format can not be a Netscape specific format. Because, receiving sides don't have to know the specific formats of each browsers. So, Internet Explorer should do same thing. do you know where HTML form data is located before sending ? If I can find, I can check if HTML form data is sent correctly. By this method, I can narrow down the problem to see if it's client side problem or not. is it possible to see the contents of HTML form data before sending to servlet ?


Please help...This is very important problem. Because, the output of our sevlets are duplicated.


thanks in advance...

   <<Less

Re: ### URGENT: duplicated servlet output ###

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, August 29, 2003 06:20 AM

Servlets are multi-threaded already. Maybe by explicitly starting additional threads, you are causing your problem?

About | Sitemap | Contact