Avatar billede fredand Forsker
21. juli 2009 - 21:28 Der er 1 løsning

How to run java2wsdl from maven

Hello!

Hope for some help about this problem.

I got a small app from the example at:
http://lkamal.blogspot.com/2008/07/web-service-axis-tutorial-client-server.html

I manage to build it all with Maven and run it fine in my JBoss.

The example uses java2wsdl in step 3.

But now I would like to include this step (java2wsdl) inside my pom.xml.

Below is my pom:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>hubba</groupId>
    <artifactId>webserviceapplication</artifactId>
    <packaging>war</packaging>
    <name>WebserviceApplication</name>
    <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
            <!-- MY PARAMS WHEN RUNNING JAVA2WSDL OUTSIDE MAVEN
-o src/main/webapp/WEB-INF/wsdl/calculator.wsdl
-n urn:org.kamal.calculator
-l http://localhost:8080/webserviceapplication/services/calculator
org.kamal.wssample.ws.Calculator
            -->

            <plugin>
                <groupId>org.apache.axis2.maven2</groupId>
                <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
                <configuration>
                    <filename>src/main/webapp/WEB-INF/wsdl/calculator2.wsdl</filename>
                    <className>org.kamal.wssample.ws.Calculator</className>
                    <schemaTargetNamespace>urn:org.kamal.calculator</schemaTargetNamespace>
                    <location>http://localhost:8080/webserviceapplication/services/calculator</location>
                    <classesDirectory>/webserviceapplication/target/webserviceapplication-0.0.1-SNAPSHOT/WEB-INF/classes</classesDirectory>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>java2wsdl</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.axis</groupId>
            <artifactId>axis-jaxrpc</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-discovery</groupId>
            <artifactId>commons-discovery</artifactId>
            <version>0.4</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.messaging.saaj</groupId>
            <artifactId>saaj-impl</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>1.5.1</version>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.0.2</version>
        </dependency>
    </dependencies>

</project>

But I just get the following when I run "mvn clean install":

[INFO] [axis2-java2wsdl:java2wsdl]
java.lang.Exception: java.lang.ClassNotFoundException: org.kamal.wssample.ws.Calculator
    at org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCodegenEngine.java:58)
....
[ERROR]

The following mojo encountered an error while executing:
Group-Id: org.apache.axis2.maven2
Artifact-Id: axis2-java2wsdl-maven-plugin
Version: 1.1
Mojo: java2wsdl
brought in via: POM

While building project:
Group-Id: hubba
Artifact-Id: webserviceapplication
Version: 0.0.1-SNAPSHOT
From file: /home/fredrik/eclipse_workspace/data_accesser_workspace/webserviceapplication/pom.xml
Reason: java.lang.ClassNotFoundException: org.kamal.wssample.ws.Calculator



[INFO] ------------------------------------------------------------------------
[INFO] For more information, run with the -e flag
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILED

I'm not so good at maven I must admit, what do you think if I suspect
that I got the plugin to run before the java files is compiled?

...or is there something else that might be wrong?

Best regards
Fredrik
Avatar billede fredand Forsker
29. december 2010 - 21:50 #1
closing since old
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester