借用一下楼上朋友的代码,我也出现了同样的问题,请教楼主该怎么解决?
package test;
import java.net.MalformedURLException;
import java.net.URL;
import org.codehaus.xfire.client.Client;
public class DynamicClientTest {
public static void main(String[] args) throws MalformedURLException,
Exception {
Client client = new Client(new URL(
"
http://localhost:8080/xfiretest/services/TestService?wsdl"));
Object[] results = client
.invoke("sayHello", new Object[] { "Firends" });
System.out.println(results[0]);
}
}
运行的之后抛出:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/factory/WSDLFactory
at org.codehaus.xfire.client.Client.<init>(Client.java:235)
at org.codehaus.xfire.client.Client.<init>(Client.java:246)
at com.centfor.zmd.Test.main(Test.java:32)
Caused by: java.lang.ClassNotFoundException: javax.wsdl.factory.WSDLFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 3 more
回复 更多评论