You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com> on 2013/03/20 16:21:41 UTC

WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }

RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Posted by Martin Gainty <mg...@hotmail.com>.
com.sample.test.webservices.impl.participant.Notify.class, reason why the last class parameter has a trailing comma

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 From: Sumit.Shah@cgifederal.com
To: java-user@axis.apache.org
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation
Date: Wed, 20 Mar 2013 15:21:41 +0000









Hi,
 
I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:
 
If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

 
private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,
                        
                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }
 		 	   		  

RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
Hi Andreas,

Just want to add to this...I have found that https://issues.apache.org/jira/browse/AXIS2-5215 caused the Java2WSDL change from 1.6.0 to 1.6.2, that I describe below. So it seems like a fix is required in XSL.

Sumit

From: Shah, Sumit (CGI Federal)
Sent: Thursday, March 21, 2013 12:46 PM
To: java-user@axis.apache.org
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code


Thanks Andreas. I am chaining my latest response with yours. I see your point and helps me understand what I am noticing with this. Basically, if you notice the wsdl change I mention below, in that case I see why the JaxbRIDatabindingTemplate.xsl is failing. This is a guess, but FWIW...the wsdl generated for a one way operation using Java2WSDL contains a 'null' message for the output as shown below:


<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
            <wsdl:output message="ns:null" wsaw:Action="urn:notifyResponse"/>   <!-This is what I refer to-->
            <wsdl:fault message="ns:RecoverableFault" name="RecoverableFault" wsaw:Action="urn:notifyRecoverableFault"/>
            <wsdl:fault message="ns:UnrecoverableFault" name="UnrecoverableFault" wsaw:Action="urn:notifyUnrecoverableFault"/>
        </wsdl:operation>


If you look at the wsdl snippet above and the code in the JaxbRIDatabindingTemplate.xsl, after writing Notify.class, (because probably at that point in the order Notify.class is not the last one) and is expecting to write NotifyResponse.class as the last one, but the check '<xsl:if test="@type!=''">' fails because the output message/type is null and hence the trailing comma.


try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }





If I remove the <wsdl:output> and the faults from the <wsdl:operation>, I do not see this issue. But in my case the wsdl is generated using Java2WSDL and I cannot manually change it since it is part of a continuous integration environment. So there are two options I am thinking:

1.  Fix WSDL generation for one way operations and not generate the output and fault messages. Apparently, the wsdl generation under 1.6.0 does not write the output and fault messages for one-way operations.

2.  Fix the XSL to account for such operations.



Please let me know what you think, I would highly appreciate your suggestion.



Thanks

Sumit





-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
Sent: Thursday, March 21, 2013 4:35 AM
To: java-user
Subject: Re: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code



That's simply because the code in JaxbRIDatabindingTemplate.xsl is incorrect. position() != last() checks if the current node is the last node, but the expression appears in an <xsl:if> block. So, if the last node doesn't satisfy the condition of the <xsl:if> block, then an extra comma is generated and the generated code won't compile.



Andreas




From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:41 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

What I have found out though is the following, The class(com.sample.test.webservices.impl.participant.Notify.class) is question is for a one way operation (notify). The wsdl for that operation looks like:

<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
            <wsdl:output message="ns:null" wsaw:Action="urn:notifyResponse"/>
            <wsdl:fault message="ns:RecoverableFault" name="RecoverableFault" wsaw:Action="urn:notifyRecoverableFault"/>
            <wsdl:fault message="ns:UnrecoverableFault" name="UnrecoverableFault" wsaw:Action="urn:notifyUnrecoverableFault"/>
        </wsdl:operation>

<wsdl:operation name="notify">
            <soap12:operation soapAction="urn:coretest:ParticipantService#notify" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="UnrecoverableFault">
                <soap12:fault use="literal" name="UnrecoverableFault"/>
            </wsdl:fault>
            <wsdl:fault name="RecoverableFault">
                <soap12:fault use="literal" name="RecoverableFault"/>
            </wsdl:fault>
        </wsdl:operation>

If I remove the output and the fault messages from the operation, I do not see the same issue.

<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
        </wsdl:operation>

And
<wsdl:operation name="notify">
            <soap:operation soapAction="urn:coretest:ParticipantService#notify" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>

However, some of the other wsdls that have the same operation along with the output and fault messages work fine. So the behavior seems extremely strange to me.

Thanks
Sumit


From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 10:43 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

That is precisely what I am trying to find out why it is adding the comma after the last class parameter.


