You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Rajith Attapattu (JIRA)" <ji...@apache.org> on 2006/09/05 18:26:22 UTC

[jira] Created: (WSCOMMONS-84) Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)

Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)
-------------------------------------------------------------------------------------------------

                 Key: WSCOMMONS-84
                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
             Project: WS-Commons
          Issue Type: Bug
         Environment: Here is my environment
==================================
stax.api.version=1.0.1
stax.impl.artifactid=wstx
stax.impl.groupid=woodstox
stax.impl.version=asl-3.0.0
stax_utils.version=20060501
XmlSchema.version=SNAPSHOT

JDK 1.5 (sun) , fc 5 (fedora)
===================================
            Reporter: Rajith Attapattu
         Attachments: source.tar.gz

I get the following exception when I try to print my SOAP message.

I am wondering what is triggering this. I have attached my code sample as well, in case u wanna have a look at it.

 Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
    [java]      at java.lang.String.valueOf(String.java:2615)
    [java]      at java.io.PrintStream.print(PrintStream.java:616)
    [java]      at java.io.PrintStream.println(PrintStream.java:753)
    [java]      at sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
    [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
    [java]      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
    [java]      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
    [java]      at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
    [java]      at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
    [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
    [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
    [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
    [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
    [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-84) Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-84?page=all ]

Rajith Attapattu updated WSCOMMONS-84:
--------------------------------------

    Attachment: TravelAgenClient.java

 Eran,
 There is an error in the TravelClient I have attached in the src.tar.gz file
  
  So I am attaching the correct file. Please note that it contains both async and sycn invocation using serviceClient.sendReceiveNonBlocking and serviceClient.sendReceive.

  If u run with asycn in debug mode using eclipse this exception happens
 if I just run it then there is no exception, however the request doesn't reach the endpoint.
 (verified this with TCPMon)

 Now if u comment out the asycn invocation and run it synchronously u get the exception right away.

note: make sure u change the repo path before you run the example
ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("/home/rattapat/axis2-repo",null);
  
 

> Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-84
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Here is my environment
> ==================================
> stax.api.version=1.0.1
> stax.impl.artifactid=wstx
> stax.impl.groupid=woodstox
> stax.impl.version=asl-3.0.0
> stax_utils.version=20060501
> XmlSchema.version=SNAPSHOT
> JDK 1.5 (sun) , fc 5 (fedora)
> ===================================
>            Reporter: Rajith Attapattu
>         Attachments: source.tar.gz, src.tar.gz, TravelAgenClient.java
>
>
> I get the following exception when I try to print my SOAP message.
> I am wondering what is triggering this. I have attached my code sample as well, in case u wanna have a look at it.
>  Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.io.PrintStream.print(PrintStream.java:616)
>     [java]      at java.io.PrintStream.println(PrintStream.java:753)
>     [java]      at sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
>     [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-84) Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-84?page=all ]

Eran Chinthaka updated WSCOMMONS-84:
------------------------------------

    Component/s: AXIOM

> Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-84
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Here is my environment
> ==================================
> stax.api.version=1.0.1
> stax.impl.artifactid=wstx
> stax.impl.groupid=woodstox
> stax.impl.version=asl-3.0.0
> stax_utils.version=20060501
> XmlSchema.version=SNAPSHOT
> JDK 1.5 (sun) , fc 5 (fedora)
> ===================================
>            Reporter: Rajith Attapattu
>         Attachments: source.tar.gz
>
>
> I get the following exception when I try to print my SOAP message.
> I am wondering what is triggering this. I have attached my code sample as well, in case u wanna have a look at it.
>  Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.io.PrintStream.print(PrintStream.java:616)
>     [java]      at java.io.PrintStream.println(PrintStream.java:753)
>     [java]      at sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
>     [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Updated: (WSCOMMONS-84) Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-84?page=all ]

Rajith Attapattu updated WSCOMMONS-84:
--------------------------------------

    Attachment: src.tar.gz

Eran,

I have the complete code attached.
you should be able run this code if u have the axis2 related jars in your classpath.

I get the exception when I try to run the TravelClient.java

Your input and help in resolving the issue is greatly appreciated.

Thanks,

Rajith 

> Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-84
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Here is my environment
> ==================================
> stax.api.version=1.0.1
> stax.impl.artifactid=wstx
> stax.impl.groupid=woodstox
> stax.impl.version=asl-3.0.0
> stax_utils.version=20060501
> XmlSchema.version=SNAPSHOT
> JDK 1.5 (sun) , fc 5 (fedora)
> ===================================
>            Reporter: Rajith Attapattu
>         Attachments: source.tar.gz, src.tar.gz
>
>
> I get the following exception when I try to print my SOAP message.
> I am wondering what is triggering this. I have attached my code sample as well, in case u wanna have a look at it.
>  Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.io.PrintStream.print(PrintStream.java:616)
>     [java]      at java.io.PrintStream.println(PrintStream.java:753)
>     [java]      at sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
>     [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Commented: (WSCOMMONS-84) Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/WSCOMMONS-84?page=comments#action_12432944 ] 
            
Eran Chinthaka commented on WSCOMMONS-84:
-----------------------------------------

This happens when some one tries to re-use an instance of XMLStreamWriter.

I can not re-create the problem, as some of the classes are missing. Its better if you can help us re-create the problem, by sending a small test case.

Thanks,
Chinthaka

> Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-84
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Here is my environment
> ==================================
> stax.api.version=1.0.1
> stax.impl.artifactid=wstx
> stax.impl.groupid=woodstox
> stax.impl.version=asl-3.0.0
> stax_utils.version=20060501
> XmlSchema.version=SNAPSHOT
> JDK 1.5 (sun) , fc 5 (fedora)
> ===================================
>            Reporter: Rajith Attapattu
>         Attachments: source.tar.gz
>
>
> I get the following exception when I try to print my SOAP message.
> I am wondering what is triggering this. I have attached my code sample as well, in case u wanna have a look at it.
>  Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.io.PrintStream.print(PrintStream.java:616)
>     [java]      at java.io.PrintStream.println(PrintStream.java:753)
>     [java]      at sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
>     [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Resolved: (WSCOMMONS-84) Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)

Posted by "Rajith Attapattu (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/WSCOMMONS-84?page=all ]

Rajith Attapattu resolved WSCOMMONS-84.
---------------------------------------

    Resolution: Invalid

Hi Eran,

I finnaly tracked down the problem.

My code was creating a SOAP envelope (as a mistake) and then passing that into the serviceClient.sendReceive(payload).
However the code only expects a payload (not the whole envelope) so it also creates a SOAPEnvelope and add the payload as the SOAP body.

but now the SOAP envelope is duplicated and that was why this error was thrown "Can not serialize OM Element Envelope".

the moment I removed the SOAP envelope part from my code it worked fine.

So maybe we should resolve this as it is not a bug. 

Regards,
Rajith


> Cannot serialize SOAP message (java.lang.RuntimeException: Can not serialize OM Element Envelope)
> -------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-84
>                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-84
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Here is my environment
> ==================================
> stax.api.version=1.0.1
> stax.impl.artifactid=wstx
> stax.impl.groupid=woodstox
> stax.impl.version=asl-3.0.0
> stax_utils.version=20060501
> XmlSchema.version=SNAPSHOT
> JDK 1.5 (sun) , fc 5 (fedora)
> ===================================
>            Reporter: Rajith Attapattu
>         Attachments: source.tar.gz, src.tar.gz, TravelAgenClient.java
>
>
> I get the following exception when I try to print my SOAP message.
> I am wondering what is triggering this. I have attached my code sample as well, in case u wanna have a look at it.
>  Exception in thread "main" java.lang.RuntimeException: Can not serialize OM Element Envelope
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:893)
>     [java]      at java.lang.String.valueOf(String.java:2615)
>     [java]      at java.io.PrintStream.print(PrintStream.java:616)
>     [java]      at java.io.PrintStream.println(PrintStream.java:753)
>     [java]      at sample.enterprise.client.TravelAgenClient.main(TravelAgenClient.java:47)
>     [java] Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1691)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:720)
>     [java]      at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:708)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:173)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:763)
>     [java]      at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:748)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:324)
>     [java]      at org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:362)
>     [java]      at org.apache.axiom.om.impl.llom.OMElementImpl.toString(OMElementImpl.java:891)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org