Hi,I am trying to marshall an XML in to a String using StringWriter but am
getting an exception while writing out some European characters...The error is
shown below:Error writing marshalled documentjava.io.IOException: Illegal
character code 0x8 in content text at
org.jibx.runtime.impl.UTF8Escaper.writeContent(Unknown Source) at
org.jibx.runtime.impl.GenericXMLWriter.writeTextContent(Unknown Source) at
org.jibx.runtime.impl.MarshallingContext.element(Unknown Source) at
com.mediaslate.og.schema.xml.itemdetails.Review.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_binding_marshal_1_0(Review.java)
at
com.mediaslate.og.schema.xml.itemdetails.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_bindingReview_access.marshal()
at
com.mediaslate.og.schema.xml.itemdetails.JiBX_MungeAdapter.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_binding_marshal_1_7()
at
com.mediaslate.og.schema.xml.itemdetails.Movie.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_binding_marshal_1_0(Movie.java)
at
com.mediaslate.og.schema.xml.itemdetails.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_bindingMovie_access.marshal()
at
com.mediaslate.og.schema.xml.itemdetails.Details.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_binding_marshal_1_0(Details.java)
at
com.mediaslate.og.schema.xml.itemdetails.JiBX_java_com_mediaslate_og_schema_xml_itemdetails_bindingDetails_access.marshal()
at com.mediaslate.og.schema.xml.itemdetails.Details.marshal(Details.java)
at org.jibx.runtime.impl.MarshallingContext.marshalRoot(Unknown Source) at
org.jibx.runtime.impl.MarshallingContext.marshalDocument(Unknown Source) at
com.mediaslate.og.itemdetails.ItemDetailsUtilities.marshall(ItemDetailsUtilities.java:75)
at
com.mediaslate.og.contentdetails.ContentDetails.prepareSelections(ContentDetails.java:142)
at
com.mediaslate.og.service.guide.handler.impl.SearchItemsHandler.process(SearchItemsHandler.java:195)
at
com.mediaslate.og.service.guide.handler.AbstractServiceHandler.service(AbstractServiceHandler.java:237)
at
com.mediaslate.og.service.guide.OpenGuideServiceImpl.ogpOperation(OpenGuideServiceImpl.java:179)
at
com.mediaslate.og.service.guide.AbstractServiceHandlerTest.sendRequest(AbstractServiceHandlerTest.java:128)
at
com.mediaslate.og.service.guide.AbstractServiceHandlerTest.sendRequest(AbstractServiceHandlerTest.java:108)
at
com.mediaslate.og.service.guide.SearchItemsTest.testSearchItemsFullVerbose(SearchItemsTest.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
junit.framework.TestCase.runTest(TestCase.java:154) at
junit.framework.TestCase.runBare(TestCase.java:127) at
junit.framework.TestResult$1.protect(TestResult.java:106) at
junit.framework.TestResult.runProtected(TestResult.java:124) at
junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:118) at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)The
code that marshalls this document is: public static String marshall (
Details details ) { String results = null; boolean status
= false; try { StringWriter writer = new StringWriter();//
ByteArrayOutputStream byteWriter = new ByteArrayOutputStream(); //
OutputStreamWriter writer = new OutputStreamWriter(byteWriter, "utf-8");
IBindingFactory bfact =
BindingDirectory.getFactory(details.getClass()); IMarshallingContext
mctx = bfact.createMarshallingContext();
mctx.marshalDocument(details, "UTF-8", null, writer);
results = writer.toString(); } catch (JiBXException e) {
e.printStackTrace(); } return results; }Any help in getting
around this problem is highly appreciated...Regards,RD
_________________________________________________________________
Live Search: Better results, fast
http://get.live.com/search/overview-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users