cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence (Windows Machines)

ranjank
Alexandrite

Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence (Windows Machines)

Hi,

 

I'm trying to import Project tagged Entities(i.e. entities.xml) from one machine i.e. Dev to another Test machine but getting below error:-

 

Error importing: error, Not Acceptable

"Internal error: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence"

 

1st machine(from which export has been taken) is having ThingWorx v8.3 and Manufacturing Apps v8.3.2

2nd machine(Entities to which import required) is having ThingWorx v8.4.4 and Manufacturing Apps v8.3.2

 

I already added Java Options in tomcat as mentioned when I installed tomcat :-

-Dserver -Dd64
-XX:+UseG1GC
-Dfile.encoding=UTF-8
-Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\Thingworx\WEB-INF\extensions

 

Still I am getting the error when trying to import the entites.xml file.

 

Please help on this issue.

 

Thanks in advance.

12 REPLIES 12

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Hello,

 

  Are both servers set to use UTF-8? 

 

-Chris Kaminski

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Yes.

 

Also in both servers Java Options are set i.e. -Dfile.encoding=UTF-8.

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Is it possible for you to test the source file:

 

  https://stackoverflow.com/questions/115210/how-to-check-whether-a-file-is-valid-utf-8

 

-Chris

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Hi,

 

Our environment is on Windows machine and after your suggestion I checked for process of checking the validity of UTF-8 file but didn't find any link to test the entities.xml file.

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

If you want, DM me the file and I'll see what I can determine?

 

iconv is available in either cygwin or in the Unix on Windows builds (ubuntu).  

 

-Chris

 

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Sorry!!

 

Its not possible for me to share the .xml file of Entities.

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Do you have the Windows Subsystem for Linux installed?  Or access to a Linux machine?  Ubuntu from the Microsoft store has iconv installed to test. 

 

https://docs.microsoft.com/en-us/windows/wsl/install-win10

 

The only Windows native versions I've been able to find of iconv come with cygwin.

 

http://cygwin.org/

 

Can you use a hex editor to see if there's an unprintable character at the start of your file?  I've had something similar trip me up before.

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Hi,

Have you already set extension import enabled (allowEntities) in platform-settings.json per article CS300115?

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Hi,

 

Yes, it is already set as mentioned:-

 

"ExtensionPackageImportPolicy": {

        "importEnabled": true,

      "allowJarResources": true,

      "allowJavascriptResources": true,

      "allowCSSResources": true,

      "allowJSONResources": true,

      "allowWebAppResources": true,

      "allowEntities": true,

      "allowExtensibleEntities": true

    }

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

We normally only set -Dfile.encoding=UTF-8 property to JAVA_OPTS Java options for tomcat. If it doesn't work, please use below workaround for a try:

  1. Open the XML in notepad
  2. No extra space should be there at the beginning and end of the document
  3. Select File -> Save As
  4. Select save as type -> All files
  5. Enter file name as abcd.xml
  6. Select Encoding as UTF-8 -> Click Save

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Hi,

 

Have entered the parameters mentioned in official PTC TW_8.4_Installation document.(Screenshot attached)

 

Have also tried the workaround earlier as mentioned but no success.

Re: Entities importing Error: error, Invalid byte 1 of 1-byte UTF-8 sequence

Please open a case to support team for further analysis, attach tomcat log/Thingworx application log/Tomcat java options, thanks!

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.