Hi,
my basic setup is as follows:
* Axis2 1.5
* JAXWS-Webservice protected with a policy (defined globally in axis2.xml)
Without the policy (rampart) the webservice works fine - as soon as the
policy is defined, the following exception is thrown multiple times when
the client accesses the webservice.
--------------------------------------------------------------------
[DEBUG] Adding JAXBAttachmentUnmarshaller to Unmarshaller
[DEBUG] Invoking unMarshalByElement
[DEBUG] isXOPPackage returns true
[DEBUG] Root Cause:javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: Namespace URIs and local names to
the unmarshaller needs to be interned.]
[DEBUG] stack:javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: Namespace URIs and local names to
the unmarshaller needs to be interned.]
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:421)
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:330)
at
org.apache.axis2.datasource.jaxb.JAXBDSContext$6.run(JAXBDSContext.java:802)
at
org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:76)
at
org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshalByElement(JAXBDSContext.java:799)
at
org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshal(JAXBDSContext.java:293)
at
org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._getBOFromReader(JAXBBlockImpl.java:96)
at
org.apache.axis2.jaxws.message.impl.BlockImpl._getBOFromOM(BlockImpl.java:475)
at
org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._getBOFromOM(JAXBBlockImpl.java:136)
at
org.apache.axis2.jaxws.message.impl.BlockImpl.getBusinessObject(BlockImpl.java:148)
at
org.apache.axis2.jaxws.message.impl.XMLSpineImpl._getBlockFromOMElement(XMLSpineImpl.java:594)
at
org.apache.axis2.jaxws.message.impl.XMLSpineImpl.getBodyBlock(XMLSpineImpl.java:334)
at
org.apache.axis2.jaxws.message.impl.XMLPartBase.getBodyBlock(XMLPartBase.java:521)
at
org.apache.axis2.jaxws.message.impl.MessageImpl.getBodyBlock(MessageImpl.java:657)
at
org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller.demarshalRequest(DocLitWrappedMethodMarshaller.java:233)
at
org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.createRequestParameters(JavaBeanDispatcher.java:266)
at
org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(JavaBeanDispatcher.java:80)
at
org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:109)
at
org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:159)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:167)
at
org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:267)
at
org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
at
org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
at
org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.bind.UnmarshalException: Namespace URIs and local
names to the unmarshaller needs to be interned.
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:609)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:114)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1015)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:452)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:433)
at
com.sun.xml.bind.v2.runtime.unmarshaller.MTOMDecorator.startElement(MTOMDecorator.java:107)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:275)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:209)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:358)
... 27 more
Caused by: javax.xml.bind.UnmarshalException: Namespace URIs and local
names to the unmarshaller needs to be interned.
... 38 more
--------------------------------------------------------------------
As far as I have looked into the issue, it seems that the exception is
generated after JAXBContextImpl's
selectRootLoader(UnmarshallingContext.State state, TagName tag) method
(line: 598) returns null (due to the QNameMap
being unable to find a matching entry, due to missing interning).
It seems that the tagName - generated in StAXStreamConnector's
handleStartElement() (line 271) isn't interned.
I'm guessing that either the assumption of JAXB that Woodstox interns
itself is wrong (StAXStreamConnector.create(XMLStreamreader, XmlVisitor)
(line 122) and it's purely coincidence that it works without rampart,
that woodstox doesn't intern even though it has the property set, or
that there is some other problem with the usage/configuration of jaxb in
axis2/rampart, or even that I missed something in the configuration.
The axis2-configuration (server) is available on
http://pastebin.com/f247fc7c5 - the client configuration is done by
http://pastebin.com/f5b066a20 - If a example project is needed, I can
provide one.
So if anyone has some help or ideas to offer, it'd be greatly appreciated!
Oh - if you patch jaxb to always use the InterningXmlVisitor it works
fine. If you only patch the jaxb of the server, the same problem happens
in the client as well (when it processes the response from the server).
It only happens when encryption/signing in rampart is used, with
only usernametoken and timestamp enabled it also works fine.
Greetings,
Florian roks