-1

我正在开发一个包含不同层的项目。我正在使用 Maven、JAX-WS、Spring 框架和 Hibernate。我尝试使用 jax ws maven 插件生成 WSDL 文件。首先,我使用了 JRE 7,但它不起作用。当我使用 JDK 1.7 时,出现此消息:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building BSCSwebservices Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
 [WARNING] The POM for bsh:bsh:jar:1.2b3 is missing, no dependency information available
[WARNING] The POM for com.sun.xml.stream.buffer:streambuffer:jar:0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.jvnet.staxex:stax-ex:jar:1.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The artifact woodstox:wstx-asl:jar:3.2.0 has been relocated to org.codehaus.woodstox:wstx-asl:jar:3.2.0
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ BSCSwebservices ---
[debug] execute contextualize
 [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 6 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ BSCSwebservices ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @   BSCSwebservices ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\sayed\workspace\BSCSwebservices1\src\test\resources
[INFO] 
 [INFO] --- maven-compiler-plugin:2.3.1:testCompile (default-testCompile) @ BSCSwebservices ---
 [INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ BSCSwebservices ---
[INFO] No tests to run.
[INFO] Surefire report directory: C:\Users\sayed\workspace\BSCSwebservices1\target\surefire-reports

-------------------------------------------------------
  T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ BSCSwebservices ---
[INFO] Packaging webapp
[INFO] Assembling webapp [BSCSwebservices] in [C:\Users\sayed\workspace\BSCSwebservices1\target\BSCSwebservices]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\sayed\workspace\BSCSwebservices1\src\main\webapp]
    [INFO] Webapp assembled in [607 msecs]
   [INFO] Building war: C:\Users\sayed\workspace\BSCSwebservices1\target\BSCSwebservices.war
   [WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored 
  (webxml attribute is missing from war task, or ignoreWebxml attribute is specified as   'true')
    [INFO] 
   [INFO] --- jaxws-maven-plugin:1.11:wsgen (service_BillingAccountRead) @  BSCSwebservices ---
    [WARNING] The POM for woodstox:wstx-asl:jar:3.2.3 is missing, no dependency information available

warning: The apt tool and its associated API are planned to be
removed in the next major JDK release.  These features have been
superseded by javac and the standardized annotation processing API,
javax.annotation.processing and javax.lang.model.  Users are
recommended to migrate to the annotation processing features of
javac; see the javac man page for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.635s
[INFO] Finished at: Thu Aug 01 20:38:29 WAT 2013
 [INFO] Final Memory: 16M/38M
[INFO] ------------------------------------------------------------------------

这是 pom.xml 的一部分

 <plugins>

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxws-maven-plugin</artifactId>
        <version>1.11</version>
        <executions>  
                <execution>  
                    <id>service_BillingAccountRead</id>  
                    <phase>package</phase>  
                    <goals>  
                        <goal>wsgen</goal>  
                    </goals>  
                    <configuration>  
                        <sei>com.ws.BillingAccountRead</sei>   
                        <genwsdl>true</genwsdl>  
                        <keep>true</keep>  

                    </configuration>  
                </execution>   
            </executions>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.1</version>
    </plugin>
</plugins>

构建成功,但我没有找到 WSDL 文件?那是我完成另一层后的警告吗?

我添加了所有出现在警告中的 jar 的依赖关系,但仍然显示警告。

4

2 回答 2

0

通常,当您构建项目时,不会自动生成 WSDL 文档文件和模式文档文件。此文件由应用程序服务器在部署时生成。在内部,服务器执行该wsgen工具来生成文件。接下来,当您请求 WSLD 文档文件(添加?wsdl到服务端点)时,应用程序服务器会即时更新文件中的服务 url 并提供服务。

如果你想包含这个文件的生成,你可以在你pom.xmlJAX-WS commons中添加。请参阅此问题中的示例。

于 2013-08-02T15:09:06.383 回答
0

WSDL 默认放置在 {module_root}\target\generated-sources\wsdl

您真的需要开始在您的问题中包含相关信息。你甚至还没有发布你的 pom.xml 的相关部分。你有没有告诉 jax-ws 生成一个 wsdl?

此外,修复运行 maven 构建时出现的大量警告。这只会增加您发布的信息的混乱。

编辑:

去查文档。您可以明确说明 wsdls 将在何处结束。你所有的问题都有简单的答案,你可以用最少的努力找到自己。

于 2013-08-01T20:57:11.303 回答