Petals SE JSR181

Improve the support of MTOM attachments

Details

  • Type: Improvement Request Improvement Request
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.1.2
  • Fix Version/s: 1.1.3
  • Component/s: None
  • Security Level: Public
  • Description:

    Currently, MTOM attachments are not correctly managed.

  • Environment:
    All

Activity

Hide
Vincent Zurczak added a comment - Tue, 19 Oct 2010 - 13:10:36 +0200 - edited

Commit # 16129 and 16130
The Axis2 configuration file was updated.
An attachment must be declared in the class as a DataHandler, annotated with @XmlMimeType("application/octet-stream")

Show
Vincent Zurczak added a comment - Tue, 19 Oct 2010 - 13:10:36 +0200 - edited Commit # 16129 and 16130 The Axis2 configuration file was updated. An attachment must be declared in the class as a DataHandler, annotated with @XmlMimeType("application/octet-stream")
Hide
Vincent Zurczak added a comment - Thu, 21 Oct 2010 - 10:17:15 +0200

I forgot to activate MTOM in the client's code...
The file was in fact sent in the message body.

When MTOM is enabled,we have this message on the client side:

Exception in thread "main" java.lang.IllegalArgumentException: faultCode argument for createFault was passed NULL
at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl.createFault(Unknown Source)
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy32.displayContent(Unknown Source)
at com.ebmwebsourcing.toto.TestAttachment_TestAttachmentPort_Client.main(TestAttachment_TestAttachmentPort_Client.java:66)

and this stack trace on the server side:

[Petals.Container.Components.petals-se-jsr181]-INFO 2010-10-21 10:15:24,000 Exch
ange petals:uid:B2742D778CC5A4311614807868488873 is started to be processed.
[Root]-SEVERE 2010-10-21 10:15:24,000 org.apache.axiom.om.OMException: A data ha
ndler was not found for content id cid:0808f6e4-1716-48a2-95c0-2a106b1c5acc@exam
ple.jaxws.sun.com
org.apache.axis2.AxisFault: org.apache.axiom.om.OMException: A data handler was
not found for content id cid:0808f6e4-1716-48a2-95c0-2a106b1c5acc@example.jaxws.
sun.com
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa
geReceiver.java:218)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
        at org.ow2.petals.se.jsr181.Jsr181JBIListener.onJBIMessage(Jsr181JBIList
ener.java:137)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.p
rocessInOutAsProvider(MessageExchangeProcessor.java:637)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.p
rocessAsProvider(MessageExchangeProcessor.java:372)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.p
rocess(MessageExchangeProcessor.java:234)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.r
un(MessageExchangeProcessor.java:177)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: A
data handler was not found for content id cid:0808f6e4-1716-48a2-95c0-2a106b1c5a
cc@example.jaxws.sun.com
        at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Exc
eptionFactory.java:175)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
tionFactory.java:70)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
tionFactory.java:128)
        at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMinimalMethod
Marshaller.demarshalRequest(DocLitWrappedMinimalMethodMarshaller.java:221)
        at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.createReq
uestParameters(JavaBeanDispatcher.java:266)
        at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(Ja
vaBeanDispatcher.java:80)
        at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointContr
oller.java:109)
        at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa
geReceiver.java:159)
        ... 9 more
Caused by: org.apache.axiom.om.OMException: A data handler was not found for con
tent id cid:0808f6e4-1716-48a2-95c0-2a106b1c5acc@example.jaxws.sun.com
        at org.apache.axis2.datasource.jaxb.JAXBAttachmentUnmarshaller.getAttach
mentAsDataHandler(JAXBAttachmentUnmarshaller.java:113)
        at com.sun.xml.bind.v2.runtime.unmarshaller.MTOMDecorator.startElement(M
TOMDecorator.java:96)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleSt
artElement(StAXStreamConnector.java:275)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(S
tAXStreamConnector.java:209)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
UnmarshallerImpl.java:358)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(U
nmarshallerImpl.java:337)
        at org.apache.axis2.datasource.jaxb.JAXBDSContext$2.run(JAXBDSContext.ja
va:528)
        at org.apache.axis2.java.security.AccessController.doPrivileged(AccessCo
ntroller.java:76)
        at org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshalByType(JAXBDS
Context.java:457)
        at org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshal(JAXBDSContex
t.java:296)
        at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._getBOF
