I’m using Java for accessing Alfresco content server via it’s web service API for importing some content into it. Content should have some NamedValue properties set to UTF-8(cyrillic) string. I keep getting the Sax parser exception:
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b) was found in the element content of the document.
The code looks something like this:
NamedValue[] namedValueProperties = new NamedValue[2]; namedValueProperties[0] = Utils.createNamedValue(Constants.PROP_NAME, name ); namedValueProperties[1] = Utils.createNamedValue('{my.custom.model}myProperty', cyrillicString); CMLCreate create = new CMLCreate('1', parentReference, null, null, null, documentType, namedValueProperties); CML cml = new CML(); cml.setCreate(new CMLCreate[]{create}); UpdateResult[] results = null; try { results = WebServiceFactory.getRepositoryService().update(cml); } catch (...) Here comes the 'org.xml.sax.SAXParseException' }
Does anyone know how to solve this problem?
The problem was that
alfresco-web-service-client.jarlibrary I used was from 2.9B distribution (I am hitting 2.9B community content server), and dependency libsbcprov-jdk15-136.jarandxmlsec-1.4.0.jarwere not adequate (remained old from 2.1 verison). I should have usedbcprov-jdk15-137.jarandxmlsec-1.4.1.jarwhich are deployed along with 2.9B distribution.