0

When I generated a Java Client through the web page of wso2esb for a deployed service "Hello". In addition to the HelloServiceCallBackHandler.java and HelloServiceStub.java I created the class entitled 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();
    }
   }
 }

I have the following error:

<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>
Community
  • 1
  • 1
Yanni
  • 71
  • 8

1 Answers1

0

This seems to be required jars not found (This complains about wsld4j). Please add AXIS2_HOME/lib folder to your program's classpath .

Shelan Perera
  • 1,753
  • 1
  • 11
  • 10
  • Where can I found the AXIS2_HOME/lib knowing that I am using the wso2-esb ? Can you please give me the complete step by step to resolve this problem cause it's from 4 days ago I'm trying to resolve it. I am working under Windows and C:\wso2esb And I Use Studio Developer installed under Eclipse. Thanks a lot and Have a nice. – Yanni Dec 19 '12 at 12:22
  • There are two options, Download axis2 binary from web (In the AXIS2 project downloads) there you have /lib folder when you extract. Or else type 'ant' inside C:\wso2esb\bin (you need to have apache ant installed) this will add all the required jars to wso2esb\repository\lib – Shelan Perera Dec 19 '12 at 12:23