3 Replies Latest reply on Nov 10, 2014 9:28 AM by ataylor

    HornetQ 2.4 standalone with REST

    d.yoldov

      Hi!

       

      I'm following the instructions to generate a HornetQ 2.4.0 with REST webapp to be deployed on a servlet container. I'm using the POM provided in the docs:

       

      <project xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      
          <modelVersion>4.0.0</modelVersion>
          <groupId>org.somebody</groupId>
          <artifactId>myapp</artifactId>
          <packaging>war</packaging>
          <name>My App</name>
          <version>0.1-SNAPSHOT</version>
          <repositories>
              <repository>
                  <id>jboss</id>
                  <url>http://repository.jboss.org/nexus/content/groups/public/</url>
              </repository>
          </repositories>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <configuration>
                          <source>1.6</source>
                          <target>1.6</target>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
          <dependencies>
              <dependency>
                  <groupId>org.hornetq</groupId>
                  <artifactId>hornetq-core</artifactId>
                  <version>2.3.0-SNAPSHOT</version>
              </dependency>
              <dependency>
                  <groupId>io.netty</groupId>
                  <artifactId>netty</artifactId>
                  <version>3.4.5.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hornetq</groupId>
                  <artifactId>hornetq-jms</artifactId>
                  <version>2.3.0-SNAPSHOT</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.spec.javax.jms</groupId>
                  <artifactId>jboss-jms-api_2.0_spec</artifactId>
                  <version>1.0.0.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.hornetq.rest</groupId>
                  <artifactId>hornetq-rest</artifactId>
                  <version>2.3.0-SNAPSHOT</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.resteasy</groupId>
                  <artifactId>resteasy-jaxrs</artifactId>
                  <version>2.3.4.Final</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.resteasy</groupId>
                  <artifactId>resteasy-jaxb-provider</artifactId>
                  <version>2.3.4.Final</version>
              </dependency>
          </dependencies>
      </project>
      

       

      Trying to build it with Maven , I get :

       

      Downloading: http://repository.jboss.org/nexus/content/groups/public/org/hornetq

      /hornetq-core/2.3.0-SNAPSHOT/hornetq-core-2.3.0-SNAPSHOT.pom

      [WARNING] The POM for org.hornetq:hornetq-core:jar:2.3.0-SNAPSHOT is missing, no

      dependency information available.

       

      and then :

       

      [ERROR] Failed to execute goal on project myapp: Could not resolve dependen

      cies for project org.somebody:myap:war:1.0: The following artifacts could

      not be resolved: org.hornetq:hornetq-core:jar:2.3.0-SNAPSHOT, org.hornetq:hornet

      q-jms:jar:2.3.0-SNAPSHOT, org.hornetq.rest:hornetq-rest:jar:2.3.0-SNAPSHOT: Coul

      d not find artifact org.hornetq:hornetq-core:jar:2.3.0-SNAPSHOT in jboss (http:/

      /repository.jboss.org/nexus/content/groups/public/) -> [Help 1]

       

       

      I realize this may be a problem with Maven, but because it seems that the 2.3.0-SNAPSHOT really doesn't exist on the repo, I've decided to ask. I've tried running Maven with -U, but this didn't change anything. Can you guys help me find out what I'm missing ?

       

      Also - what is the reason for the hornetq-jms-core and hornetq-jms-rest jars to be version 2.3.0-SNAPSHOT ? Shouldn't they match HornetQ's version - 2.4.0Final ?

      If I manage to build it, would it be compatible with HornetQ 2.4.0 consumers ?

       

       

      Thanks in advance,

      Dimitar

        • 1. Re: HornetQ 2.4 standalone with REST
          ataylor

          you will have to replace the snapshot version with a version of HornetQ that exists, 2.4.0.final for instance

          1 of 1 people found this helpful
          • 2. Re: HornetQ 2.4 standalone with REST
            d.yoldov

            I got it to work with the following POM for Maven :

             

            <project xmlns="http://maven.apache.org/POM/4.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
            
                <modelVersion>4.0.0</modelVersion>
                <groupId>org.somebody</groupId>
                <artifactId>myapp</artifactId>
                <packaging>war</packaging>
                <name>My App</name>
                <version>1.0</version>
                <repositories>
                    <repository>
                        <id>jboss</id>
                        <url>http://repository.jboss.org/nexus/content/groups/public/</url>
                    </repository>
                </repositories>
                <build>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <configuration>
                                <source>1.6</source>
                                <target>1.6</target>
                            </configuration>
                            <version>2.0.2</version>
                        </plugin>
                    </plugins>
                </build>
                <dependencies>
                    <dependency>
                        <groupId>org.hornetq</groupId>
                        <artifactId>hornetq-core-client</artifactId>
                        <version>2.4.0.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.hornetq</groupId>
                        <artifactId>hornetq-jms-client</artifactId>
                        <version>2.4.0.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>io.netty</groupId>
                        <artifactId>netty</artifactId>
                        <version>3.4.5.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.hornetq</groupId>
                        <artifactId>hornetq-jms-server</artifactId>
                        <version>2.4.0.Final</version>
                    </dependency>
            
                    <dependency>
                        <groupId>org.hornetq</groupId>
                        <artifactId>hornetq-server</artifactId>
                        <version>2.4.0.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jboss.spec.javax.jms</groupId>
                        <artifactId>jboss-jms-api_2.0_spec</artifactId>
                        <version>1.0.0.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.hornetq.rest</groupId>
                        <artifactId>hornetq-rest</artifactId>
                        <version>2.4.0.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jboss.resteasy</groupId>
                        <artifactId>resteasy-jaxrs</artifactId>
                        <version>2.3.4.Final</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jboss.resteasy</groupId>
                        <artifactId>resteasy-jaxb-provider</artifactId>
                        <version>2.3.4.Final</version>
                    </dependency>
                </dependencies>
            </project>
            

             

             

            Judging by the Maven repositories, hornet-core and hornet-jms jars seem to be discontinued from version 2.3.0 onward.

            Instead there's these JARs:

             

            ->hornetq-jms-client

            ->hornetq-core-client

            ->hornetq-jms-server

            ->hornetq-server

             

            The question is - shouldn't this be mentioned in the docs on the sample POM  here . As you can see, the doc is for 2.4.0, and the POM is the same as the one from the 2.3.0 doc.

            Does anyone know anything about this? 

             

            Also, is what I did the "recommended" approach, or is there some better way?

             

             

            BR,

            Dimitar

            • 3. Re: HornetQ 2.4 standalone with REST
              ataylor

              yes, the docs need to be fixed, feel free to raise a JIRA