Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Dynamic Client from Axis 2

Hi

I am experimenting a code to dynamically generate a client. I am Using Following Code :

[code=java]
try {

ServiceClient dc = new ServiceClient(null, new URL("http://localhost:8080/axis2/services/HelloWorld?wsdl"), null, null);

XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new InputStreamReader(new URL("http://localhost:8080/axis2/services/HelloWorld?wsdl").openStream()));
StAXOMBuilder builder = new StAXOMBuilder(parser);
OMElement payload = builder.getDocumentElement();

} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (XMLStreamException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
[/code]

However, when I execute the code above I get the following error

org.apache.axis2.deployment.DeploymentException: org/apache/commons/httpclient/HttpException
at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:552)
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:112)
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180)
at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146)
at org.apache.axis2.client.ServiceClient.(ServiceClient.java:215)
at dynamicclient.Main.main(Main.java:34)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:537)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpException
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

===============

I downloaded the "HttpClient 4.1.1 (GA)" from http://hc.apache.org/downloads.cgi, and saved it in my [CATALINA_HOMElib]

Once I saved, I restarted the Apache server, however I get the same error

Please Help Me...

Comments

Sign In or Register to comment.