Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Unexpected return

yuanjk

2005-08-17

Replies:

About 3 year ago, I had wrote a tools to genarate pdf by using iText V0.99, which is a web app and was used only by myself.
Recentlly some body else began to use it, then tell me some bugs.
One of them is that , when double client request the server at the same time, can not get the right pdf file.
I think it must be that I wrote a servlet which was not thread safe .

I dig into the source code, and find some confused phenomenon.

The sub code are test code.
method A() {
 try{
   //invoke mehod A-1
   method A-1
   //invoke mehod A-2
   method A-2
   //mthod A-2 have some problem , here return
   //mehod A-3 was not invoked
   method A-3  
 }catch(Exception e){
   //no any exception
 }
)
method A-1(){
}
method A-2(){
 //use iText to generate pdf
 ...
 //until here , everything seems ok
 //after invoke document.close ,seems some error occure
 document.close();
}
method A-3(){
}

Then I add debug code in com/lowagie/text/pdf/PdfWriter.java (V0.99)
/*
* $Id: PdfWriter.java,v 1.48 2002/04/24 12:48:57 blowagie Exp $
* $Name: $
...
  public synchronized void close() {
    SysLog.debug("begin of PdfWriter.close() with open--"+open);
 
 SysLog.debug("end of PdfWriter.close() ");
     }
       catch(IOException ioe) {
          SysLog.debug("exception at PdfWriter,close()--"+ioe.getMessage());
          throw new ExceptionConverter(ioe);
       }
    }
  }
But can not get the "end of PdfWriter.close() " log message or exception log message.

Then I chage the iText pacage from V0.99 to V1.3.2 then test again , everything seems ok.
/*
* $Id: PdfWriter.java,v 1.98 2005/07/21 18:37:08 psoares33 Exp $
* $Name: $


I think that there are so many difference bettern V0.99 and V1.3.2,
Is any differnce can cause this trouble?What is the diffence?
If I wrote a error problem, can anybody help me to fix it.

Looking forwards your replay, thanks.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.