romReader(JAXBBlockImpl.java:96)
        at org.apache.axis2.jaxws.message.impl.BlockImpl._getBOFromOM(BlockImpl.
java:475)
        at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._getBOF
romOM(JAXBBlockImpl.java:136)
        at org.apache.axis2.jaxws.message.impl.BlockImpl.getBusinessObject(Block
Impl.java:148)
        at org.apache.axis2.jaxws.message.impl.XMLSpineImpl._getBlockFromOMEleme
nt(XMLSpineImpl.java:594)
        at org.apache.axis2.jaxws.message.impl.XMLSpineImpl.getBodyBlock(XMLSpin
eImpl.java:334)
        at org.apache.axis2.jaxws.message.impl.XMLPartBase.getBodyBlock(XMLPartB
ase.java:521)
        at org.apache.axis2.jaxws.message.impl.MessageImpl.getBodyBlock(MessageI
mpl.java:657)
        at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.getP
DElements(MethodMarshallerUtils.java:329)
        at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMinimalMethod
Marshaller.demarshalRequest(DocLitWrappedMinimalMethodMarshaller.java:196)
        ... 13 more
[Petals.Container.Components.petals-se-jsr181]-INFO 2010-10-21 10:15:24,046 Exch
ange petals:uid:B2742D778CC5A4311614807868488873 encountered a problem. org.apac
he.axiom.om.OMException: A data handler was not found for content id cid:0808f6e
4-1716-48a2-95c0-2a106b1c5acc@example.jaxws.sun.com
Show
Vincent Zurczak added a comment - Thu, 21 Oct 2010 - 10:17:15 +0200 I forgot to activate MTOM in the client's code... The file was in fact sent in the message body. When MTOM is enabled,we have this message on the client side:
Exception in thread "main" java.lang.IllegalArgumentException: faultCode argument for createFault was passed NULL at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl.createFault(Unknown Source) at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown Source) at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown Source) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source) at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source) at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source) at $Proxy32.displayContent(Unknown Source) at com.ebmwebsourcing.toto.TestAttachment_TestAttachmentPort_Client.main(TestAttachment_TestAttachmentPort_Client.java:66)
and this stack trace on the server side:
[Petals.Container.Components.petals-se-jsr181]-INFO 2010-10-21 10:15:24,000 Exch
ange petals:uid:B2742D778CC5A4311614807868488873 is started to be processed.
[Root]-SEVERE 2010-10-21 10:15:24,000 org.apache.axiom.om.OMException: A data ha
ndler was not found for content id cid:0808f6e4-1716-48a2-95c0-2a106b1c5acc@exam
ple.jaxws.sun.com
org.apache.axis2.AxisFault: org.apache.axiom.om.OMException: A data handler was
not found for content id cid:0808f6e4-1716-48a2-95c0-2a106b1c5acc@example.jaxws.
sun.com
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
        at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa
geReceiver.java:218)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
        at org.ow2.petals.se.jsr181.Jsr181JBIListener.onJBIMessage(Jsr181JBIList
ener.java:137)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.p
rocessInOutAsProvider(MessageExchangeProcessor.java:637)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.p
rocessAsProvider(MessageExchangeProcessor.java:372)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.p
rocess(MessageExchangeProcessor.java:234)
        at org.ow2.petals.component.framework.process.MessageExchangeProcessor.r
un(MessageExchangeProcessor.java:177)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.ws.WebServiceException: org.apache.axiom.om.OMException: A
data handler was not found for content id cid:0808f6e4-1716-48a2-95c0-2a106b1c5a
cc@example.jaxws.sun.com
        at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(Exc
eptionFactory.java:175)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
tionFactory.java:70)
        at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(Excep
tionFactory.java:128)
        at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMinimalMethod
