|
Hi,
I am using a web Application on TOmcat 6.0.14. I passed the URL into the render function. The code is as follows.
public void generatePdfInvoice(HttpServletRequest request , HttpServletResponse response) throws Exception{ StringBuffer filename = request.getRequestURL(); System.out.println("The request URL is: " + filename.toString()); String file = filename.toString(); File outputPDFFile = new File("D://Stored_Invoices/Inv_no_" + this.getInvoiceID() + ".pdf"); String inputHTMLFileName = file + "?cmd=print&invoice_id=" + this.getInvoiceID(); //URL url = new URL("filename"); Dimension format = PD4Constants.A4; java.io.FileOutputStream fos = new java.io.FileOutputStream(outputPDFFile); PD4ML pd4ml = new PD4ML(); pd4ml.setPageInsets(new Insets(20, 10, 10, 10)); pd4ml.setHtmlWidth(1000); pd4ml.setPageSize(pd4ml.changePageOrientation(format)); pd4ml.enableDebugInfo(); pd4ml.render(inputHTMLFileName, fos);
It is giving the following error:
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8084/ManglamProj/vtsInvoice2.jsp?cmd=print&invoice_id=980 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1298) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1292) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:948) at org.zefer.cache.c.getResourceAsBytes(Unknown Source) at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source) at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source) at org.zefer.pd4ml.PD4ML.o00000(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source)
What to do????
|