on 12-03-2011 8:21 AM
Hi Experts,
While I am generating the java code for scenario , i was read the source side file ,but when i writting the target side i am getting the error like this....
ERROR: ''
javax.xml.transform.TransformerException: 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 XXXXXXX.main(SalesOrder.java:165)
Caused by: java.lang.NullPointerException
at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.characters(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)
... 3 more
-
java.lang.NullPointerException
at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.characters(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)
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 XXXXX.SalesOrder.main(SalesOrder.java:165)
the target file is creteing with empty fie ...like this
XML document must have a top level element. Error processing resource 'file:///C:/Users//SalesOrder_Target.x...
please solve my problem asap...
Regards,
Sudeepth
Edited by: sudeepth on Dec 3, 2011 9:26 AM
hi,
debug ur java code
Document tree is not generated with the required nodes
Regards,
Krish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
While I am debuging my code ....when it come to the cursur this line trans.transform(source, result); it is showing these kind of error when transform to target file
Thread [main] (Suspended (exception NullPointerException))
ToUnknownStream.characters(String) line: not available
DOM2TO.parse(Node) line: not available
DOM2TO.parse(Node) line: not available
DOM2TO.parse(Node) line: not available
DOM2TO.parse(Node) line: not available
DOM2TO.parse(Node) line: not available
DOM2TO.parse() line: not available
TransformerImpl.transformIdentity(Source, SerializationHandler) line: not available
TransformerImpl.transform(Source, SerializationHandler, String) line: not available
TransformerImpl.transform(Source, Result) line: not available
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer trans = tFactory.newTransformer();
DOMSource source = new DOMSource(tdoc);
StreamResult result = new StreamResult(new FileOutputStream ("C:/Users/xxxx/SalesOrder_Target.xml"));
trans.transform(source, result);
Regards,
Sudeepth.
Sudeepth
First exception says "empty file" so you gotta make sure its not empty.
Second, why are you trying to write another file from your module? let adapter to generate/write the file.
And Im not sure but you might be getting those errors because you are not providing any output data to the adapter.
Regards.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.