9 Replies Latest reply: Jul 24, 2012 4:42 AM by feder RSS

JBoss client jar for Maven projects

Dennis Kuehn Newbie

I'm accessing JBoss AS 5 from an external application which is set up as a Maven project. For this I'd like to get the jboss-client-jar from a Maven repository and declare it as a dependency.

So far, I can only see versions up to 4.0.2 in the Central repository. When will it be published to Central, or can I get it from another repository?

  • 1. Re: JBoss client jar for Maven projects
    jaikiran pai Master

    http://repository.jboss.org/maven2/org/jboss/jbossas/jboss-as-client/5.1.0.GA/

    <dependency>
     <groupId>org.jboss.jbossas</groupId>
     <artifactId>jboss-as-client</artifactId>
     <type>pom</type>
     <version>5.1.0.GA</version>
     </dependency>




  • 2. Re: JBoss client jar for Maven projects
    Dennis Kuehn Newbie

    Cool, thank you!

  • 3. Re: JBoss client jar for Maven projects
    Dennis Kuehn Newbie

    This works as expected but I only need to invoke methods via RMI and the Maven dependency to jboss-as-client loads 168 (!) jars into my project (as transitive dependencies).
    Is there any document or strategy how I can reduce this number?

    I tried cutting it down to the following, but then I got an Exception (see below).

     <dependency>
     <artifactId>jaas</artifactId>
     <groupId>javax.security</groupId>
     <type>jar</type>
     <version>1.0.01</version>
     </dependency>
     <dependency>
     <artifactId>jnp-client</artifactId>
     <groupId>org.jboss.naming</groupId>
     <type>jar</type>
     <version>5.0.3.GA</version>
     </dependency>
     <dependency>
     <artifactId>jbosssx-client</artifactId>
     <groupId>org.jboss.security</groupId>
     <type>jar</type>
     <version>2.0.3.SP1</version>
     </dependency>
     <dependency>
     <artifactId>jboss-remoting</artifactId>
     <groupId>org.jboss.remoting</groupId>
     <type>jar</type>
     <version>2.5.1</version>
     </dependency>
    


    Causes the following exception when I invoke an EJB method via RMI:
    java.lang.ClassCastException
     at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
     at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
     ...
    Caused by: java.lang.ClassCastException: javax.naming.Reference cannot be cast to org.omg.CORBA.Object
     at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
     ... 4 more
    


  • 4. Re: JBoss client jar for Maven projects
    Dennis Kuehn Newbie

    I couldn't find any information on which jars are actually required for a standalone client accessing the AS via RMI so I had to find out the hard way :(

    For future reference and to save others the pain of try-and-error exclusions, here is the dependency tree I boiled it all down to:

    [INFO] +- org.jboss.jbossas:jboss-as-client:pom:5.1.0.GA:test
    [INFO] | +- oswego-concurrent:concurrent:jar:1.3.4-jboss-update1:test
    [INFO] | +- org.jboss.aop:jboss-aop:jar:client:2.1.1.GA:test
    [INFO] | +- org.jboss:jboss-common-core:jar:2.2.14.GA:test
    [INFO] | +- org.jboss.ejb3:jboss-ejb3-common:jar:client:1.0.0:test
    [INFO] | +- org.jboss.ejb3:jboss-ejb3-core:jar:client:1.1.5:test
    [INFO] | | +- org.jboss.aspects:jboss-remoting-aspects:jar:1.0.2:test
    [INFO] | | | \- org.jboss.aspects:jboss-transaction-aspects:jar:1.0.0.GA:test
    [INFO] | | +- org.jboss.ejb3:jboss-ejb3-common:jar:1.0.0:test
    [INFO] | | +- org.jboss.ejb3:jboss-ejb3-security:jar:1.0.0:test
    [INFO] | | +- org.jboss.ejb3:jboss-ejb3-proxy-impl:jar:1.0.2:test
    [INFO] | | \- org.jboss.ejb3:jboss-ejb3-proxy-spi:jar:1.0.0:test
    [INFO] | +- org.jboss.ejb3:jboss-ejb3-proxy-impl:jar:client:1.0.2:test
    [INFO] | +- org.jboss.ejb3:jboss-ejb3-proxy-spi:jar:client:1.0.0:test
    [INFO] | +- org.jboss.ejb3:jboss-ejb3-security:jar:client:1.0.0:test
    [INFO] | +- org.jboss.integration:jboss-integration:jar:5.1.0.GA:test
    [INFO] | +- org.jboss.javaee:jboss-javaee:jar:5.0.1.GA:test
    [INFO] | +- org.jboss.logging:jboss-logging-spi:jar:2.1.0.GA:test
    [INFO] | +- org.jboss.remoting:jboss-remoting:jar:2.5.1:test
    [INFO] | +- org.jboss.security:jboss-security-spi:jar:2.0.3.SP1:test
    [INFO] | +- org.jboss.security:jbosssx-client:jar:2.0.3.SP1:test
    [INFO] | \- org.jboss.naming:jnp-client:jar:5.0.3.GA:test
    


    That's 21 sub-dependencies which is way nicer than the 168 I had before.
    I'm still not sure if this is a reasonable approach tho - depending on features used there may be classes missing at runtime. Would love to hear an insider's view on this.

  • 5. Re: JBoss client jar for Maven projects
    Peter Johnson Master

     

    I had to find out the hard way

    Why do it the hard way when there is JBoss Tattletale (http://www.jboss.org/tattletale) - it will figure out the dependencies, including transitive dependencies, for you.

  • 6. Re: JBoss client jar for Maven projects
    Dennis Kuehn Newbie

    Looks like a great tool - thanks for the hint!

  • 7. JBoss client jar for Maven projects
    Sasa Bolic Newbie

    It seams that the repository url is broken (http://repository.jboss.org/maven2/org/jboss/jbossas/jboss-as-client/5.1.0.GA/).

     

    Now I can not download any dependency. Is there any other reposotitory available for jboss-as-client 5.1.0.GA jars?

  • 8. Re: JBoss client jar for Maven projects
    jaikiran pai Master

    Sasa Bolic wrote:

     

    It seams that the repository url is broken (http://repository.jboss.org/maven2/org/jboss/jbossas/jboss-as-client/5.1.0.GA/).

    The JBoss Maven  repo was moved sometime back. See this http://community.jboss.org/en/build/blog/2010/04/20/announcement--new-maven-repository-infrastructure for details.

  • 9. Re: JBoss client jar for Maven projects
    feder Newbie

    With the ACC on AS 7.1.1 you make it slicker and simply use the ejb (including remoting) and the jms (hornetq) dependencies for your ACC-Client's POM.


              <dependency>

                <groupId>org.jboss.as</groupId>

                <artifactId>jboss-as-ejb-client-bom</artifactId>

                <version>7.1.1.Final</version>

                <type>pom</type>

            </dependency>

            <dependency>

                <groupId>org.jboss.as</groupId>

                <artifactId>jboss-as-jms-client-bom</artifactId>

                <version>7.1.1.Final</version>

                <type>pom</type>

            </dependency>