[ 
https://issues.apache.org/jira/browse/WSCOMMONS-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689882#action_12689882
 ] 

Andreas Veithen commented on WSCOMMONS-455:
-------------------------------------------

Can you try to identify the exception that causes the parserError flag to be 
set?

> SMTP transport does not work with Security
> ------------------------------------------
>
>                 Key: WSCOMMONS-455
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-455
>             Project: WS-Commons
>          Issue Type: Bug
>            Reporter: Amila Chinthaka Suriarachchi
>
> I ran a simple message invocation with security. At the server side it gets 
> the message correctly and sends the response correctly. However at the client 
> side when the security try to build the envelop it gives this exception.
> [ERROR] Error in extracting message properties
> org.apache.axis2.AxisFault: Error in extracting message properties
>       at 
> org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:172)
>       at 
> org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:99)
>       at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
>       at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251)
>       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:160)
>       at 
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
>       at 
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
>       at 
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
>       at 
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
>       at 
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:539)
>       at 
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:520)
>       at 
> org.wso2.mercury.test.client.interop.SMTPInteropts.testSecurity(SMTPInteropts.java:330)
>       at 
> org.wso2.mercury.test.client.interop.SMTPInteropts.main(SMTPInteropts.java:415)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: org.apache.rampart.RampartException: Error in extracting message 
> properties
>       at 
> org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:370)
>       at org.apache.rampart.RampartEngine.process(RampartEngine.java:71)
>       at 
> org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:92)
>       ... 16 more
> Caused by: org.apache.ws.security.WSSecurityException: Error in converting 
> SOAP Envelope to Document; nested exception is: 
>       org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: 
> Trying to read events from a parser that already reported an error before
>       at 
> org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:161)
>       at 
> org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:167)
>       ... 18 more
> Caused by: org.apache.axiom.om.OMException: 
> javax.xml.stream.XMLStreamException: Trying to read events from a parser that 
> already reported an error before
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:260)
>       at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:335)
>       at 
> org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:737)
>       at 
> org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:96)
>       ... 19 more
> Caused by: javax.xml.stream.XMLStreamException: Trying to read events from a 
> parser that already reported an error before
>       at 
> org.apache.axiom.om.impl.builder.SafeXMLStreamReader.checkError(SafeXMLStreamReader.java:67)
>       at 
> org.apache.axiom.om.impl.builder.SafeXMLStreamReader.next(SafeXMLStreamReader.java:181)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:597)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:172)
>       ... 22 more
> When I build the message at the SMTP transport level i.e. at
> MailTransportListener.java : 330
> try {
>                 
> msgContext.setEnvelope(TransportUtils.createSOAPMessage(msgContext, in, 
> contentType));
>                 msgContext.getEnvelope().build();
>             } catch (XMLStreamException ex) {
>                 handleException("Error parsing message", ex);
>             }
> it works fine. Anyway what rampart does also is build the message. 
> further debugging I saw that parserError
>  private void checkError() throws XMLStreamException {
>         if (parserError) {
>             throw new XMLStreamException(
>                     "Trying to read events from a parser that already 
> reported an error before");
>         }
>     }
> in SafeXMLStreamReader has already set to true.
> Has anyone be able to do a secure invocation using SMTP transport?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to