Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid byte 1 of 1-byte UTF-8 sequence

807591May 29 2008 — edited May 29 2008
Hi,

I am using JAXP to transform xml message with xslt.

It worked fine when my input xml file was in UTF-8 encoding as it has japanese charaters.

Now I am trying to transform it without UTF-8 as in my original scenario.
I got the sample file from the source system.
There is no encoding specified in XML prolog.

Now when I try to read this file, I get this error:

ERROR: 'Invalid byte 1 of 1-byte UTF-8 sequence.'
ERROR: 'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid
byte 1 of 1-byte UTF-8 sequence.'
TransformerException
javax.xml.transform.TransformerException: javax.xml.transform.TransformerExcepti
on: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte
1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
m(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
m(Unknown Source)
at FileProcessor.transformFile(TransformMessage.java:183)
at FileProcessor.processFile(TransformMessage.java:37)
at FileProcessorThread.run(TransformMessage.java:226)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(Unknown Source)
... 6 more
Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 1 of 1-byte UTF-8 sequence.
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)
... 7 more
---------

1. Is there any way to figure out in which encoding the source system is sending xml message?
2. If there is, how to read the xml message with this encoding?

Regards.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2008
Added on May 29 2008
4 comments
7,005 views