Responsive Ad Area

Share This Post

test

Maven: wsgen goal misses javax/jws/WebService

I have just created a silly EJB 3.2 project with JAX-WS soap web services using maven in Eclipse 2018-09. Compilation seems working well but things fail when wsgen and wsimport goals are performed.
First of all my Maven build run configuration is

clean compile jaxws:wsgen install jaxes:wsimport

And here’s my pom.xml

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>lory-ejb</groupId>
<artifactId>lory-ejb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>lory-ejb</name>

<dependencies>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.3.6.Final</version>
    </dependency>

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.2.5</version>
    </dependency>

    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.1</version>
    </dependency>

    <dependency>
        <groupId>javax.xml</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.1</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>3.6.0</version>
    </dependency>

    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-tools</artifactId>
        <version>2.3.1</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>org.glassfish.main.javaee-api</groupId>
        <artifactId>javax.jws</artifactId>
        <version>3.1.2.2</version>
    </dependency>

    <dependency>
        <groupId>javax.xml.ws</groupId>
        <artifactId>jaxws-api</artifactId>
        <version>2.3.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.1.1</version>
    </dependency>

    <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>2.5</version>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>generate-wsdl</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>wsgen</goal>
                    </goals>
                    <configuration>
                        <sei>org.lory.ejb.core.implementations.TestWorkupsWSImpl</sei>
                        <genWsdl>true</genWsdl>
                    </configuration>
                </execution>
                <execution>
                    <id>generate-stubs</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <wsdlDirectory>target/jaxws/wsgen/wsdl</wsdlDirectory>
                        <wsdlFiles>
                            <wsdlFile>TestWorkupsWSImpl.wsdl</wsdlFile>
                        </wsdlFiles>
                        <!-- *** you need the next line to set the wsdlLocation in the generated 
                            stubs *** -->
                        <wsdlLocation>http://localhost:8180/lory-ejb-0.0.1-SNAPSHOT/</wsdlLocation>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
                <execution>
                    <id>package-wsclient-jars</id>
                    <phase>package</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <configuration>
                        <classesDirectory>target/jaxws/</classesDirectory>
                        <classifier>wsclient</classifier>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

And this is the failure message I read on console:

[INFO] Scanning for projects…
[WARNING]
[WARNING] Some problems were encountered while building the effective model for lory-ejb:lory-ejb:jar:0.0.1-SNAPSHOT
[WARNING] ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 133, column 12
[WARNING] ‘build.plugins.plugin.version’ for org.codehaus.mojo:jaxws-maven-plugin is missing. @ line 99, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ————————-< lory-ejb:lory-ejb >————————–
[INFO] Building lory-ejb 0.0.1-SNAPSHOT
[INFO] ——————————–[ jar ]———————————
[WARNING] The POM for org.jboss:jandex:jar:2.0.5.Final is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.ws:jaxws-tools:jar:2.2.10 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The artifact javax.xml:jaxb-api:jar:2.1 has been relocated to javax.xml.bind:jaxb-api:jar:2.1
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ lory-ejb —
[INFO] Deleting /Users/lory/workspace/lory-ejb/target
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ lory-ejb —
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] — maven-compiler-plugin:3.8.0:compile (default-compile) @ lory-ejb —
[INFO] Changes detected – recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 16 source files to /Users/lory/workspace/lory-ejb/target/classes
[INFO]
[INFO] — jaxws-maven-plugin:2.5:wsgen (default-cli) @ lory-ejb —
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 3.665 s
[INFO] Finished at: 2019-01-27T18:57:06+01:00
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsgen (default-cli) on project lory-ejb: Execution default-cli of goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsgen failed: A required class was missing while executing org.codehaus.mojo:jaxws-maven-plugin:2.5:wsgen: javax/jws/WebService
[ERROR] —————————————————–
[ERROR] realm = plugin>org.codehaus.mojo:jaxws-maven-plugin:2.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/lory/.m2/repository/org/codehaus/mojo/jaxws-maven-plugin/2.5/jaxws-maven-plugin-2.5.jar
[ERROR] urls[1] = file:/Users/lory/.m2/repository/com/sun/xml/ws/jaxws-tools/2.2.10/jaxws-tools-2.2.10.jar
[ERROR] urls[2] = file:/Users/lory/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[3] = file:/Users/lory/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[4] = file:/Users/lory/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[5] = file:/Users/lory/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/Users/lory/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/Users/lory/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/Users/lory/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/Users/lory/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] —————————————————–: javax.jws.WebService
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

I cannot understand where the problem is as I see that class under Maven Dependencies in the project. I’m just a newbie to Maven as for work I am used to Ivy+Ant build.

Maybe, did I write too many or too few dependencies?
And I don’t know why it’s blaming it can find neither endpoint class nor wsdl file as they must still be executed after compilation.

Would anyone please explain me? Thnaks.


Maven: wsgen goal misses javax/jws/WebService
Maven: wsgen goal misses javax/jws/WebService
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar