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 Rob Henley <ro...@freeuk.com> on 2006/05/06 15:16:27 UTC

[Axis2 1.0] ant codegen target problems

My build.xml contains

    <target name="axis-init">
      <taskdef name="codegen"
               classname="org.apache.axis2.tool.ant.AntCodegenTask"
               classpath="${axis.dist.classpath}"/>
    </target>

    <target name="wsdl2java" depends="axis-init">
      <codegen wsdlfilename="my.wsdl"
               language="java"
               synconly="true"
               serverside="true"
               generateservicexml="true">
      </codegen>
    </target>

where axis.dist.classpath contains all the jars in the axis2 lib directory.

Running 'ant wsdl2java' I get an error "javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found".

Via google I managed to find a couple of additional jars to supply missing classes: jsr173_1.0_ri.jar and jsr173_1.0_api.jar. Adding these to my global classpath fixes the problem.

Question 1. Are the above jsr173 jars missing from the 1.0 distribution?
Question 2. Is there a more ant-like way to control the classpath used when the codegen tool runs? I tried the following ...

      <codegen wsdlfilename="purchasing1.wsdl"
               language="java"
               synconly="true"
               serverside="true"
               generateservicexml="true">
         <classpath refid="axis.dist.classpath"/>
      </codegen>

but that gives me a java.lang.ExceptionInInitializerError.

Question 3. I'd like to be able to specify the xmlbeans data binding. What is the AntCodegenTask equivalent to the command line "--databinding-method xmlbeans"? This doesn't seem to be documented. I guessed it might be databindingname="xmlbeans", but when I add this to the codegen target I get the error "java.lang.RuntimeException: java.lang.reflect.InvocationTargetException".

Many thanks
Rob

Re[2]: Problems deploying with AdminClient

Posted by Martin Wunderlich <ma...@gmx.net>.
And at last I seem to found the reason for the disappearing web
service, albeit not the root cause. This post here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=118673 gave me the idea
of checking the file WEB-INF/server-config.wsdd. And indeed, there was
no description of the deployed service at all! So, I copied over a
backup copy of this file, restartet the server and everything's working fine again.
I have
no idea, why the service description disappeared in the first place.
Might be related to the auto-deployment of the web-app using
(My)Eclipse.

CHeers,

Martin

> Testing a bit more I was able to successfully deploy a different web service to a
> different location on the same Tomcat installation. Then I copied all
> the resources to a new project (in Eclipse), which I deployed to a new
> web-app and things seem to work there. So, at least I
> have the problem limited down now to the original service that I
> wanted to deploy. Still, it's puzzling...

> In the process, I happened to notice that the SOAPMonitor tool can
> only be used, if Tomcat is installed on port 8080. Is there a way to
> change the port to 80? It reverts back to 8080, even if I call the
> SOAPMonitor with http://localhost/....

> Cheers,

> Martin



Re: Problems deploying with AdminClient

Posted by Martin Wunderlich <ma...@gmx.net>.
Testing a bit more I was able to successfully deploy a different web service to a
different location on the same Tomcat installation. Then I copied all
the resources to a new project (in Eclipse), which I deployed to a new
web-app and things seem to work there. So, at least I
have the problem limited down now to the original service that I
wanted to deploy. Still, it's puzzling...

In the process, I happened to notice that the SOAPMonitor tool can
only be used, if Tomcat is installed on port 8080. Is there a way to
change the port to 80? It reverts back to 8080, even if I call the
SOAPMonitor with http://localhost/....

Cheers,

Martin

> Dear all,

> I have run into a very odd problem trying to deploy my web service
> using AdminClient. I create my wsdl and wsdd files without any
> problems. I also don't get any errors when I deploy the service using:

> "java -cp %AXISCLASSPATH%
> org.apache.axis.client.AdminClient -l http://localhost/<myURL>
> deploy.wsdd"

> However, the service then simply isn't there. It doesn't show up in
> the list of services (only AdminService and Version do).
> This is even
> more awkward, since it was working fine this morning. I had the
> service running, went for lunch, and it
> somehow undeployed itself in the meantime. So, I tried to redeploy,
> but without any success so far. Any idea what the problem might be?

> Cheers,

> Martin



-- 
----------------------------------------------------------
Martin Wunderlich, M.A.
Translation/Localisation EN <-> DE

 www.martinwunderlich.com
----------------------------------------------------------
Free / open-source software for translation/localisation:
 www.martinwunderlich.com/foss-links.html
----------------------------------------------------------
Random aphorism: 
 "Todas las cosas tienen su misterio, y la poesía es el misterio que tienen todas la cosas."
"All things have their secret. And poetry is the secret that all things have."
 - Federico García Lorca
----------------------------------------------------------


