permaculture playing cards*
The moose likes XML and Related Technologies and the fly likes Runtime exception while running the java application` Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Runtime exception while running the java application`" Watch "Runtime exception while running the java application`" New topic
Author

Runtime exception while running the java application`

kavitha ananya
Greenhorn

Joined: May 07, 2008
Posts: 4
Hi,

I am getting a runtime exception when i try to run the following piece of code.

FopFactory fopFactory = FopFactory.newInstance();
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
/*Setup output*/
OutputStream fileOut = new java.io.FileOutputStream(pdfFilePath);
fileOut = new java.io.BufferedOutputStream(fileOut);
try {
/*Construct fop with desired output format*/
//foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b");
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, fileOut);
/*Setup XSLT*/
TransformerFactory factory = TransformerFactory.newInstance();
}

An exception is thrown in runtime when the following line of code is executed
TransformerFactory factory = TransformerFactory.newInstance();

Could anyone of you have an idea as to why is this happening...

PLEASE PLEASE PLEASE help me in this.. I have been trying on this from past 2 days....

The error is not displayed in the console but in the UI, the following message is displayed..
"javax.servlet.ServletException: Error calling action method of component with id searchInvoiceResult:userSearchResult:_id94
javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)"
..........................
which is nowhere related to the code, but while debugging i came to know that the pplications stops debugging once the above line of code is debugged..

Thanks
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there and welcome to Javaranch!

Admin Matter: Please do put your code inside the UBB code tags so that it can be easily read, e.g. , thanks!

Have you been able to stop the code in a debugger, you need to find out what the real exception is (Hint the newInstance() method actually throws a TransformerFactoryConfigurationError), also take a look at hte Javadoc to see how you should configure a TransformerFactory.

Hope that helps!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
Consider Paul's rocket mass heater.
 
subject: Runtime exception while running the java application`
 
Similar Threads
ServletOutputStream.write not working in IE 7
XSL-FO Multiple Page Sequences
Java : avalon framework configuration exception
how to embed Asian font while genrating PDF using FOP
Corrupt PDF file while using .fo to .PDF using FOP