我正在开发一个包含不同图层的项目。我正在使用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文件?那是在我完成另一层后产生影响的警告吗?
我添加了警告中出现的所有所有罐子的依赖关系,但警告仍然显示。
答案 0 :(得分:0)
WSDL默认放在{module_root} \ target \ generated-sources \ wsdl
中您真的需要在问题中包含相关信息。你甚至没有发布你的pom的相关部分。你有没有告诉jax-ws生成一个wsdl?
此外,修复了在运行maven构建时发出的大量警告。这只会增加您发布的信息。
编辑:
查看文档。您可以明确说明wsdls最终的位置。你的所有问题都有简单的答案,你可以用自己最小的努力找到答案。
答案 1 :(得分:0)
通常,在构建项目时,不会自动生成WSDL文档文件和架构文档文件。此文件由应用程序服务器在部署时生成。在内部,服务器执行wsgen
工具来生成文件。接下来,当您请求WSLD文档文件(在服务端点上添加?wsdl
)时,应用程序服务器即时更新文件中的服务URL并提供服务。
如果您想要包含此文件的生成,则可以添加pom.xml
JAX-WS commons。请参阅this question中的示例。