デプロイされたサービス「Hello」の wso2esb の Web ページを介して Java クライアントを生成したとき。HelloServiceCallBackHandler.javaとHelloServiceStub.javaに加えて、HelloClient.javaという名前のクラスを作成しました。
package org.wso2.cs.helloservices;
import java.rmi.RemoteException;
import org.wso2.cs.helloservices.HelloServiceStub.SayHello;
import org.wso2.cs.helloservices.HelloServiceStub.SayHelloResponse;
public class HelloClient {
public static void main(String[] args) {
try {
String name= new String("Test");
HelloServiceStub stub= new HelloServiceStub();
SayHello sh= new SayHello();
sh.setName(name);
SayHelloResponse resp=stub.sayHello(sh);
System.out.println("Response : "+resp);
}catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
次のエラーがあります。
<font color="red"> Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/extensions/soap/SOAPAddress
at org.wso2.cs.helloservices.HelloServiceStub.populateAxisService(HelloServiceStub.java:41)
at org.wso2.cs.helloservices.HelloServiceStub.<init>(HelloServiceStub.java:88)
at org.wso2.cs.helloservices.HelloServiceStub.<init>(HelloServiceStub.java:77)
at org.wso2.cs.helloservices.HelloServiceStub.<init>(HelloServiceStub.java:126)
at org.wso2.cs.helloservices.HelloServiceStub.<init>(HelloServiceStub.java:118)
at org.wso2.cs.helloservices.HelloClient.main(HelloClient.java:13)
Caused by: java.lang.ClassNotFoundException: javax.wsdl.extensions.soap.SOAPAddress
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more</font>