3 Replies Latest reply on Jul 5, 2011 12:57 PM by mp911de

    Eclipse Web application deployment problem with Maven on JBoss

    stephan972

      I have the following pom.xml (see below) for building a web-app on JBoss. I run maven like this :

       

      >> mvn clean compile war:exploded jboss:hard-undeploy jboss:hard-deploy jboss:start-and-wait

       

      <br>

      Every goals run fine until i hit jboss:start-and-wait goal :\ JBoss refuses to start.

      I got the following error :

       

      <pre>

      (...)

      [INFO] [jboss:start-and-wait {execution: default-cli}]

      [INFO] Starting JBoss...

      [INFO] Waiting to retrieve JBoss JMX MBean connection...

      [INFO] Waiting to retrieve JBoss JMX MBean connection...

      [INFO] Waiting to retrieve JBoss JMX MBean connection...

      [INFO] Waiting to retrieve JBoss JMX MBean connection...

      [INFO] ------------------------------------------------------------------------

      [ERROR] BUILD ERROR

      [INFO] ------------------------------------------------------------------------

      [INFO] Unable to get JBoss JMX MBean connection: null

       

      org.jboss.jmx.adaptor.rmi.RMIAdaptor

      (...)

      </pre>

      <br>

       

      By activating the DEBUG option on maven, i detected that the root cause is a ClassNotFoundException

      org.jboss.jmx.adaptor.rmi.RMIAdaptor. Why do I get this exception since my pom.xml

      *does* contain org.jboss.jmx.adaptor.rmi.RMIAdaptor in the jmx-adaptor-plugin jar dependency ?

      Using jboss-all-client jar as dependency gives no more results.

       

      What am I missing ?

       

      Stephan

       

      **Configuration**

      <pre>

      <code>

      Maven 2.2.1

      JBoss 5.1.0.GA

      JBoss Maven Plugin 1.5.0

      </code>

      </pre>

       

      **pom.xml**

       

       

          <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>

              <parent>

                  <artifactId>foo</artifactId>

                  <groupId>com.company.foo</groupId>

                  <version>1.0.0</version>

              </parent>

              <groupId>com.company.foo</groupId>

              <artifactId>foo-webapp</artifactId>

              <packaging>war</packaging>

              <name>foo-webapp</name>

              <version>1.0.0</version>

       

              <dependencies>

              <!-- JSF 2.0 -->

              <dependency>

                  <groupId>com.sun.faces</groupId>

                  <artifactId>jsf-api</artifactId>

                  <version>2.0.3-b02</version>

              </dependency>

              <dependency>

                  <groupId>com.sun.faces</groupId>

                  <artifactId>jsf-impl</artifactId>

                  <version>2.0.3-b02</version>

              </dependency>

       

              <!-- Primefaces -->

              <dependency>

                 <groupId>org.primefaces</groupId>

                 <artifactId>primefaces</artifactId>

                 <!-- <version>3.0.M1</version> -->

                 <version>2.2</version>

              </dependency>

              <dependency>

                 <groupId>org.primefaces.themes</groupId>

                 <artifactId>redmond</artifactId>

                 <version>1.0.0</version>

              </dependency>

       

              <!-- Others -->

              <dependency>

                 <groupId>com.company.record</groupId>

                 <artifactId>record-dao</artifactId>

                 <version>1.0.0</version>

              </dependency>

       

              <!-- Postgresql -->

              <dependency>

                 <groupId>postgresql</groupId>

                 <artifactId>postgresql</artifactId>

                 <version>8.3-606.jdbc4</version>

                 <scope>provided</scope>

              </dependency>

       

              <dependency>

                 <groupId>jboss</groupId>

                 <artifactId>jmx-adaptor-plugin</artifactId>

                 <version>3.2.1</version>

              </dependency>

          </dependencies>

       

          <build>

            <finalName>foo.war</finalName>

            <plugins>

       

             <plugin>

              <artifactId>maven-war-plugin</artifactId>

              <version>2.1.1</version>

              <configuration>

               <useCache>false</useCache>

               <!-- Prevent a bug from plugin (see http://jira.codehaus.org/browse/MWAR-248) -->

               <packagingExcludes>WEB-INF/web.xml</packagingExcludes>

              </configuration>

             </plugin>

       

             <plugin>

              <groupId>org.codehaus.mojo</groupId>

              <artifactId>jboss-maven-plugin</artifactId>

              <version>1.5.0</version>

              <configuration>

              <fileName>${project.build.directory}/${project.build.finalName}</fileName>

              <serverName>web</serverName>

              </configuration>

             </plugin>

       

            </plugins>

           </build>

           (...)