Marshaller.demarshalRequest(DocLitWrappedMinimalMethodMarshaller.java:221)
        at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.createReq
uestParameters(JavaBeanDispatcher.java:266)
        at org.apache.axis2.jaxws.server.dispatcher.JavaBeanDispatcher.invoke(Ja
vaBeanDispatcher.java:80)
        at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointContr
oller.java:109)
        at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessa
geReceiver.java:159)
        ... 9 more
Caused by: org.apache.axiom.om.OMException: A data handler was not found for con
tent id cid:0808f6e4-1716-48a2-95c0-2a106b1c5acc@example.jaxws.sun.com
        at org.apache.axis2.datasource.jaxb.JAXBAttachmentUnmarshaller.getAttach
mentAsDataHandler(JAXBAttachmentUnmarshaller.java:113)
        at com.sun.xml.bind.v2.runtime.unmarshaller.MTOMDecorator.startElement(M
TOMDecorator.java:96)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleSt
artElement(StAXStreamConnector.java:275)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(S
tAXStreamConnector.java:209)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(
UnmarshallerImpl.java:358)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(U
nmarshallerImpl.java:337)
        at org.apache.axis2.datasource.jaxb.JAXBDSContext$2.run(JAXBDSContext.ja
va:528)
        at org.apache.axis2.java.security.AccessController.doPrivileged(AccessCo
ntroller.java:76)
        at org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshalByType(JAXBDS
Context.java:457)
        at org.apache.axis2.datasource.jaxb.JAXBDSContext.unmarshal(JAXBDSContex
t.java:296)
        at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._getBOF
romReader(JAXBBlockImpl.java:96)
        at org.apache.axis2.jaxws.message.impl.BlockImpl._getBOFromOM(BlockImpl.
java:475)
        at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._getBOF
romOM(JAXBBlockImpl.java:136)
        at org.apache.axis2.jaxws.message.impl.BlockImpl.getBusinessObject(Block
Impl.java:148)
        at org.apache.axis2.jaxws.message.impl.XMLSpineImpl._getBlockFromOMEleme
nt(XMLSpineImpl.java:594)
        at org.apache.axis2.jaxws.message.impl.XMLSpineImpl.getBodyBlock(XMLSpin
eImpl.java:334)
        at org.apache.axis2.jaxws.message.impl.XMLPartBase.getBodyBlock(XMLPartB
ase.java:521)
        at org.apache.axis2.jaxws.message.impl.MessageImpl.getBodyBlock(MessageI
mpl.java:657)
        at org.apache.axis2.jaxws.marshaller.impl.alt.MethodMarshallerUtils.getP
DElements(MethodMarshallerUtils.java:329)
        at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMinimalMethod
Marshaller.demarshalRequest(DocLitWrappedMinimalMethodMarshaller.java:196)
        ... 13 more
[Petals.Container.Components.petals-se-jsr181]-INFO 2010-10-21 10:15:24,046 Exch
ange petals:uid:B2742D778CC5A4311614807868488873 encountered a problem. org.apac
he.axiom.om.OMException: A data handler was not found for content id cid:0808f6e
4-1716-48a2-95c0-2a106b1c5acc@example.jaxws.sun.com
Hide
Vincent Zurczak added a comment - Thu, 21 Oct 2010 - 13:07:42 +0200

Commit # 16146
Support for both SwA and MTOM attachments

Show
Vincent Zurczak added a comment - Thu, 21 Oct 2010 - 13:07:42 +0200 Commit # 16146 Support for both SwA and MTOM attachments

People

Dates

  • Created:
    Fri, 23 Jul 2010 - 12:54:16 +0200
    Updated:
    Thu, 21 Oct 2010 - 13:07:46 +0200
    Resolved:
    Thu, 21 Oct 2010 - 13:07:42 +0200