File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes DOM to XML parsing Transformer Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DOM to XML parsing Transformer Exception" Watch "DOM to XML parsing Transformer Exception" New topic
Author

DOM to XML parsing Transformer Exception

Girdher Singh
Greenhorn

Joined: Feb 12, 2012
Posts: 12
Hi ,

I am getting following error while application is trying to make some xml parsing. I am using xsl file.


com.knights.camelot.pos.receipt.templates.TemplateException: Failed to appply receipt template.
at com.knights.camelot.pos.receipt.templates.rml.RMLReceiptTemplate.apply(RMLReceiptTemplate.java:38)
at com.knights.camelot.pos.receipt.ReceiptGenerator.generateReceipt(ReceiptGenerator.java:73)
at com.knights.camelot.pos.model.SaleActivityModel.printReceipts(SaleActivityModel.java:910)
at com.knights.camelot.pos.actions.PrintReceiptAction$1.run(PrintReceiptAction.java:34)
at foxtrot.AbstractWorkerThread$2.run(AbstractWorkerThread.java:49)
at java.security.AccessController.doPrivileged(Native Method)
at foxtrot.AbstractWorkerThread.runTask(AbstractWorkerThread.java:45)
at foxtrot.workers.DefaultWorkerThread.run(DefaultWorkerThread.java:153)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: java.lang.RuntimeException: InvocationTargetException when invoking public java.lang.String com.knights.camelot.pos.model.PaymentModel.getPaymentDescription(): java.lang.NullPointerException
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.knights.xml.ObjectXMLTransformer.transform(Unknown Source)
at com.knights.xml.ObjectXMLTransformer.transformToString(Unknown Source)
at com.knights.xml.ObjectXMLTransformer.transformToInputStream(Unknown Source)
at com.knights.camelot.pos.receipt.templates.rml.RMLReceiptTemplate.apply(RMLReceiptTemplate.java:36)
... 8 more
Caused by: javax.xml.transform.TransformerException: java.lang.RuntimeException: InvocationTargetException when invoking public java.lang.String com.knights.camelot.pos.model.PaymentModel.getPaymentDescription(): java.lang.NullPointerException
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
... 14 more
Caused by: java.lang.RuntimeException: InvocationTargetException when invoking public java.lang.String com.knights.camelot.pos.model.PaymentModel.getPaymentDescription(): java.lang.NullPointerException
at org.infohazard.domify.ElementAdapter.getWrapped(ElementAdapter.java:420)
at org.infohazard.domify.ElementAdapter.getNodeListAdapter(ElementAdapter.java:449)
at org.infohazard.domify.ElementAdapter.getFirstChild(ElementAdapter.java:625)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(Unknown Source)


Till now I have reached to a consensus that there is some issue with string. It is marked as null(default),it must be "".but I am not sure if I am wrong or right.


Here is the code which Is referenced in the code for exception





I am waiting for any kind of guidance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DOM to XML parsing Transformer Exception