Question

I'm trying to execute a Java Client Code using Eclipse Helios with Developer studio, to communicate with a web-service inside WSO2ESB. And When I run the code I have the following errors:

Exception in thread "main" java.lang.NoClassDefFoundError: org/wso2/securevault/SecretResolverFactory
    at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:92)
    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:854)
    at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210)
    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:151)
    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:144)
    at org.wso2.cs.helloservices.ProxyWSOneStub.<init>(ProxyWSOneStub.java:91)
    at org.wso2.cs.helloservices.ProxyWSOneStub.<init>(ProxyWSOneStub.java:77)
    at org.wso2.cs.helloservices.ProxyWSOneStub.<init>(ProxyWSOneStub.java:126)
    at org.wso2.cs.helloservices.ProxyWSOneStub.<init>(ProxyWSOneStub.java:118)
    at org.wso2.cs.helloservices.ClientSizeResponseSynchronous.ClientSizeResponseSynchronous(ClientSizeResponseSynchronous.java:22)
    at org.wso2.cs.helloservices.MainSizeResponseSynchronous.main(MainSizeResponseSynchronous.java:38)
Caused by: java.lang.ClassNotFoundException: org.wso2.securevault.SecretResolverFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 13 more

Any solution please to resolve this Problem ?

Thanks.

Was it helpful?

Solution

To add the necessary dependencies to your classpath, follow the below mentioned steps.

  • Go to "ESB_HOME/bin" directory.

  • Issue the command "ant" which will copy all the libraries you would want to have in your classpath in doing custom developments with ESB to "ESB_HOME/repository/lib" directory. (make sure you have ant installed first)

  • Add the "ESB_HOME/repository/lib" jar directory to the classpath.

  • Execute your client.

Hope this helps.

Regards, Prabath

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top