我无法在 ANT 文件中使用 wsgen 定义我的类路径。
<target name="wsgen">
<property name="wsgen_cp" value="./build/classes/" />
<echo message="classpath is : ${wsgen_cp}"/>
<exec executable="wsgen">
<!-- Classpath -->
<arg value="-verbose" />
<arg value="-classpath" />
<arg value="${wsgen_cp}" />
<!-- Sortie des sources -->
<arg value="-d" />
<arg value="${project.build.dir}/build/generated/"/>
<arg value="-r" />
<arg value="${project.build.dir}/build/wsdl"/>
<arg value="-s" />
<arg value="${project.build.dir}/build/sources"/>
<!-- Classes de WebServices -->
<arg value="-keep" />
<arg value="rpm.patient.wsimpl.RpmPatientInterfaceImpl" />
</exec>
</target>
运行目标后,出现以下错误:
[exec] Exception in thread "main" java.lang.NoClassDefFoundError: rpm/patient/RpmPatientInterface
[exec] at java.lang.ClassLoader.defineClass1(Native Method)
[exec] at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
[exec] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[exec] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[exec] at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[exec] at java.security.AccessController.doPrivileged(Native Method)
[exec] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[exec] at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[exec] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
[exec] at com.sun.tools.internal.ws.wscompile.WsgenOptions.getClass(WsgenOptions.java:287)
[exec] at com.sun.tools.internal.ws.wscompile.WsgenOptions.validateEndpointClass(WsgenOptions.java:223)
[exec] at com.sun.tools.internal.ws.wscompile.WsgenOptions.validate(WsgenOptions.java:214)
[exec] at com.sun.tools.internal.ws.wscompile.WsgenTool.run(WsgenTool.java:110)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:601)
[exec] at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:120)
[exec] at com.sun.tools.internal.ws.WsGen.main(WsGen.java:42)
[exec] Caused by: java.lang.ClassNotFoundException: rpm.patient.RpmPatientInterface
[exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[exec] at java.security.AccessController.doPrivileged(Native Method)
[exec] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[exec] at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[exec] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
[exec] ... 21 more
当我将相应的 jar 附加到我的类路径(rpm/patient/RpmPatientInterface 所在的位置)时:
似乎类路径无效,因为它找不到我试图从中生成存根的文件:[exec] 找不到类:“rpm.patient.wsimpl.RpmPatientInterfaceImpl”[exec] 用法:WSGEN [options]
有什么可以帮助我的提示吗?