在尝试使用maven运行java2wsdl axis2插件时,我收到以下错误
[axis2-java2wsdl:java2wsdl {execution: default-cli}]
java.lang.NullPointerException
at sun.net.util.URLUtil.urlNoFragString(URLUtil.java:29)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:292)
at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
我在pom中的插件如下所示
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-java2wsdl-maven-plugin</artifactId>
<configuration>
<className>com.merc.ws.books.BookService</className>
</configuration>
</plugin>
我的依赖关系如下
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
</dependency>
<!-- Dependencies required by client -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-codegen</artifactId>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
</dependency>
</dependencies>
答案 0 :(得分:3)
请尝试mvn process-classes
。
答案 1 :(得分:0)
请尝试运行mvn process-classes axis2-java2wsdl:java2wsdl
并告诉我它是否有帮助。
仅执行mvn process-classes
或/并添加
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>java2wsdl</goal>
</goals>
</execution>
</executions>
部分(according to Maksim Sorokin)对我不起作用。
答案 2 :(得分:-1)
确保您的service.wsdl文件位于正确的位置:src / main / axis2 / service.wsdl