Error Serializing Bo Business Object
> Topic: Error serializing BO / SAXParseException: An invalid XML character 1 reply Latest Post - 2013-02-05T02:20:49Z by SystemAdmin Display:ConversationsBy Date 1-2 of 2 Previous Next SystemAdmin 110000D4XK 289 Posts Pinned topic Error serializing BO / SAXParseException: An invalid XML character 2013-01-18T11:46:04Z | Tags: Answered question This question has been answered. Unanswered question This question has not been answered yet. Hi, I am using WPS/WESB 7.5 with jms/mq export and using default data format = SOAP, default message format = Byte. The message comes to MQ is having ccsid = 1208, but WESB throws following exception : 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save User options passed were: 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: FORMATTED Value: false 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save All options used were: 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: ENCODING Value: UTF-8 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: ANY_SIMPLE_TYPE Value: org.eclipse.emf.ecore.impl.EClassImpl@49184918 (name: EDataObjectSimpleAnyType) (instanceClassName: null) (abstract: false, interface: false) 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: FORMATTED Value: false 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: ANY_TYPE Value: org.eclipse.emf.ecore.impl.EClassImpl@49074907 (name: EDataObjectAnyType) (instanceClassName: null) (abstract: false, interface: false) 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: EXTENDED_META_DATA Value: com.ibm.ws.bo.BOExtendedMetaData@56175617 1/18/13 12:40:41:005 CET 0000008b BOXMLSerializ E com.ibm.ws.bo.service.BOXMLSerializerImpl save Key: USE_CACHED_LOOKUP_TABLE Value: org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl$Lookup@7e347e34 1/18/13 12:40:41:005 CET 0000008b FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\IBM\WebSphere\AppServer\profiles\qbpmaps\logs\ffdc\server1_38503850_13.01.18_12.40.41.0056464316679593533359.txt java.lang.RuntimeExcep
originating from a WebSphere Adapter Unicode invalid character 0x0 xml serialize serialization XSLT XLS error Technote (troubleshooting) Problem(Abstract) WeBSphere Adapter is unable to process data from a source containing unicode data due to a serialization error in the broker indicating that "An invalid XML character (Unicode: 0x0) was found in the element content". Symptom When processing data using a broker that originates from a WebSphere JCA Adapter, you encounter an exception of the following form: Source = java.lang.RuntimeException caught trying to serialize BO BusinessObject: F4211BeginDoc@382a382a (F4211FSBeginDoc=F4211FSBeginDoc@67e667e6) probeid = 214 Stack Dump = java.lang.RuntimeException: An invalid https://www.ibm.com/developerworks/community/forums/thread.jspa?threadID=468403 XML character (Unicode: 0x0) was found in the element content: This error occurs while you are performing data transformations within your broker, either for an XSLT or to enable monitoring or tracing of the data stream, and results in a flow failure. Cause The problem occurs when the source data contains unicode data which is not allowed in XML. In the above example, this is the unicode character http://www-01.ibm.com/support/docview.wss?uid=swg21425772 0x0, but there are a number of other unicode characters that can cause the same result. The problem does not occur in the WebSphere Adapter itself because the WebSphere Adapters are entirely capable of handling full unicode data. Rather, the problem happens in some brokers which fail to properly serialize the incoming data into a valid XML object. Resolving the problem The only complete solution at this time is to not process unicode characters that are not valid in XML. This can be done by not importing data fields that might contain such characters or by purging such characters from the incoming data source. It is not sufficient to do filtering in the BO maps since the broker can still run into problems prior to this Java™ mapping. If handling of fields containing these unicode characters is essential to your use case, it will be necessary to open a PMR with your broker's support team (rather than the WebSphere Adapter team) to determine if there are any alternatives available. Historical Number 75349 344 000 Document information More support for: WebSphere Adapters Family Adapter – Non-specific Software version: 6.0, 6.0.2, 6.1, 6.2, 7.0 Operating system(s): AIX, HP-UX, IBM i, Linux, Solaris, Windows,
interfaces to convert a Business Object to an XML string and vice versa in WebSphere Integration Developer. Often times you will see a http://blog.kandati.com/2010/05/often-times-you-will-see-need-to_26.html need to convert a given Business Object into an XML string and vice versa. You can serialize and deserialize a Business Object to and from a given XML string by using com.ibm.websphere.bo.BOXMLSerializer and com.ibm.websphere.bo.BOXMLDocument interfaces. BOXMLSerializer serializer = (BOXMLSerializer)new ServiceManager().locateService("com/ibm/websphere/bo/BOXMLSerializer"); Sample Java code to convert a Business Object to an XML String: Let's say you error serializing have your Business Object stored in a variable ‘inputDataObject' (of type commonj.sdo.DataObject) ByteArrayOutputStream outputStream = newByteArrayOutputStream();serializer.writeDataObject(inputDataObject,inputDataObject.getType().getURI(),inputDataObject.getType().getName(),outputStream); String myXMLString = outputStream.toString("UTF-8"); "myXMLString" will hold the XML string corresponding to the Data Object "inputDataObject". Sample Java code to convert a given XML String to a Business Object: Let's say you have the XML string stored in a variable error serializing bo named ‘inputXMLString' (of type java.lang.String) BOXMLDocument document = serializer.readXMLDocument(new ByteArrayInputStream(inputXMLString.getBytes("UTF-8")));commonj.sdo.DataObject myDataObject =document.getDataObject(); "myDataObject" will hold the Business Object corresponding to the XML string "inputXMLString". Note: Theschema definition (xsd) corresponding to the Business Object that you are trying to convert the XML string into, should be available during runtime. Posted by Hema Sagar Reddy Kandati at 3:00 PM Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: Business Objects, Serialization and Deserialization No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) Subscribe To Posts Atom Posts Comments Atom Comments About Me Hema Sagar Reddy Kandati Sagar Kandati is an Enterprise Technology Consultant currently working for First Tennessee Bank. Click to view full profile Blog Archive ► 2012 (4) ► August (2) ► May (1) ► April (1) ► 2011 (3) ► August (1) ► July (1) ► January (1) ▼ 2010 (9) ► September (1) ▼ May (4) Serializing and Deserializing Business Objects Fro... Fetching WSDL Properties From We