itext and java web start -> file cannot be written

Hi all,

i have written a java application which should generate a pdf File. To generate this file i use "iText". To be able to start the application from the web i use java web start. Now i have the problem that when i want to create the PDF file, the file will be created, but it looks like nothing can be written to the file. The size is 0 kb :-(

In my jnlp file i set:

<security>

<all-permissions/>

</security>

so i think i should have the permission to write to a file.. but it doesnt work. Does anybody have an idea?

Thanks a lot.

here is a my code:

if (pdfFile !=null)

{

Document document =new Document();

try

{

PdfWriter pdfWriter = PdfWriter.getInstance(document,new FileOutputStream(pdfFile));

pdfWriter.setViewerPreferences(PdfWriter.PageModeUseThumbs);

document.addAuthor("me");

document.addTitle("Der Build Prozess");

document.open();

view.setInfoText("document open: " + document.isOpen());

Font titleFont= FontFactory.getFont(FontFactory.HELVETICA,

24, Font.NORMAL,new Color(0, 0, 125));

Paragraph title =new Paragraph("Projektarbeit", titleFont);

document.add(title);

document.close();

[1653 byte] By [OhNoa] at [2007-11-27 11:03:10]
# 1

I think you need to sign your jar:

http://java.sun.com/docs/books/tutorial/deployment/webstart/security.html

-Puce

Pucea at 2007-7-29 12:47:55 > top of Java-index,Java Essentials,Java Programming...
# 2

jar is already signed.... so this is not the reason....

OhNoa at 2007-7-29 12:47:55 > top of Java-index,Java Essentials,Java Programming...
# 3

I don't know that API (what API is it? from where?), but it reads as if you were just creating the document, but not writing it. Which line of code should actually write the document to the output stream? Is it done automatically? I don't think so, if you end up with 0k file. You probably have to call some write and close methods on the PdfWriter.

-Puce

Pucea at 2007-7-29 12:47:55 > top of Java-index,Java Essentials,Java Programming...
# 4

Does your code work if you call the application manually without Java Web Start?

Pucea at 2007-7-29 12:47:55 > top of Java-index,Java Essentials,Java Programming...