----- Original Message ----- 
From: "Patrick O. Thurman" <[EMAIL PROTECTED]>
To: "'Post all your questions about iText here'" 
<itext-questions@lists.sourceforge.net>
Sent: Friday, November 10, 2006 8:58 PM
Subject: Re: [iText-questions] what causes the NullPointerException


>I thought that the statement
>  PdfWriter.getInstance(document, blob.getBinaryOutputStream());
> Would populate the blob object with the generated pdf data.
>
> What would be the required changes?
>

No idea. It's specific to your application and has nothing to do with iText.

Paulo


> Pat
>
>
>>The variable blob is never assigned a value.
>
> Paulo
>
>
>> What causes the NullPointerException and why does it happen in the
>> following
>> code?  What are some solutions?
>>
>>
>> import com.lowagie.text.Document;
>> import com.lowagie.text.DocumentException;
>> import com.lowagie.text.Paragraph;
>> import com.lowagie.text.pdf.*;
>> import java.sql.SQLException;
>> import oracle.sql.BLOB;
>> import java.io.FileOutputStream;
>> import java.io.IOException;
>>
>> public class HelloWorld {
>>
>> public static BLOB doIt(oracle.sql.ARRAY args) {
>>
>> System.out.println("Hello World");
>>    BLOB blob = null;
>> Document document = new Document();
>> try {
>> PdfWriter.getInstance(document,
>> blob.getBinaryOutputStream());
>> document.open();
>> document.add(new Paragraph("Hello World"));
>> } catch (DocumentException de) {
>> System.err.println(de.getMessage());
>> } catch (SQLException se) {
>> System.err.println(se.getMessage());
>> }
>> document.close();
>>    return(blob);
>> }
>> }
>>
>>
>>
>> Pat,
>>
>>
>>
>>
>>
>>
>>
>>
>> Patrick O. Thurman
>> Stephen F. Austin State University
>> Information Technology Services
>> Data Base Administrator
>> Phone:  (936) 468-1074
>> Fax:    (936) 468-1117


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to