Re[2]: Problems deploying with AdminClient

Posted by Martin Wunderlich <ma...@gmx.net>.
Hi Siamak,

Thanks a lot for the suggestion. I am still using Axis 1.3, so it
wouldn't be related to Axis 2, I guess.

Cheers,

Martin

> Hello Martin.


> As far as I know the AdminClient was used by Axis to deploy a service.
> With Axis2 the deploying has slightly changed.

> Please go through the User's Manual to see how to deploy a service.

> http://ws.apache.org/axis2/1_0/userguide.html

> You will see that you have some options:
> 1) create an aar-archive and put it in the WEB-INF/services directory of
> the axis2 webapp
> 2) create an aar-archive and upload it through the Administration UI
> 3) place the content of the aar-archive "unpacked" into the 
> WEB-INF/services/${YOUR_SERVICE} directory

> The third option is usefull if you have a lot jars placed in the 
> lib-directory of you service because the Axis2 ClassLoader is very slow
> while loading jars inside aars ;-)


> I hope I could help you,

> Siamak Haschemi




Re: Problems deploying with AdminClient

Posted by Siamak Haschemi <si...@gmx.de>.
Hello Martin.


As far as I know the AdminClient was used by Axis to deploy a service.
With Axis2 the deploying has slightly changed.

Please go through the User's Manual to see how to deploy a service.

http://ws.apache.org/axis2/1_0/userguide.html

You will see that you have some options:
1) create an aar-archive and put it in the WEB-INF/services directory of 
the axis2 webapp
2) create an aar-archive and upload it through the Administration UI
3) place the content of the aar-archive "unpacked" into the 
WEB-INF/services/${YOUR_SERVICE} directory

The third option is usefull if you have a lot jars placed in the 
lib-directory of you service because the Axis2 ClassLoader is very slow 
while loading jars inside aars ;-)


I hope I could help you,

Siamak Haschemi


Martin Wunderlich schrieb:
> Dear all,
>
> I have run into a very odd problem trying to deploy my web service
> using AdminClient. I create my wsdl and wsdd files without any
> problems. I also don't get any errors when I deploy the service using:
>
> "java -cp %AXISCLASSPATH%
> org.apache.axis.client.AdminClient -l http://localhost/<myURL>
> deploy.wsdd"
>
> However, the service then simply isn't there. It doesn't show up in
> the list of services (only AdminService and Version do).
> This is even
> more awkward, since it was working fine this morning. I had the service running, went for lunch, and it
> somehow undeployed itself in the meantime. So, I tried to redeploy,
> but without any success so far. Any idea what the problem might be?
>
> Cheers,
>
> Martin
>
>
>   


Problems deploying with AdminClient

Posted by Martin Wunderlich <ma...@gmx.net>.
Dear all,

I have run into a very odd problem trying to deploy my web service
using AdminClient. I create my wsdl and wsdd files without any
problems. I also don't get any errors when I deploy the service using:

"java -cp %AXISCLASSPATH%
org.apache.axis.client.AdminClient -l http://localhost/<myURL>
deploy.wsdd"

However, the service then simply isn't there. It doesn't show up in
the list of services (only AdminService and Version do).
This is even
more awkward, since it was working fine this morning. I had the service running, went for lunch, and it
somehow undeployed itself in the meantime. So, I tried to redeploy,
but without any success so far. Any idea what the problem might be?

Cheers,

Martin



Re: [Axis2 1.0] ant codegen target problems

