Question

i am trying to connect to the magento soap api in java, i have added almost all the jar files as per the error logs, but i am stuck at this run time exception, please have a look a look at the code and the output.

import com.google.code.magja.soap.MagentoSoapClient;
import com.google.code.magja.soap.SoapConfig;
import org.apache.axis2.AxisFault;


public class testConnection {
    public static void main(String[] args) throws AxisFault {
        String user = "XXXXXX";
        String pass = "XXXXX";
        String host = "http://XXX.co.in/magento/index.php/api/soap?wsdl";
        SoapConfig soapConfig = new SoapConfig(user, pass, host);
        MagentoSoapClient magentoSoapClient = MagentoSoapClient.getInstance(soapConfig);
        // configure connection        
        magentoSoapClient.setConfig(soapConfig);

    }
}

OUTPUT

Exception in thread "main" java.lang.RuntimeException: org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.http.CommonsHTTPTransportSender
    at com.google.code.magja.soap.MagentoSoapClient.<init>(MagentoSoapClient.java:56)
    at com.google.code.magja.soap.MagentoSoapClient.getInstance(MagentoSoapClient.java:79)
    at magentomanager.testConnection.main(testConnection.java:14)
Caused by: org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.http.CommonsHTTPTransportSender
    at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:708)
    at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:122)
    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:857)
    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.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:251)
    at com.google.code.magja.soap.MagentoSoapClient.login(MagentoSoapClient.java:138)
    at com.google.code.magja.soap.MagentoSoapClient.<init>(MagentoSoapClient.java:53)
    ... 2 more
Caused by: java.lang.ClassNotFoundException: org.apache.axis2.transport.http.CommonsHTTPTransportSender
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:186)
    at org.apache.axis2.util.Loader.loadClass(Loader.java:261)
    at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:683)

Added JAR Files

enter image description here

Was it helpful?

Solution

I just ran into the same issue and added these dependencies to my maven pom

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-http</artifactId>
    <version>1.6.2</version>
</dependency>

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-local</artifactId>
    <version>1.6.2</version>
</dependency>

Hope this helps.

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