Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 73525 invoked from network); 15 Feb 2009 17:07:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Feb 2009 17:07:56 -0000 Received: (qmail 27974 invoked by uid 500); 15 Feb 2009 17:07:44 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 27949 invoked by uid 500); 15 Feb 2009 17:07:44 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 27937 invoked by uid 99); 15 Feb 2009 17:07:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Feb 2009 09:07:44 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.53.69.26] (HELO mail.muzlink.com) (74.53.69.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Feb 2009 17:07:36 +0000 Received: from cpe-98-149-75-20.socal.res.rr.com ([98.149.75.20] helo=[192.168.1.103]) by mail.muzlink.com with esmtpa (Exim 4.63) (envelope-from ) id 1LYkSZ-0003db-E9 for users@tomcat.apache.org; Sun, 15 Feb 2009 11:07:15 -0600 Message-ID: <49984BC5.6020006@compulsivecreative.com> Date: Sun, 15 Feb 2009 09:07:17 -0800 From: Alan Chaney User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Tomcat Internal Buffering with Jython References: <76f3fb3e0902150210l138d9cbfmab563f7654132b5a@mail.gmail.com> <499843B7.8060604@compulsivecreative.com> <76f3fb3e0902150856x3aaffab4p73391437a4aefd09@mail.gmail.com> In-Reply-To: <76f3fb3e0902150856x3aaffab4p73391437a4aefd09@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Prashant So the exact problem is that after your jsp page is called and the data processed then the file is incomplete? Presumably then you are using ordinary file I/O to write to this file? If that's the case, then I think the answer to your original question is "No - no internal buffer of tomcat is holding the data" Tomcat's buffering is connected with processing servlet request/responses and it doesn't seem that you are using the response object to write your data to the output stream. I assume that you have checked that all of the data is being read from the request by some logging or debugging? I would suspect that a file or stream is not being flushed/closed and that when tomcat is stopped this flushing is happening because the streams are being closed automatically. Maybe you can create some unit tests which can help isolate this problem. It may be either in your file writing code or in the way you are using the jython libraries. Without seeing your code in detail its difficult to be more helpful. I'd guess that you could take your core logic and replicate the problem independently of tomcat. One other point is that saving this file in the tomcat home directory doesn't seem particularly elegant. You could use the default work directory. I doubt that has any relevance to the problem HTH Alan Prashant Golash wrote: > Hi Alan, > Below are the details for the versions and OS: > > Tomcat Version : 6.0 > OS : Windows XP > JVM : 1.6 > > The way web is structured is: > > I have some precompiled python scripts which are actually compiled by jython > into java classes(Before deploying). > I have one python script which uses these precompiled python classes.Now I > am giving one file as > input to this python script and it internally produces the output file using > this input file. > This output file is saved locally in the parent directory of Tomcat. > > There is one jsp page which takes input from the user and then passes the > request to Java class which actually > calls this Python script. > > Note:The python script is actually called using the PythonInterpreter class > and all those Java and Jython integration techniques. > > Sincerely, > Prashant golash > > On Sun, Feb 15, 2009 at 10:02 PM, Alan Chaney > wrote: > > >> Hi Prashant >> The first question - which version of Tomcat? What operating sytem? What >> JVM? and in your case which version of Jython? >> >> Secondly please could you clarify exactly how your web is structured? >> >> My understanding from your first email is: >> >> 1. servlet is called with request containing a file (presumably mutlipart >> encoded?) >> 2. the file data is then fed into a python script running either using a >> java6 ScriptManager or similar. >> 3. and then what? Are you streaming the output from that file straigth into >> the PrintWriter/OutputStream of the HttpServeltResponse? >> Or are you trying to save the file locally? >> >> Regards >> >> Alan Chaney >> >> >> Prashant Golash wrote: >> >> >>> Hi Tomcat-Apache Gurus, >>> I have a web application where from the front end user loads a file >>> and gives it as input to Java classes.The file is given as input to >>> a python script which converts it into some other format. >>> Here I have used the concept of jython. >>> The file is converting properly in the parent >>> directory of Tomat but with some of the data which is missed.The problem >>> is >>> when I close the tomcat,then additional data is added to the converted >>> file >>> which >>> completes the correct conversion. >>> >>> I want to know whether some internal buffer of Tomcat is holding the extra >>> data. >>> If so how to retrieve it. >>> >>> Sincerely, >>> Prashant golash >>> >>> >>> >>> >>> >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> >> >> > > > !DSPAM:49984b33117283966023671! > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org