What's the minimum classpath for an Axis2 client?
Asked Answered
M

9

33

I want to build an Axis2 client (I'm only accessing a remote web service, I'm not implementing one!) with Maven2 and I don't want to add 21MB of JARs to my project. What do I have to put in my pom.xml to compile the code when I've converted the WSDL with ADB?

Much answered 26/11, 2008 at 9:51 Comment(0)
E
16

(Note: This response was provided by Aaron Digulla himself. What follows is the exact text of his own answer.)

In maven2, the minimum dependency set to make an ADB client work ("ADB" as in the way you created the Java classes from the WSDL) is this:

    <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>1.4.1</version>
    </dependency>
    <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb</artifactId>
            <version>1.4.1</version>
    </dependency>

Hmmm... it seems I can't flag that as the correct answer. Can someone please copy this so I can flag his post?

Extremism answered 26/11, 2008 at 18:1 Comment(1)
in the newer Axis2 Versions the mentioned Dependencies are not enough, see Renaud's Answer belowEmmen
S
30

The minimum jars for the client are:

  • activation-1.1.jar
  • axiom-api-1.2.8.jar
  • axiom-impl-1.2.8.jar
  • axis2-adb-1.5.1.jar
  • axis2-kernel-1.5.1.jar
  • axis2-transport-http-1.5.1.jar
  • axis2-transport-local-1.5.1.jar
  • commons-codec-1.3.jar
  • commons-httpclient-3.1.jar
  • commons-logging-1.1.1.jar
  • httpcore-4.0.jar
  • mail-1.4.jar
  • neethi-2.0.4.jar
  • wsdl4j-1.6.2.jar
  • XmlSchema-1.4.3.jar

STAX jars below are not part of Axis2 1.5.1 release and will be needed if your JDK version is less than 6:

  • stax-1.2.0.jar
  • stax-api-1.0.1.jar
Sanford answered 27/8, 2010 at 3:27 Comment(1)
Very complete list. Just what I needed to make Axis2 work on my Websphere Application Server v8.5Knell
E
16

(Note: This response was provided by Aaron Digulla himself. What follows is the exact text of his own answer.)

In maven2, the minimum dependency set to make an ADB client work ("ADB" as in the way you created the Java classes from the WSDL) is this:

    <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>1.4.1</version>
    </dependency>
    <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb</artifactId>
            <version>1.4.1</version>
    </dependency>

Hmmm... it seems I can't flag that as the correct answer. Can someone please copy this so I can flag his post?

Extremism answered 26/11, 2008 at 18:1 Comment(1)
in the newer Axis2 Versions the mentioned Dependencies are not enough, see Renaud's Answer belowEmmen
L
14

Had to add the transports, too

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-adb</artifactId>
    <version>1.5.4</version>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-local</artifactId>
    <version>1.5.4</version>
</dependency>
<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-http</artifactId>
    <version>1.5.4</version>
</dependency>
Landscapist answered 18/4, 2011 at 21:50 Comment(2)
+1, yes in the newer Axis2 Versions some classes are not any longer in axis2-kernel e.g. LocalTransportSender, CommonsHTTPTransportSenderEmmen
I was able to also get rid of axis2-transport-local, but that may only be because I am programmatically configuring Axis.Cons
L
12

Minimal dependency for a working client in summary


  • axiom-api-1.2.14.jar
  • axiom-impl-1.2.14.jar
  • axis2-adb-1.6.3.jar
  • axis2-kernel-1.6.3.jar
  • axis2-transport-http-1.6.3.jar
  • axis2-transport-local-1.6.3.jar
  • commons-codec-1.3.jar
  • commons-httpclient-3.1.jar
  • commons-logging-1.1.1.jar
  • httpcore-4.0.jar
  • mail-1.4.jar
  • neethi-3.0.2.jar
  • wsdl4j-1.6.2.jar
  • XmlSchema-1.4.7.jar

Listed below the minimal dependencies with details

client stub uses the ServiceClient Class generated with %AXIS2_HOME%\bin\WSDL2Java tool against a given WSDL (for generating you would need all axis jars on classpath, achieved most easily by setting AXIS_HOME)

Classes required by Client stub at COMPILE time


  • axiom-api-1.2.14.jar -- required at compilation time by client stub for org.apache.axiom.om.OMElement, org.apache.axiom.soap.SOAPEnvelope, org.apache.axiom.soap.SOAPFactory, org.apache.axiom.om.OMNamespace
  • axis2-adb-1.6.3.jar -- required at compilation time by client stub for org.apache.axis2.databinding.ADBException
  • axis2-kernel-1.6.3.jar -- required at compilation time by client stub for org.apache.axis2.AxisFault Class

