Howdy, Stranger!

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


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


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

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);

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(
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(
at org.apache.axis2.client.ServiceClient.configureServiceClient(
at org.apache.axis2.client.ServiceClient.(
at dynamicclient.Main.main(
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(
at java.lang.Class.getConstructor0(
at java.lang.Class.newInstance0(
at java.lang.Class.newInstance(
at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(
... 8 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpException
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(


I downloaded the "HttpClient 4.1.1 (GA)" from, and saved it in my [CATALINA_HOMElib]

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

Please Help Me...


Sign In or Register to comment.