You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Rustam Abdullaev (JIRA)" <ji...@apache.org> on 2011/08/25 14:07:29 UTC

[jira] [Updated] (AXIS2-4981) Axis2 + Rampart X.509 + JAXB = Namespace URIs and local names to the unmarshaller needs to be interned.

     [ https://issues.apache.org/jira/browse/AXIS2-4981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rustam Abdullaev updated AXIS2-4981:
------------------------------------

    Comment: was deleted

(was: A quick-n-dirty workaround (for SMALL payloads) is to dump the XML fragment into a string and re-parse it. Here's an ant snippet to fix the generated Stubs:


								<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 java.io.StringReader(param.toString()));
									</replacevalue>
								</replace>
)

> 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
>
> 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: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org