Hi, Mahesh:

Would it be right to assume the problematic files have JSON, text, or XML 
format (ie, not binary)?

Do the local machine and server have the same default platform encoding?  If 
not, a file written with a different encoding on the local machine than the 
default encoding on the server machine where the file is read.  The difference 
might matter only for some characters and thus trigger the error only for some 
files.  A discussion of some of the issues:

http://stackoverflow.com/questions/9312816/java-platforms-default-charset-on-different-platforms

The easiest solution is to specify the encoding explicitly both when you write 
and read a file.  The Java IO classes support an explicit character set 
specification.  JSON, text, and XML documents are persisted as UTF-8 in 
MarkLogic server, so that would be preferred.

If you have to sniff the character set of the file, the problem gets harder:

http://stackoverflow.com/questions/499010/java-how-to-determine-the-correct-charset-encoding-of-a-stream


Hoping that helps,


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of Mahesh Lal 
[[email protected]]
Sent: Monday, July 29, 2013 2:12 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Facing issues while loading the file to 
Marklogic


Hi


I am having a peculiar problem.


I am trying to load about 1500 documents into Marklogic using a Scala script 
that uses XCC.


When I run the script from a local machine - it runs.
However when we run the script from a Chef server, we get the following error:


java.nio.charset.MalformedInputException: Input length = 1





The problem is that the error is not consistent for all the files and almost 
600 files get loaded while the above error is thrown for the remaining files.

Has anyone ever seen similar exceptions? If yes, when do they happen?


Any help would be appreciated.



-- REGARDS

MAHESH LAL

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to