2 Replies Latest reply on Oct 30, 2008 1:30 PM by tonioc

    WS client libraries from Maven frustration

      Can someone reveal set of necessary library set for a standalone web service client? A set of libraries from Maven repository? JBoss Maven repository?

      I decided to use JBoss WS client implementation because there is a possibility that my standalone client will be soon integrated to our enterprise application running on JBoss.

      Because all our projects are Maven based, and despite I am not a huge Maven fan, I respect Maven as a de-facto standard for Java project management; I would like to use only libraries provided by Maven repositories. JBoss provides its own Maven repository that sounds promising. But at this point all fun ends. This requirement seems to be impossible to fulfill.

      For Eclipse project I use these libraries with success:

      <classpathentry kind="var" path="JBOSS_HOME/client/jbossws-spi.jar"/>
      <classpathentry kind="var" path="JBOSS_HOME/client/jaxb-api.jar" />
      <classpathentry kind="var" path="JBOSS_HOME/client/jboss-jaxws.jar"/>
      <classpathentry kind="var" path="JBOSS_HOME/client/jbossws-client.jar"/>
      <classpathentry kind="var" path="JBOSS_HOME/client/jbossall-client.jar"/>
      <classpathentry kind="var" path="JBOSS_HOME/client/jboss-saaj.jar"/>
      <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>


      I got close with Maven by:

      <dependency>
       <groupId>org.jboss.ws.native</groupId>
       <artifactId>jbossws-native-client</artifactId>
       <version>3.0.4.GA</version>
      </dependency>
      


      This add 13MB of dependent libraries to my single Jar application. It is quite a lot for a simple client, isn'€™t it? Anyway, at least it had compiled my source but test phase failed with:
      java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider:
      org.jboss.ws.core.jaxws.spi.ProviderImpl
      Caused by: java.lang.NoClassDefFoundError:
      org/jboss/util/NotImplementedException


      I tried several other combinations, with aim to get close to JBoss 4.2.2 GA client libraries as possible (pom.xml):

      <dependency>
       <groupId>jboss</groupId>
       <artifactId>jbossws-spi</artifactId>
       <version>1.0.0.GA</version>
      </dependency>
      <!-- JBoss 4.2.2/jbossws-spi.jar : Implementation-Version:
      jbossws-1.0.0.GA (build=200708171551) -->
      
      <dependency>
       <groupId>javax.xml.bind</groupId>
       <artifactId>jaxb-api</artifactId>
       <version>2.1</version>
      </dependency>
      
      <dependency>
       <groupId>org.jboss</groupId>
       <artifactId>jboss-jaxws</artifactId>
       <version>2.0.1.SP2</version>
      </dependency>
      <!-- JBoss 4.2.2/jbossws-jaxws.jar : Implementation-Version:
      jbossws-native-2.0.1.SP2 (build=200710210837) -->
      
      <dependency>
       <groupId>org.jboss</groupId>
       <artifactId>jbossws-client</artifactId>
       <version>2.0.1.SP2</version>
      </dependency>
      <!-- JBoss 4.2.2/jbossws-client.jar: Implementation-Version:
      jbossws-native-2.0.1.SP2 (build=200710210837 -->
      
      <dependency>
       <groupId>jboss</groupId>
       <artifactId>jbossall-client</artifactId>
       <version>4.2.2.GA</version>
      </dependency>
      <!-- JBoss 4.2.2/jbossall-client: Implementation-Version: 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139) -->
      
      <dependency>
       <groupId>jboss.jbossws</groupId>
       <artifactId>jboss-saaj</artifactId>
       <version>2.0.3.GA</version>
      </dependency>
      <!-- JBoss 4.2.2/jboss-saaj : Implementation-Version: jbossws-native-2.0.1.SP2 (build=200710210837) -->
      
      <dependency>
       <groupId>xerces</groupId>
       <artifactId>xercesImpl</artifactId>
       <version>2.7.1</version>
      </dependency>
      

      ..but I ended with the same error message.
      If I add jbossws-common dependency:
      <!-- added to supply org.jboss.util.NotImplementedException -->
      <dependency>
       <groupId>org.jboss.ws</groupId>
       <artifactId>jbossws-common</artifactId>
       <version>1.0.0.GA</version>
       <scope>compile</scope>
      </dependency>
      <!--
      JBoss 4.2.2/jbossws-common: Implementation-Version: jbossws-native-2.0.1.SP2 (build=200710210837)
      But what vesion of jbossws-common? In repository there are versions from 1.0.0.GA to 1.0.7.GA. What version is really in JBoss 4.2.2.GA??
      -->
      


      I got:
      java.lang.NoClassDefFoundError: javax/xml/rpc/encoding/TypeMappingRegistry

      Well, you can add new libs for ever; it is hard to figure out which version of which library fits together :(

      I use standard Maven repository and JBoss repository http://repository.jboss.org/maven2/.

      Why there is not a copy of JBoss libraries for all released version in the repository? Is it impossible to have something like http://repository.jboss.com/maven2/org/jboss-4.2.2.GA/client? License issues? Lack of hard-drive space?

      Thank you for any suggestions or comments
      Espinosa




        • 1. Re: WS client libraries from Maven frustration
          peterj

          I would go with just the single dependency on jboss-native-client, but add a 'compile' scope to it. Then the jar is used to compile only. The client JAR file should then include only the client code.

          I would then use the wsrunclient script to run the client, since it (supposedly) includes all JAR files necessary to run a web services client.

          Unfortunately, that does not solve the problems you ran into running your unit tests. Nor does it help if you plan to run your client from a machine that does not have JBossAS (unless you plan in shipping wsrunclient and the client directory with your app). But maybe what I mentioned will give you some other ideas to work around the issue.

          • 2. Re: WS client libraries from Maven frustration

            I had some similar problems, but constructing the server-side stuff.

            I ended up only adding
            org.jboss.ws/jbossws-jboss422/3.0.4.GA
            dependency

            Hope it helps