Posted by Rob Henley <ro...@freeuk.com>.
Hi Robert
thanks for that. I think bug AXIS2-668 is related to the problem(s). This has a priority "Major" so perhaps should be in the release notes as a restriction?
Thanks again
Rob
  ----- Original Message ----- 
  From: robert lazarski 
  To: axis-user@ws.apache.org 
  Sent: Saturday, May 06, 2006 2:27 PM
  Subject: Re: [Axis2 1.0] ant codegen target problems


  There's some known problems AntCodegenTask. In the meantime, what I use is: 

   <target name="wsdl2java" depends="clean,prepare">
        <delete dir="output" />
        <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
            <classpath refid="axis.classpath"/>
            <arg value="-d"/>
            <arg value="xmlbeans"/>
            <arg value="-uri"/>
            <arg file="wsdl/simple.wsdl"/>
            <arg value="-ss"/>
            <arg value="-g"/>
            <arg value="-sd"/>
            <arg value="-o"/>
            <arg file="output"/>
            <arg value="-p"/>
            <arg value="org.simple.endpoint"/>
        </java>

        <!-- Move the schema folder to classpath-->
        <move todir="${build.classes}">
            <fileset dir="output/resources">
                <include name="*schema*/**/*.class"/>
                <include name="*schema*/**/*.xsb"/>
            </fileset>
        </move>

    </target>

  HTH,
  Robert
  http://news.google.com/


  On 5/6/06, Rob Henley <ro...@freeuk.com> wrote:
    My build.xml contains

        <target name="axis-init">
          <taskdef name="codegen"
                   classname="org.apache.axis2.tool.ant.AntCodegenTask"
                   classpath="${axis.dist.classpath}"/>
        </target>

        <target name="wsdl2java" depends="axis-init">
          <codegen wsdlfilename="my.wsdl"
                   language="java"
                   synconly="true"
                   serverside="true"
                   generateservicexml="true">
          </codegen>
        </target>

    where axis.dist.classpath contains all the jars in the axis2 lib directory.

    Running 'ant wsdl2java' I get an error "javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found".

    Via google I managed to find a couple of additional jars to supply missing classes: jsr173_1.0_ri.jar and jsr173_1.0_api.jar. Adding these to my global classpath fixes the problem.

    Question 1. Are the above jsr173 jars missing from the 1.0 distribution?
    Question 2. Is there a more ant-like way to control the classpath used when the codegen tool runs? I tried the following ...

          <codegen wsdlfilename="purchasing1.wsdl"
                   language="java"
                   synconly="true"
                   serverside="true"
                   generateservicexml="true">
             <classpath refid="axis.dist.classpath"/>
          </codegen>

    but that gives me a java.lang.ExceptionInInitializerError.

    Question 3. I'd like to be able to specify the xmlbeans data binding. What is the AntCodegenTask equivalent to the command line "--databinding-method xmlbeans"? This doesn't seem to be documented. I guessed it might be databindingname="xmlbeans", but when I add this to the codegen target I get the error "java.lang.RuntimeException: java.lang.reflect.InvocationTargetException".

    Many thanks
    Rob


Re: [Axis2 1.0] ant codegen target problems

Posted by robert lazarski <ro...@gmail.com>.
There's some known problems AntCodegenTask. In the meantime, what I use is:

 <target name="wsdl2java" depends="clean,prepare">
      <delete dir="output" />
      <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
          <classpath refid="axis.classpath"/>
          <arg value="-d"/>
          <arg value="xmlbeans"/>
          <arg value="-uri"/>
          <arg file="wsdl/simple.wsdl"/>
          <arg value="-ss"/>
          <arg value="-g"/>
          <arg value="-sd"/>
          <arg value="-o"/>
          <arg file="output"/>
          <arg value="-p"/>
          <arg value="org.simple.endpoint"/>
      </java>

      <!-- Move the schema folder to classpath-->
      <move todir="${build.classes}">
          <fileset dir="output/resources">
              <include name="*schema*/**/*.class"/>
              <include name="*schema*/**/*.xsb"/>
          </fileset>
      </move>

  </target>

HTH,
Robert
http://news.google.com/

On 5/6/06, Rob Henley <ro...@freeuk.com> wrote:
>
> My build.xml contains
>
>     <target name="axis-init">
>       <taskdef name="codegen"
>                classname="org.apache.axis2.tool.ant.AntCodegenTask"
>                classpath="${axis.dist.classpath}"/>
>     </target>
>
>     <target name="wsdl2java" depends="axis-init">
>       <codegen wsdlfilename="my.wsdl"
>                language="java"
>                synconly="true"
>                serverside="true"
>                generateservicexml="true">
>       </codegen>
>     </target>
>
> where axis.dist.classpath contains all the jars in the axis2 lib
> directory.
>
> Running 'ant wsdl2java' I get an error "
> javax.xml.stream.FactoryConfigurationError: Provider
> com.bea.xml.stream.MXParserFactory not found".
>
> Via google I managed to find a couple of additional jars to supply missing
> classes: jsr173_1.0_ri.jar and jsr173_1.0_api.jar. Adding these to my global
> classpath fixes the problem.
>
> Question 1. Are the above jsr173 jars missing from the 1.0 distribution?
> Question 2. Is there a more ant-like way to control the classpath used
> when the codegen tool runs? I tried the following ...
>
>       <codegen wsdlfilename="purchasing1.wsdl"
>                language="java"
>                synconly="true"
>                serverside="true"
>                generateservicexml="true">
>          <classpath refid="axis.dist.classpath"/>
>       </codegen>
> but that gives me a java.lang.ExceptionInInitializerError.
>
> Question 3. I'd like to be able to specify the xmlbeans data binding. What
> is the AntCodegenTask equivalent to the command line "--databinding-method
> xmlbeans"? This doesn't seem to be documented. I guessed it might be databindingname="xmlbeans",
> but when I add this to the codegen target I get the error "
> java.lang.RuntimeException: java.lang.reflect.InvocationTargetException".
>
> Many thanks
> Rob
>