Thanks
Sumit

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Wednesday, March 20, 2013 7:49 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

com.sample.test.webservices.impl.participant.Notify.class,

reason why the last class parameter has a trailing comma

Martin

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 6:20 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I did some research and it's the code/XSL in JaxbRIDatabindingTemplate.xsl that is writing out the portion of the stub that causing the compilation issue. Unless a concurrency issue, I wonder why consistently in couple of cases the 'position() != last()' seems to be 'true' when it should be false. And hence the additional comma at the end of the last element in the array. I would appreciate any pointers.

'
        private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                     }
        }
'
Thanks
Sumit

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 3:27 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I take the WSImport part back. It is actually happening with WSDL2Code. It does not happen if I use the WSDL2Code with Axis2 1.6.0.

The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom 1.2.14. Is anyone aware of the issue with 1.6.2?

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:22 AM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }

RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
Thanks Andreas. I am chaining my latest response with yours. I see your point and helps me understand what I am noticing with this. Basically, if you notice the wsdl change I mention below, in that case I see why the JaxbRIDatabindingTemplate.xsl is failing. This is a guess, but FWIW...the wsdl generated for a one way operation using Java2WSDL contains a 'null' message for the output as shown below:


<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
            <wsdl:output message="ns:null" wsaw:Action="urn:notifyResponse"/>   <!-This is what I refer to-->
            <wsdl:fault message="ns:RecoverableFault" name="RecoverableFault" wsaw:Action="urn:notifyRecoverableFault"/>
            <wsdl:fault message="ns:UnrecoverableFault" name="UnrecoverableFault" wsaw:Action="urn:notifyUnrecoverableFault"/>
        </wsdl:operation>


If you look at the wsdl snippet above and the code in the JaxbRIDatabindingTemplate.xsl, after writing Notify.class, (because probably at that point in the order Notify.class is not the last one) and is expecting to write NotifyResponse.class as the last one, but the check '<xsl:if test="@type!=''">' fails because the output message/type is null and hence the trailing comma.


try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }





If I remove the <wsdl:output> and the faults from the <wsdl:operation>, I do not see this issue. But in my case the wsdl is generated using Java2WSDL and I cannot manually change it since it is part of a continuous integration environment. So there are two options I am thinking:

1.  Fix WSDL generation for one way operations and not generate the output and fault messages. Apparently, the wsdl generation under 1.6.0 does not write the output and fault messages for one-way operations.

2.  Fix the XSL to account for such operations.



Please let me know what you think, I would highly appreciate your suggestion.



Thanks

Sumit





-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
Sent: Thursday, March 21, 2013 4:35 AM
To: java-user
Subject: Re: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code



That's simply because the code in JaxbRIDatabindingTemplate.xsl is incorrect. position() != last() checks if the current node is the last node, but the expression appears in an <xsl:if> block. So, if the last node doesn't satisfy the condition of the <xsl:if> block, then an extra comma is generated and the generated code won't compile.



Andreas




From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:41 PM
To: java-user@axis.apache.org
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

What I have found out though is the following, The class(com.sample.test.webservices.impl.participant.Notify.class) is question is for a one way operation (notify). The wsdl for that operation looks like:

<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
            <wsdl:output message="ns:null" wsaw:Action="urn:notifyResponse"/>
            <wsdl:fault message="ns:RecoverableFault" name="RecoverableFault" wsaw:Action="urn:notifyRecoverableFault"/>
            <wsdl:fault message="ns:UnrecoverableFault" name="UnrecoverableFault" wsaw:Action="urn:notifyUnrecoverableFault"/>
        </wsdl:operation>

<wsdl:operation name="notify">
            <soap12:operation soapAction="urn:coretest:ParticipantService#notify" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="UnrecoverableFault">
                <soap12:fault use="literal" name="UnrecoverableFault"/>
            </wsdl:fault>
            <wsdl:fault name="RecoverableFault">
                <soap12:fault use="literal" name="RecoverableFault"/>
            </wsdl:fault>
        </wsdl:operation>

If I remove the output and the fault messages from the operation, I do not see the same issue.

<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
        </wsdl:operation>

And
<wsdl:operation name="notify">
            <soap:operation soapAction="urn:coretest:ParticipantService#notify" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>

However, some of the other wsdls that have the same operation along with the output and fault messages work fine. So the behavior seems extremely strange to me.

Thanks
Sumit


From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 10:43 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

That is precisely what I am trying to find out why it is adding the comma after the last class parameter.


Thanks
Sumit

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Wednesday, March 20, 2013 7:49 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

com.sample.test.webservices.impl.participant.Notify.class,

reason why the last class parameter has a trailing comma

Martin

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 6:20 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I did some research and it's the code/XSL in JaxbRIDatabindingTemplate.xsl that is writing out the portion of the stub that causing the compilation issue. Unless a concurrency issue, I wonder why consistently in couple of cases the 'position() != last()' seems to be 'true' when it should be false. And hence the additional comma at the end of the last element in the array. I would appreciate any pointers.

'
        private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                     }
        }
'
Thanks
Sumit

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 3:27 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I take the WSImport part back. It is actually happening with WSDL2Code. It does not happen if I use the WSDL2Code with Axis2 1.6.0.

The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom 1.2.14. Is anyone aware of the issue with 1.6.2?

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:22 AM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }

RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
What I have found out though is the following, The class(com.sample.test.webservices.impl.participant.Notify.class) is question is for a one way operation (notify). The wsdl for that operation looks like:

<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
            <wsdl:output message="ns:null" wsaw:Action="urn:notifyResponse"/>
            <wsdl:fault message="ns:RecoverableFault" name="RecoverableFault" wsaw:Action="urn:notifyRecoverableFault"/>
            <wsdl:fault message="ns:UnrecoverableFault" name="UnrecoverableFault" wsaw:Action="urn:notifyUnrecoverableFault"/>
        </wsdl:operation>

<wsdl:operation name="notify">
            <soap12:operation soapAction="urn:coretest:ParticipantService#notify" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
            <wsdl:fault name="UnrecoverableFault">
                <soap12:fault use="literal" name="UnrecoverableFault"/>
            </wsdl:fault>
            <wsdl:fault name="RecoverableFault">
                <soap12:fault use="literal" name="RecoverableFault"/>
            </wsdl:fault>
        </wsdl:operation>
If I remove the output and the fault messages from the operation, I do not see the same issue.

<wsdl:operation name="notify">
            <wsdl:input message="ns:notifyRequest" wsaw:Action="urn:coretest:ParticipantService#notify"/>
        </wsdl:operation>

And
<wsdl:operation name="notify">
            <soap:operation soapAction="urn:coretest:ParticipantService#notify" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
        </wsdl:operation>

However, some of the other wsdls that have the same operation along with the output and fault messages work fine. So the behavior seems extremely strange to me.

Thanks
Sumit


From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 10:43 PM
To: java-user@axis.apache.org
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

That is precisely what I am trying to find out why it is adding the comma after the last class parameter.


Thanks
Sumit

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Wednesday, March 20, 2013 7:49 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

com.sample.test.webservices.impl.participant.Notify.class,

reason why the last class parameter has a trailing comma

Martin

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 6:20 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I did some research and it's the code/XSL in JaxbRIDatabindingTemplate.xsl that is writing out the portion of the stub that causing the compilation issue. Unless a concurrency issue, I wonder why consistently in couple of cases the 'position() != last()' seems to be 'true' when it should be false. And hence the additional comma at the end of the last element in the array. I would appreciate any pointers.

'
        private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                     }
        }
'
Thanks
Sumit

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 3:27 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I take the WSImport part back. It is actually happening with WSDL2Code. It does not happen if I use the WSDL2Code with Axis2 1.6.0.

The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom 1.2.14. Is anyone aware of the issue with 1.6.2?

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:22 AM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }

RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
That is precisely what I am trying to find out why it is adding the comma after the last class parameter.


Thanks
Sumit

From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Wednesday, March 20, 2013 7:49 PM
To: java-user@axis.apache.org
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

com.sample.test.webservices.impl.participant.Notify.class,

reason why the last class parameter has a trailing comma

Martin


From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 6:20 PM
To: java-user@axis.apache.org
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I did some research and it's the code/XSL in JaxbRIDatabindingTemplate.xsl that is writing out the portion of the stub that causing the compilation issue. Unless a concurrency issue, I wonder why consistently in couple of cases the 'position() != last()' seems to be 'true' when it should be false. And hence the additional comma at the end of the last element in the array. I would appreciate any pointers.

'
        private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                     }
        }
'
Thanks
Sumit

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 3:27 PM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I take the WSImport part back. It is actually happening with WSDL2Code. It does not happen if I use the WSDL2Code with Axis2 1.6.0.

The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom 1.2.14. Is anyone aware of the issue with 1.6.2?

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:22 AM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }

Re: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by Andreas Veithen <an...@gmail.com>.
That's simply because the code in JaxbRIDatabindingTemplate.xsl is
incorrect. position() != last() checks if the current node is the last
node, but the expression appears in an <xsl:if> block. So, if the last
node doesn't satisfy the condition of the <xsl:if> block, then an
extra comma is generated and the generated code won't compile.

Andreas

On Wed, Mar 20, 2013 at 11:20 PM, Shah, Sumit (CGI Federal)
<Su...@cgifederal.com> wrote:
> I did some research and it’s the code/XSL in JaxbRIDatabindingTemplate.xsl
> that is writing out the portion of the stub that causing the compilation
> issue. Unless a concurrency issue, I wonder why consistently in couple of
> cases the ‘position() != last()’ seems to be ‘true’ when it should be false.
> And hence the additional comma at the end of the last element in the array.
> I would appreciate any pointers.
>
>
>
> ‘
>
>         private static final javax.xml.bind.JAXBContext wsContext;
>
>         static {
>
>             javax.xml.bind.JAXBContext jc;
>
>             jc = null;
>
>             try {
>
>                            jc = javax.xml.bind.JAXBContext.newInstance(
>
>             <xsl:for-each select="param[not(@type =
> preceding-sibling::param/@type)]">
>
>                 <xsl:if test="@type!=''">
>
>                         <xsl:value-of select="@type"/>.class<xsl:if
> test="position() != last()">,
>
>                         </xsl:if>
>
>                 </xsl:if>
>
>             </xsl:for-each>
>
>                            );
>
>             }
>
>             catch ( javax.xml.bind.JAXBException ex ) {
>
>                 System.err.println("Unable to create JAXBContext: " +
> ex.getMessage());
>
>                 ex.printStackTrace(System.err);
>
>                 Runtime.getRuntime().exit(-1);
>
>             }
>
>             finally {
>
>                 wsContext = jc;
>
>                      }
>
>         }
>
> ’
>
> Thanks
>
> Sumit
>
>
>
> From: Shah, Sumit (CGI Federal)
> Sent: Wednesday, March 20, 2013 3:27 PM
> To: java-user@axis.apache.org
> Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails
> compilation - Update: Actually issue occurring in WSDL2Code
>
>
>
> I take the WSImport part back. It is actually happening with WSDL2Code. It
> does not happen if I use the WSDL2Code with Axis2 1.6.0.
>
>
>
> The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom
> 1.2.14. Is anyone aware of the issue with 1.6.2?
>
>
>
> From: Shah, Sumit (CGI Federal)
> Sent: Wednesday, March 20, 2013 11:22 AM
> To: java-user@axis.apache.org
> Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails
> compilation
>
>
>
> Hi,
>
>
>
> I am using WSImport to generate the client stubs for a bunch of wsdl files.
> After the generation the code fails to compile. I am using this with Axis2
> 1.6.2. The following code block fails:
>
>
>
> If you notice: the line:
> 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a
> comma that shouldn't be there. Ironically it only happens for 2 of the 10 or
> so wsdl files I have.  Any information would be appreciated.
>
>
>
> private static final javax.xml.bind.JAXBContext wsContext;
>
>         static {
>
>             javax.xml.bind.JAXBContext jc;
>
>             jc = null;
>
>             try {
>
>                                                                 jc =
> javax.xml.bind.JAXBContext.newInstance(
>
>             com.sample.test.webservices.impl.participant.Add.class,
>
>
> com.sample.test.webservices.impl.participant.AddResponse.class,
>
>
> com.sample.test.webservices.exceptions.UnrecoverableFault.class,
>
>
> com.sample.test.webservices.exceptions.RecoverableFault.class,
>
>
> com.sample.test.webservices.impl.participant.Delete.class,
>
>
> com.sample.test.webservices.impl.participant.DeleteResponse.class,
>
>
> com.sample.test.webservices.impl.participant.Select.class,
>
>
> com.sample.test.webservices.impl.participant.SelectResponse.class,
>
>
> com.sample.test.webservices.impl.participant.AddChange.class,
>
>
> com.sample.test.webservices.impl.participant.AddChangeResponse.class,
>
>
> com.sample.test.webservices.impl.participant.Query.class,
>
>
> com.sample.test.webservices.impl.participant.QueryResponse.class,
>
>
> com.sample.test.webservices.impl.participant.Update.class,
>
>
> com.sample.test.webservices.impl.participant.UpdateResponse.class,
>
>
> com.sample.test.webservices.impl.participant.Change.class,
>
>
> com.sample.test.webservices.impl.participant.ChangeResponse.class,
>
>
> com.sample.test.webservices.impl.participant.Synchronize.class,
>
>
> com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
>
>
> com.sample.test.webservices.impl.participant.Notify.class,
>
>
>
>                                                                 );
>
>             }
>
>             catch ( javax.xml.bind.JAXBException ex ) {
>
>                 System.err.println("Unable to create JAXBContext: " +
> ex.getMessage());
>
>                 ex.printStackTrace(System.err);
>
>                 Runtime.getRuntime().exit(-1);
>
>             }
>
>             finally {
>
>                 wsContext = jc;
>
>                                                 }
>
>         }

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
I did some research and it's the code/XSL in JaxbRIDatabindingTemplate.xsl that is writing out the portion of the stub that causing the compilation issue. Unless a concurrency issue, I wonder why consistently in couple of cases the 'position() != last()' seems to be 'true' when it should be false. And hence the additional comma at the end of the last element in the array. I would appreciate any pointers.

'
        private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                           jc = javax.xml.bind.JAXBContext.newInstance(
            <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
                <xsl:if test="@type!=''">
                        <xsl:value-of select="@type"/>.class<xsl:if test="position() != last()">,
                        </xsl:if>
                </xsl:if>
            </xsl:for-each>
                           );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                     }
        }
'
Thanks
Sumit

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 3:27 PM
To: java-user@axis.apache.org
Subject: RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

I take the WSImport part back. It is actually happening with WSDL2Code. It does not happen if I use the WSDL2Code with Axis2 1.6.0.

The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom 1.2.14. Is anyone aware of the issue with 1.6.2?

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:22 AM
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }

RE: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation - Update: Actually issue occurring in WSDL2Code

Posted by "Shah, Sumit (CGI Federal)" <Su...@cgifederal.com>.
I take the WSImport part back. It is actually happening with WSDL2Code. It does not happen if I use the WSDL2Code with Axis2 1.6.0.

The issue is happening with WSDL2Code in Axis2 1.6.2 and I am using Axiom 1.2.14. Is anyone aware of the issue with 1.6.2?

From: Shah, Sumit (CGI Federal)
Sent: Wednesday, March 20, 2013 11:22 AM
To: java-user@axis.apache.org
Subject: WSImport w JDK 1.6.0_25 and Axis2 1.6.2: Generated stub fails compilation

Hi,

I am using WSImport to generate the client stubs for a bunch of wsdl files. After the generation the code fails to compile. I am using this with Axis2 1.6.2. The following code block fails:

If you notice: the line: 'com.sample.test.webservices.impl.participant.Notify.class,' ends with a comma that shouldn't be there. Ironically it only happens for 2 of the 10 or so wsdl files I have.  Any information would be appreciated.

private static final javax.xml.bind.JAXBContext wsContext;
        static {
            javax.xml.bind.JAXBContext jc;
            jc = null;
            try {
                                                                jc = javax.xml.bind.JAXBContext.newInstance(
            com.sample.test.webservices.impl.participant.Add.class,
                        com.sample.test.webservices.impl.participant.AddResponse.class,
                        com.sample.test.webservices.exceptions.UnrecoverableFault.class,
                        com.sample.test.webservices.exceptions.RecoverableFault.class,
                        com.sample.test.webservices.impl.participant.Delete.class,
                        com.sample.test.webservices.impl.participant.DeleteResponse.class,
                        com.sample.test.webservices.impl.participant.Select.class,
                        com.sample.test.webservices.impl.participant.SelectResponse.class,
                        com.sample.test.webservices.impl.participant.AddChange.class,
                        com.sample.test.webservices.impl.participant.AddChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Query.class,
                        com.sample.test.webservices.impl.participant.QueryResponse.class,
                        com.sample.test.webservices.impl.participant.Update.class,
                        com.sample.test.webservices.impl.participant.UpdateResponse.class,
                        com.sample.test.webservices.impl.participant.Change.class,
                        com.sample.test.webservices.impl.participant.ChangeResponse.class,
                        com.sample.test.webservices.impl.participant.Synchronize.class,
                        com.sample.test.webservices.impl.participant.SynchronizeResponse.class,
                        com.sample.test.webservices.impl.participant.Notify.class,

                                                                );
            }
            catch ( javax.xml.bind.JAXBException ex ) {
                System.err.println("Unable to create JAXBContext: " + ex.getMessage());
                ex.printStackTrace(System.err);
                Runtime.getRuntime().exit(-1);
            }
            finally {
                wsContext = jc;
                                                }
        }