Open chandreshlko opened 7 years ago
You need to provide a test project that reproduces this issue. It's very hard to help just based on your pom snippet.
This is the complete pom hope this helps
<modelVersion>4.0.0</modelVersion>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>services-webapp</artifactId>
<packaging>war</packaging>
<name>WS Services Web Application</name>
<version>3.1.0-SNAPSHOT</version>
<parent>
<groupId>com.rs.sw.necr31.commons</groupId>
<artifactId>sw-parent-pom</artifactId>
<version>3.1.1-SNAPSHOT</version>
</parent>
<description> The central services webapp project bundles the central services and exposes them as a web service </description>
<properties>
<!-- PROJECT SPECIFIC PATH-->
<tfs-project-path>core/src/java/com/rs/sw/dcbs/centralservices</tfs-project-path>
<centralservices.services.version>3.1.0-SNAPSHOT</centralservices.services.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<phase>compile</phase>
<id>authentication</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.AuthenticationEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>coupon</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.CreditCouponEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>creditNoteId</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.CreditNoteIdEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>deliveryNoteId</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.DeliveryNoteIdEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>invoiceId</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.InvoiceIdEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>returnReceipt</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.returnreceipt.ReturnReceiptEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>transactionVoid</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.transactionvoid.TransactionVoidEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>waitTicket</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.WaitTicketEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
<execution>
<phase>compile</phase>
<id>tender</id>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>com.rs.sw.centralservices.jaxws.tender.TenderEndpoint</sei>
<genWsdl>true</genWsdl>
<destDir />
<!-- Enforces JAXB and JAX-WS validation of all involved classes -->
</configuration>
</execution>
</executions>
<!-- <dependencies>
<dependency>
<groupId>com.sun.tools.ws</groupId>
<artifactId>webservices-tools</artifactId>
<version>${com.sun.tools.ws.webservices-tools.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.10</version>
</dependency>
</dependencies> -->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-directory-assembly-zip</id>
<goals>
<goal>directory-inline</goal>
</goals>
</execution>
<execution>
<id>make-assembly-zip</id>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<!-- Sanchit Garg: Changed provider from org.codehaus.mojo to org.jvnet.jax-ws-commons
and version from 1.12 to 2.2 to support Java 8
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.5</version>
<goals>
<goal>wsgen</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>dbunit</groupId>
<artifactId>dbunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs</groupId>
<artifactId>services-client</artifactId>
<version>3.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-container-tomcat</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>coupon-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>creditnote-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>deliverynote-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>invoiceid-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>returnreceipt-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>transactionvoid-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>waitticket-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>authentication-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs.centralservices</groupId>
<artifactId>tender-service</artifactId>
<version>${centralservices.services.version}</version>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.dcbs</groupId>
<artifactId>dcbs-ebo-dao</artifactId>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.messagebus</groupId>
<artifactId>ebo-javaobject</artifactId>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.messagebus</groupId>
<artifactId>ebo-javaobjectAPIs</artifactId>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.messagebus</groupId>
<artifactId>ebo-jibx-marshaller</artifactId>
</dependency>
<dependency>
<groupId>com.rs.sw.necr31.commons</groupId>
<artifactId>barcode</artifactId>
<version>3.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>webservices-rt</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>activation</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.jvnet.jax-ws-commons.spring</groupId>
<artifactId>jaxws-spring</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.soap</groupId>
<artifactId>saaj-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.stream</groupId>
<artifactId>sjsxp</artifactId>
</exclusion>
<exclusion>
<groupId>org.jvnet.staxex</groupId>
<artifactId>stax-ex</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.xml.stream.buffer</groupId>
<artifactId>streambuffer</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
@chandreshlko: You should provide a (small) simple test project that reproduces the issue. It must also be executable for us outisde of your internal environment. (It seems as several dependencies aren't accessible in central.)
@andham just wanted to check that the version is used in the pom file is 1.6 and we are upgrading this to version 8 of java is this causing this issue (thank you in advance)
We are also getting an error which shows failed to execute wsgen : com.sun.mirror.apt.AnnotationProcessorFactory
and
I have the same problem
i have same build issue with JDK 8
Revisa que tengas JDK en vez de JRE. :)
Are you using a JRE or a JDK? Which version? And as @andham already asked: Can you provide a minimal sample project that lets us reproduce this issue?
@theit
package sample.ws;
import javax.jws.WebService;
@WebService
public interface IHelloWorldService {
String sayHi(String text);
}
package sample.ws;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService(endpointInterface = "sample.ws.IHelloWorldService", serviceName = "HelloWorld")
public class HelloWorldServiceImpl implements IHelloWorldService {
@WebMethod
public String sayHi(@WebParam(name = "text") String text) {
// TODO Auto-generated method stub
return null;
}
}
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sample.test</groupId>
<artifactId>JAXWSHelloWorld</artifactId>
<version>1.0.0</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>generate-wsdl</id>
<goals>
<goal>wsgen</goal>
</goals>
</execution>
</executions>
<configuration>
<sei>sample.ws.HelloWorldServiceImpl</sei>
<genWsdl>true</genWsdl>
</configuration>
</plugin>
</plugins>
</build>
</project>
Invocation of com.sun.tools.ws.wscompile.WsgenTool failed - check output (org.codehaus.mojo:jaxws-maven-plugin:2.6:wsgen:generate-wsdl:process-classes)
org.apache.maven.plugin.MojoExecutionException: Invocation of com.sun.tools.ws.wscompile.WsgenTool failed - check output
at org.codehaus.mojo.jaxws.AbstractJaxwsMojo.exec(AbstractJaxwsMojo.java:500)
at org.codehaus.mojo.jaxws.AbstractWsGenMojo.processSei(AbstractWsGenMojo.java:165)
at org.codehaus.mojo.jaxws.AbstractWsGenMojo.executeJaxws(AbstractWsGenMojo.java:155)
at org.codehaus.mojo.jaxws.MainWsGenMojo.executeJaxws(MainWsGenMojo.java:118)
at org.codehaus.mojo.jaxws.AbstractJaxwsMojo.execute(AbstractJaxwsMojo.java:386)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:332)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.lambda$8(MavenImpl.java:1380)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1379)
at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:54)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:135)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:169)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$1(MavenBuilder.java:114)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:114)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:105)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:88)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:197)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:832)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
i have same build issue with JDK 8
@yukinoba: I just tried your sample with command-line Maven:
% mvn clean verify
[INFO] Scanning for projects...
(...)
[INFO] --- jaxws-maven-plugin:2.6:wsgen (generate-wsdl) @ JAXWSHelloWorld ---
[INFO] Processing: sample.ws.HelloWorldServiceImpl
[WARNING] Using platform encoding (UTF-8), build is platform dependent!
[INFO] jaxws:wsgen args: [-keep, -s, '/Users/thorsten/workspaces/test/target/generated-sources/wsgen', -d, '/Users/thorsten/workspaces/test/target/classes', -wsdl, -r, '/Users/thorsten/workspaces/test/target/generated-sources/wsdl', sample.ws.HelloWorldServiceImpl]
Exception in thread "main" java.lang.reflect.InvocationTargetException
(...)
Caused by: com.sun.tools.ws.processor.modeler.ModelerException: Die @javax.jws.WebMethod-Annotation kann nicht mit @javax.jws.WebService.endpointInterface-Element verwendet werden.
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAp.processError(WebServiceAp.java:217)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.checkForInvalidImplAnnotation(WebServiceVisitor.java:173)
(...)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
As you can see from the error message above, you have to move the @WebMethod
and @WebParam
declaration from your service implementation into the interface:
package sample.ws;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService
public interface IHelloWorldService {
@WebMethod
String sayHi(@WebParam(name = "text") String text);
}
package sample.ws;
import javax.jws.WebService;
@WebService(endpointInterface = "sample.ws.IHelloWorldService", serviceName = "HelloWorld")
public class HelloWorldServiceImpl implements IHelloWorldService {
public String sayHi(String text) {
// TODO Auto-generated method stub
return null;
}
}
Then compiling via Maven works, and so from within Eclipse.
Attention:
If you want to compile your sample under Java 11, you have to add at least the following dependencies to your pom.xml
:
<dependencies>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
[ERROR] Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsgen (authentication) on project services-webapp: Invocation of com.sun.tools.ws.wscompile.WsgenTool failed - check output -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:2.5:wsgen (authentication) on project services-webapp: Invocation of com.sun.tools.ws.wscompile.WsgenTool failed - check output at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)