File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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

Runtime exception while running the java application`

kavitha ananya

Joined: May 07, 2008
Posts: 4

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;
fileOut = new;
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
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..

Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

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.
I agree. Here's the link:
subject: Runtime exception while running the java application`
It's not a secret anymore!