[
https://issues.apache.org/jira/browse/AXIS2-4981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rustam Abdullaev updated AXIS2-4981:
------------------------------------
Attachment: InterningXMLStreamReader.java
A workaround is to use the attached file (InterningXMLStreamReader.java), and
change the generated code to use it like in this automated Ant target example:
<target>
<echo
message="fixing jaxb binding"/>
<replace
dir="${project.build.directory}/generated-sources/axis2/wsdl2code/src">
<include name="**/*Service*Stub.java" />
<replacetoken>return
unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
type).getValue();</replacetoken>
<replacevalue>
unmarshaller.setEventHandler(new
javax.xml.bind.ValidationEventHandler() {
public boolean handleEvent(javax.xml.bind.ValidationEvent
event) {
throw new RuntimeException(event.getMessage());
}
});
return unmarshaller.unmarshal(new
org.apache.axis2.jaxbri.InterningXMLStreamReader(
param.getXMLStreamReaderWithoutCaching()), type).getValue();
</replacevalue>
</replace>
</target>
> Axis2 + Rampart X.509 + JAXB = Namespace URIs and local names to the
> unmarshaller needs to be interned.
> -------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-4981
> URL: https://issues.apache.org/jira/browse/AXIS2-4981
> Project: Axis2
> Issue Type: Bug
> Affects Versions: 1.5.4
> Reporter: Rustam Abdullaev
> Attachments: InterningXMLStreamReader.java
>
>
> When Axis2 is used with JAXB bindings and unencrypted SOAP body, all goes
> well, but as soon as SOAP Body is encrypted (using X.509 token), both
> client-side and server-side JAXB bindings stop working, on the client
> silently retuning empty response objects (all fields = null).
> The null response object is caused by the fact that JAXB by default swallows
> errors.
> Add this code to the generated stub (fromOM()) to reveal the underlying
> exception:
> unmarshaller.setEventHandler(
> new ValidationEventHandler() {
> public boolean handleEvent(ValidationEvent event
> ) {
> throw new RuntimeException(event.getMessage(),
>
> event.getLinkedException());
> }
> });
> The underlying error is:
> Namespace URIs and local names to the unmarshaller needs to be interned.
> at test.TestServiceStub$1.handleEvent(TestServiceStub.java:408)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:635)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:114)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:101)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:243)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:242)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:176)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
> at test.TestServiceStub.fromOM(TestServiceStub.java:414)
> at test.TestServiceStub.test(TestServiceStub.java:201)
> ...
> It looks like the error originates in Axiom
> (org.apache.axiom.om.impl.SwitchingWrapper returns non-interned strings).
> Tried different component versions / combinations, all resulted in the same
> error:
> Axis2 1.4 - 1.5.4
> Rampart 1.4 - 1.5.1
> JAXB 2.1.0 - 2.2.2
> Axiom 1.2.0 - 1.2.11
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]