You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Bruno Busco (JIRA)" <ji...@apache.org> on 2008/09/13 10:26:44 UTC
[jira] Created: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
--------------------------------------------------------------------------------------
Key: OFBIZ-1957
URL: https://issues.apache.org/jira/browse/OFBIZ-1957
Project: OFBiz
Issue Type: Bug
Components: framework
Affects Versions: SVN trunk
Environment: SVN trunk rev.694324
Reporter: Bruno Busco
While using webtools XML data import feature to import a file containing this:
<?xml version="1.0" encoding="UTF-8"?>
<entity-engine-xml>
<ElectronicText dataResourceId="ERRORE">
<textData>perchè dà errore?</textData>
</ElectronicText>
<entity-engine-xml>
the following error if given:
ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
The same happens if the import textbox is used
I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Marco Risaliti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638265#action_12638265 ]
Marco Risaliti commented on OFBIZ-1957:
---------------------------------------
Hi Bruno,
could you try to replace the special unicode characters with the escaped unicode version and probably you will be able to load those data.
In your exaple the tag entity-engine-xml was not closed correctly and it's missing the definition of dataResourceId ERRORE.
<entity-engine-xml>
<ElectronicText dataResourceId="ERRORE">
<textData>perch\u00E8 d\u00E0 errore?</textData>
</ElectronicText>
</entity-engine-xml>
So if everything is ok you can close this issue as invalid.
Thanks
Marco
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Marco Risaliti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marco Risaliti reassigned OFBIZ-1957:
-------------------------------------
Assignee: Marco Risaliti
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
> Assignee: Marco Risaliti
> Attachments: ImportXmlString.patch
>
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "BJ Freeman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630751#action_12630751 ]
BJ Freeman commented on OFBIZ-1957:
-----------------------------------
as a matter of fact
https://javolution.dev.java.net/issues/show_bug.cgi?id=43
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Marco Risaliti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641156#action_12641156 ]
Marco Risaliti commented on OFBIZ-1957:
---------------------------------------
Hi Bruno,
I dig into the source and found a solution in the attached patch.
It seems that when convert a string in bytes with the method getBytes() it cannot accept special characters and in this case you have to use the method getBytes("UTF-8").
Can a framework commiter take a look at this patch ?
Thanks
Marco
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
> Assignee: Marco Risaliti
> Attachments: ImportXmlString.patch
>
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Marco Risaliti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marco Risaliti updated OFBIZ-1957:
----------------------------------
Attachment: ImportXmlString.patch
Patch to solve this issue.
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
> Attachments: ImportXmlString.patch
>
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "BJ Freeman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630752#action_12630752 ]
BJ Freeman commented on OFBIZ-1957:
-----------------------------------
looking at
org.ofbiz.entity.util.EntitySaxReader.parse
there looks like
// LocalResolver lr = new UtilXml.LocalResolver(new DefaultHandler());
// reader.setEntityResolver(lr);
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacques Le Roux closed OFBIZ-1957.
----------------------------------
Resolution: Fixed
Fix Version/s: Release Branch 4.0
SVN trunk
Assignee: Jacques Le Roux
Thanks Marco for the patch, Bruno for report and BJ for comment,
After some researches I finally commited Marco's patch in trunk revision: 706692, release4.0 706693
I had a doubt because I thought that maybe in some cases we would not have UTF8 encoding.
But as, for now, it's only used in EntitySaxReader.endElement and WebToolsServices.parseEntityXmlFile I think it's ok.
Maybe we could get the encoding from the file. If needed I think it should be the way to go. But obviously it's not as simple as this solution...
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
> Assignee: Jacques Le Roux
> Fix For: SVN trunk, Release Branch 4.0
>
> Attachments: ImportXmlString.patch
>
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Marco Risaliti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marco Risaliti reassigned OFBIZ-1957:
-------------------------------------
Assignee: (was: Marco Risaliti)
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
> Attachments: ImportXmlString.patch
>
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "Bruno Busco (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638723#action_12638723 ]
Bruno Busco commented on OFBIZ-1957:
------------------------------------
Thank you BJ and Marco for your investigations on the issue.
Marco,
the part of file I cut and pasted in the mail was just a part but the dataResourceId ERRORE was present in the real file I used for the test. Sorry if it caused you some problems during your test.
I could try what you suggest but I think it could not be considered like a final solution.
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-1957) Error parsing entity xml file:
java.io.CharConversionException: Invalid UTF-8 Encoding
Posted by "BJ Freeman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-1957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630750#action_12630750 ]
BJ Freeman commented on OFBIZ-1957:
-----------------------------------
this is the error log from the same I did on my local copy
using Windows machine with just EN enabled.
An error occurred saving the data, rolling back transaction (true)
Exception: java.io.CharConversionException
Message: Invalid UTF-8 Encoding
---- stack trace ---------------------------------------------------------------
java.io.CharConversionException: Invalid UTF-8 Encoding
javolution.io.UTF8StreamReader.read2(Unknown Source)
javolution.io.UTF8StreamReader.read2(Unknown Source)
javolution.io.UTF8StreamReader.read(Unknown Source)
javolution.xml.stream.XMLStreamReaderImpl.setInput(Unknown Source)
javolution.xml.stream.XMLStreamReaderImpl.setInput(Unknown Source)
javolution.xml.stream.XMLStreamReaderImpl.setInput(Unknown Source)
javolution.xml.sax.XMLReaderImpl.parse(Unknown Source)
org.ofbiz.entity.util.EntitySaxReader.parse(EntitySaxReader.java:258)
interesting thing is I used
<?xml version="1.0" encoding="ISO-8859-1"?>
<entity-engine-xml>
<ElectronicText dataResourceId="ERRORE">
<textData>perchè dà errore?</textData>
</ElectronicText>
<entity-engine-xml>
and still got an
Message: Invalid UTF-8 Encoding
So javolution.xml can only has an UTF8StreamReader
and it probably is not reading the right number of bytes
so I think this should be in the javolution forum.
> Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> --------------------------------------------------------------------------------------
>
> Key: OFBIZ-1957
> URL: https://issues.apache.org/jira/browse/OFBIZ-1957
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Environment: SVN trunk rev.694324
> Reporter: Bruno Busco
>
> While using webtools XML data import feature to import a file containing this:
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-engine-xml>
> <ElectronicText dataResourceId="ERRORE">
> <textData>perchè dà errore?</textData>
> </ElectronicText>
> <entity-engine-xml>
> the following error if given:
> ERROR: Error parsing entity xml file: java.io.CharConversionException: Invalid UTF-8 Encoding
> The same happens if the import textbox is used
> I have found this subject recurring many time in the mailing lists archive but never with a conclusion (AFAIK).
> May be a related issue that could help to fix this is: OFBIZ-1083 where a similar problem was fixed for emails.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.