我正在使用Netbeans 7和Maven 2.2.1以及jaxws-maven-plugin 1.12.代码部署在Glassfish 3.1上 - 或者当我将其编译时:)
当我构建项目时,wsimport按预期运行并从提供的WSDL生成源文件.问题是在编译阶段构建失败,但有以下三个例外.通过研究,我发现这些构造函数是从JAX-WS 2.1添加到JAX-WS 2.2的.我的信念是wsimport正在使用JAX-WS 2.1并且编译使用的是JAX-WS 2.2.
有人可以证实我的怀疑吗?或者,如果我错了,你可能知道可能导致这种情况的原因是什么?
谢谢.
更新/澄清问题 Web服务客户端扩展了javax.xml.ws.Service,当客户端尝试使用三个参数调用超类构造函数时,将引发错误.由于超类没有任何带有三个参数的构造函数,因此失败.
javax.xml.ws.Service在JDK SE 1.6和JAX-WS 2.1中找到错误的版本.
javax.xml.ws.Service在JAX-WS 2.2中找到,作为正确的版本.
错误发生三次,因为它在三个重写的构造函数中,但它是相同的错误所以我只包含它一次.
cannot find symbol
symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
location: class javax.xml.ws.Service
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlFiles>
<wsdlFile>*path to WSDL*</wsdlFile>
</wsdlFiles>
<wsdlLocation>*url to WSDL*</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/stale/BudgetCheckingServiceService.stale</staleFile>
</configuration>
<id>wsimport-generate-BudgetCheckingServiceService</id>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)