maven - 找不到符号构造函数 Service(URL,QName,WebServiceFeature[])

标签 maven intellij-idea webservices-client

我正在尝试使用父 maven 模块 ism-maven 制作一个 maven 模块 web_service_client。
该模块包含生成的 WS 类。我没有改变任何东西。我正在使用 IntelliJ IDEA 11.1.2。

这是我的 web_service_client 的 pom.xml。

    <?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>ism-maven</artifactId>
        <groupId>sk.tuke.ism</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>web_service_client</artifactId>


</project>

在我运行 web_service_client 的 maven 编译后,我得到了这个错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project web_service_client: Compilation failure: Compilation failure:
[ERROR] \Users\Marek\Dropbox\ism-maven\web_service_client\src\main\java\sk\tuke\ism\webclient\Service1.java:[46,8] cannot find symbol
[ERROR] symbol  : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
[ERROR] location: class javax.xml.ws.Service
[ERROR] \Users\Marek\Dropbox\ism-maven\web_service_client\src\main\java\sk\tuke\ism\webclient\Service1.java:[54,8] cannot find symbol
[ERROR] symbol  : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
[ERROR] location: class javax.xml.ws.Service
[ERROR] \Users\Marek\Dropbox\ism-maven\web_service_client\src\main\java\sk\tuke\ism\webclient\Service1.java:[62,8] cannot find symbol
[ERROR] symbol  : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.ws.WebServiceFeature[])
[ERROR] location: class javax.xml.ws.Service
[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/MojoFailureException

我在这里找到了一些关于这个错误的文章,但我是这个领域的新手,我无法解决这个问题。

谢谢你的帮助。

最佳答案

生成的代码似乎使用 JAX-WS 2.2。您可以尝试覆盖默认版本并在 pom.xml 中设置 target=2.1 或 target=2.0:

            <executions>
                <execution>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                    <configuration>
                        <target>2.1</target>

关于maven - 找不到符号构造函数 Service(URL,QName,WebServiceFeature[]),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14751415/

相关文章:

maven v3.0.5 找不到sqoop神器

javascript - 在 intellij 中为 javascript 核心添加 jsdoc

java - 智能 : Fatal error compiling: invalid target release: 1. 8

java - 使用 `Error: Could not find or load main class` 运行 jar

php - 从 BlackBerry 应用程序访问 MySQL 表

java - 将 Maven 依赖项导入到 Java 项目中

java - 将 Apache Spark 与 couchbase 连接

java - 如何防止eclipse在Tomcat上部署测试类?

java - 需要查看客户端与外部 Web 服务对话的 SOAP 消息 - 怎么做? (Eclipse/Netbeans/IDEA 可以)

java - 进行网络服务调用时出错