Classes required for successful invocation of Client stub at RUN time

  • axiom-impl-1.2.14.jar (without this org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath)
  • axis2-transport-http-1.6.3.jar (without this org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.http.CommonsHTTPTransportSender)
  • axis2-transport-local-1.6.3.jar (without this org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.local.LocalTransportSender)
  • commons-codec-1.3.jar (without this java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException)
  • commons-httpclient-3.1.jar (without this org.apache.axis2.deployment.DeploymentException: org/apache/commons/httpclient/HttpException)
  • commons-logging-1.1.1.jar (without this java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory)
  • httpcore-4.0.jar (without this java.lang.NoClassDefFoundError: org/apache/http/HttpResponseFactory)
  • mail-1.4.jar (without this java.lang.NoClassDefFoundError: javax/mail/internet/ParseException)
  • neethi-3.0.2.jar (without this java.lang.NoClassDefFoundError: org/apache/neethi/PolicyComponent)
  • wsdl4j-1.6.2.jar (without this java.lang.NoClassDefFoundError: javax/wsdl/WSDLException)
  • XmlSchema-1.4.7.jar (without this java.lang.ClassNotFoundException: org/apache/ws/commons/schema/XmlSchema)

org.apache.axis2.AxisFault: Connection refused: connect -> ERROR ONLY if the web service is not up or accessible for some other reason

Note the exact version(s), however behavior would be generic enough subject to packaging changes across version, hence, mentionined the FQCNs above-

Axis Version - 1.6.3

Tomcat Version - Apache Tomcat/7.0.64

Servlet version - 3.0

java.runtime.version - 1.7.0_79-b15

Labroid answered 26/9, 2015 at 17:3 Comment(1)
Thanks. That's exactly what I was looking for.Hallucinate
A
6

Axis2 version 1.6.2 wouldn't work for me without axis2-xmlbeans (though this may have something to do with the fact that I'm also using the axis2-wsdl2code-maven-plugin plugin and xmlbeans as my data binding framework). I have the following POM:

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>1.6.2</version>
    </dependency>
    <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>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-xmlbeans</artifactId>
        <version>1.6.2</version>
    </dependency>
Anglicist answered 6/12, 2012 at 17:9 Comment(1)
I believe that you should only need the XML Beans libraries if you use the -d xmlbeans option when generating Java classes from a WSDL file, and then you shouldn't need the axis2-adb dependency. See: axis.apache.org/axis2/java/core/docs/…Idolatry
C
1

If your client is running on Java 6, consider using JAX-WS for consuming the WS. JAX-WS uses the JAXB standard for binding and you don't need a single extra jar for the client.

Cassaundra answered 2/12, 2008 at 10:26 Comment(1)
I'll consider this when our production servers move to Java 6 which should happen within the next decade or so ... ;)Much
S
1

Actually, you only need the axis-abd dependency since the axis2-kernel is a sub-dependency of axis-abd. Therefore you can sum it up with:

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-adb</artifactId>
    <version>1.5.1</version>
</dependency>
Southwestwards answered 30/12, 2009 at 18:27 Comment(1)
Note, however, that Maven best practices say that if you use anything from axis2-kernel in your code that you should declare it explicitly. That way you don't run into an unexpected surprise later when you remove adb. (Granted, kernel should always be included, at least you'd think it would be)Intelligentsia
G
1

In Axis2 version 1.5.1 the maven modules appear to have been restructured.

My Groovy scripts (Using ADB binding) have the following dependencies:

@Grapes([
    @Grab(group='org.apache.axis2', module='axis2-kernel', version='1.5.1'),
    @Grab(group='org.apache.axis2', module='axis2-adb', version='1.5.1'),
    @Grab(group='org.apache.axis2', module='axis2-transport-local', version='1.5.1'),
    @Grab(group='org.apache.axis2', module='axis2-transport-http', version='1.5.1'),
])

There's a logic to these. I could use an alternative binding framework when generating my stub or could use an alternative transport protocol to HTTP.

Example code in this answer

Gussi answered 2/4, 2010 at 0:17 Comment(0)
V
0

For those using Gradle, here I exclude unnecessary libraries:

dependencies {

    ext.compileEx = { lib, exModules, exGroups ->
        compile (lib) {
            exModules.each { exclude module : "$it" }
            exGroups.each  { exclude group: "$it" }
        }
    }

    List axisExModules = [ 'axiom-compat', 'jaxen', 'apache-mime4j-core' ]
    List axisExGroups  = [ 'javax.servlet', 'commons-fileupload', 'org.apache.woden',
                           'javax.ws.rs', 'org.apache.geronimo.specs', 'org.codehaus.woodstox' ]
    compileEx ('org.apache.axis2:axis2-adb:1.6.3', axisExModules, axisExGroups)
    compileEx ('org.apache.axis2:axis2-transport-local:1.6.3', axisExModules, axisExGroups)
    compileEx ('org.apache.axis2:axis2-transport-http:1.6.3', axisExModules, axisExGroups)

}

Here is my original post in the Gradle forums.

Venatic answered 16/9, 2015 at 23:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.