2

I have a web system using jboss seam. There is an functionality that invokes a batch file. The batch file creates a pdf file using org.w3c.tidy.Tidy.

When I run the batch file by hand, it works very well, but, unfortunately, when I run it by the web application, the process does not work. It gets stuck at the moment to create the Document object (org.w3c.dom.Document doc = tidy.parseDOM(input, null);).

I have tried out some ways to create this object, but nothing worked.

Below the complete code to create the PDF:

Tidy tidy = new Tidy();
tidy.setWraplen(Integer.MAX_VALUE);
tidy.setXmlOut(true);
tidy.setSmartIndent(true);

//the process stops here
org.w3c.dom.Document doc = tidy.parseDOM(input, null);

ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(doc, null);
renderer.layout();
renderer.createPDF(out);
renderer.finishPDF();

Below the code that invokes the batch by the web application.

Process p = Runtime.getRuntime().exec( C:\JOBS\MY_BATCH.BAT 26/10/2015 1 );

I'm using JBoss 5.1.

Any idea? Did somebody go through this problem? Thanks in advance.

Mofi
  • 46,139
  • 17
  • 80
  • 143

0 Answers0