Log in

View Full Version : Same Jar/Java-Code (sax parser) behave differently on windows and Unix Machine, why ?


amitthakur10832
Sep 24, 2016, 05:30 AM
Hi ,


Issue --> Actually I am facing issue with xml parsing (SAX Parser) in Unix Machine. Same Jar/Java-Code behave differently on windows and Unix Machine, why ? :(


Windows Machine --> works fine , Using SAX Parser to load huge xml file , Read all values correctly and populate same values. Charset.defaultCharset() windows-1252


Unix Machine --> After then created JAR and deployed at Unix --> tomcat and execute the jar.
Tried to load same huge xml file But noticed that some values or characters are populated empty or incomplete like
Country Name populated as "ysia" instead of "Malaysia" or transaction Date populate as "3 PM" instead of "18/09/2016 03:31:23 PM". Charset.defaultCharset() UTF-8


Issue is only with Unix , Because when I load same xml at windows or my local eclipse it works fine and all values populate correctly.


Also I tried to modify my code and set encoding as UTF-8 for inputSteamReader but still it's not read value correctly at unix box.


Note : There is no special characters in xml. Also noticed one thing that when I take out same records (those value not populated correctly) in other xml file and load in unix machine with same jar it works fine. It means issues occur while load these records with huge data. :(


Please suggest , What should be the solution ?

InfoJunkie4Life
Sep 24, 2016, 05:16 PM
I think the people at stackoverflow (http://stackoverflow.com/questions/39675146/xml-parser-behave-differently-on-unix-machine-for-huge-big-xml-file-only-same-c) have nailed it for you.