Monday, December 1, 2008

SAXParseException: Content is not allowed in prolog.

[org.xml.sax.SAXParseException: Content is not allowed in prolog.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:510)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:215)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:190)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:241)
at org.exoplatform.services.wsrp2.utils.StandardPayload.getUnmarshalledObject(StandardPayload.java:95)
at org.exoplatform.services.wsrp2.utils.StandardClasses.getUnmarshalledObject(StandardClasses.java:71)
at org.exoplatform.services.wsrp2.utils.JAXBEventTransformer.getUnmarshalledObject(JAXBEventTransformer.java:254)
at org.exoplatform.services.wsrp2.utils.JAXBEventTransformer.getEventsUnmarshal(JAXBEventTransformer.java:132)
at org.exoplatform.services.wsrp2.consumer.impl.WSRPConsumerPlugin.processAction(WSRPConsumerPlugin.java:745)


Where not a consistent xml to unmarshal.
Первый параметр должен быть репрезентацией валидного хмл.

JAXBElement
unmarshal(Node node, Class declaredType)

JAXBElement stdElement = unmarshaller.unmarshal(messageElement,classT);

No comments: