You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Davanum Srinivas <da...@gmail.com> on 2007/02/23 04:39:52 UTC

Fwd: WSDL2Java - something in Axis2 to watch for

Amila,

Please check.

-- dims

---------- Forwarded message ----------
From: Scott Kurz <sc...@gmail.com>
Date: Feb 22, 2007 6:37 PM
Subject: WSDL2Java - something in Axis2 to watch for
To: tuscany-dev@ws.apache.org


I was running WSDL2Java against a recent pull of Axis2 (like a week ago),
newer than 1.1.1  and was failing running WSDL2Java.

Just thought I'd get this down on paper for whenever we are ready to make
this move...

Axis2 introduced a 'codegen' boolean in their service builder building the
AxisService from WSDL4J Definition and I couldn't get W2J to work unless I
did:

       WSDL11ToAxisServiceBuilder builder = new
WSDL11ToAxisServiceBuilder(...)
        builder.setCodegen(true);
        axisService = builder.populateService();

This is in the constructor for
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceGenerator.
Otherwise the axisService is missing some info when we run the emitter and
we get NPE.

Anyway... maybe this saved someone the trouble of figuring out this exact
bit of info...

Scott



------------------------------------------------------------------------------

I'll paste the stack trace in case someone from the future searches the mail
to see if someone's hit this problem:


org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.NullPointerException
        at
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceGenerator.generate(
JavaInterfaceGenerator.java:
178)
        at
org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator.generateFromWSDL
(WSDL2JavaGenerator.java:
242)
        at
org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator.main(
WSDL2JavaGenerator.java:103)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:64)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at com.ibm.ws.soa.sca.bootstrap.SCALauncher.main(SCALauncher.java
:74)
Caused by: java.lang.NullPointerException
        at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations
(AxisServiceBas
edMultiLanguageEmitter.java:1823)
        at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForInterface
(AxisServiceBasedMultiLanguageEmitter.java:993)
        at
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceEmitter.writeInterface
(JavaInterfaceEmitter.jav
a:196)
        at
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceGenerator.generate(
JavaInterfaceGenerator.java:
174)
        ... 7 more
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:64)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:615)
        at com.ibm.ws.soa.sca.bootstrap.SCALauncher.main(SCALauncher.java
:74)
Caused by: java.lang.IllegalArgumentException:
org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.Nul
lPointerException
        at
org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator.generateFromWSDL
(WSDL2JavaGenerator.java:
245)
        at
org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator.main(
WSDL2JavaGenerator.java:103)
        ... 5 more
Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.NullPointerException
        at
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceGenerator.generate(
JavaInterfaceGenerator.java:
178)
        at
org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator.generateFromWSDL
(WSDL2JavaGenerator.java:
242)
        ... 6 more
Caused by: java.lang.NullPointerException
        at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations
(AxisServiceBas
edMultiLanguageEmitter.java:1823)
        at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForInterface
(AxisServiceBasedMultiLanguageEmitter.java:993)
        at
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceEmitter.writeInterface
(JavaInterfaceEmitter.jav
a:196)
        at
org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceGenerator.generate(
JavaInterfaceGenerator.java:
174)
        ... 7 more


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

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


Re: WSDL2Java - something in Axis2 to watch for

Posted by Amila Suriarachchi <am...@gmail.com>.
On 2/23/07, Davanum Srinivas <da...@gmail.com> wrote:
>
> Amila,
>
> Please check.
>
> -- dims
>
> ---------- Forwarded message ----------
> From: Scott Kurz <sc...@gmail.com>
> Date: Feb 22, 2007 6:37 PM
> Subject: WSDL2Java - something in Axis2 to watch for
> To: tuscany-dev@ws.apache.org
>
>
> I was running WSDL2Java against a recent pull of Axis2 (like a week ago),
> newer than 1.1.1  and was failing running WSDL2Java.
>
> Just thought I'd get this down on paper for whenever we are ready to make
> this move...
>
> Axis2 introduced a 'codegen' boolean in their service builder building the
> AxisService from WSDL4J Definition and I couldn't get W2J to work unless I
> did:
>
>        WSDL11ToAxisServiceBuilder builder = new
> WSDL11ToAxisServiceBuilder(...)
>         builder.setCodegen(true);
>         axisService = builder.populateService();


Axis2 had a  codegen problem with the  parameter order.  In Axis2 1.1.1 the
generated code had a different operations order than in the wsdl file
itself. The reason for this was we kept axis operations in a Map in Axis2
service. So we introduce a new list to keep operations in order.
As this list only needs in codegeneration time, the codegen boolean variable
is used to have a track on it.

So actually you have done the correct fix. please see the
CodeGenerationEngine(CommandLineOptionParser parser) constructor in
org.apache.axis2.wsdl.codegen.CodeGenerationEngine class.

Amila.

-- 
Amila Suriarachchi,
WSO2 Inc.