4 Replies Latest reply on Feb 6, 2015 11:43 AM by Tomaz Cerar

    Failed to start jboss.deployment.unit.“war”.POST_MODULE

    Julius David Bacolod Newbie

      n votefavorite

       

       

      I created a Maven Project using the RESTful Web Service from Database in NetBeans by following this tutorial:

      http://jaxenter.com/from-database-to-restful-web-service-to-html5-in-10-minutes-105524.html

      and

      http://jaxenter.com/from-database-to-restful-web-service-to-html5-in-five-minutes-107078.html

      When I tried to run this in Glassfish 4.1 as a packaged war file, my RESTful Web Service works fine.

      However, I want to use JBoss EAP 6.1 instead of Glassfish, however it ran into many problems. Here's the message from JBoss when I run standalone.sh:

      18:16:33,320 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC0000
      01: Failed to start service jboss.deployment.unit."mhc-maven-jboss-1.0-SNAPSHOT.
      war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployme
      nt.unit."mhc-maven-jboss-1.0-SNAPSHOT.war".POST_MODULE: JBAS018733: Failed to pr
      ocess phase POST_MODULE of deployment "mhc-maven-jboss-1.0-SNAPSHOT.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(Deplo
      ymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.
      Final-redhat-8]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se
      rviceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-
      1]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont
      rollerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
      java:1145) [rt.jar:1.7.0_51]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
      .java:615) [rt.jar:1.7.0_51]
        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
      Caused by: java.lang.NullPointerException
        at org.jboss.as.jpa.processor.PersistenceRefProcessor.getPersistenceUnit
      BindingSource(PersistenceRefProcessor.java:203)
        at org.jboss.as.jpa.processor.PersistenceRefProcessor.getPersistenceUnit
      Refs(PersistenceRefProcessor.java:124)
        at org.jboss.as.jpa.processor.PersistenceRefProcessor.processDescriptorE
      ntries(PersistenceRefProcessor.java:75)
        at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindi
      ngsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:95)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(Deplo
      ymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.
      Final-redhat-8]
        ... 5 more

      18:16:33,370 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS0
      18559: Deployed "mhc-maven-jboss-1.0-SNAPSHOT.war" (runtime-name : "mhc-maven-jb
      oss-1.0-SNAPSHOT.war")
      18:16:33,372 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774
      : Service status report
      JBAS014777: Services which failed to start: service jboss.deployment.unit
      ."mhc-maven-jboss-1.0-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartExce
      ption in service jboss.deployment.unit."mhc-maven-jboss-1.0-SNAPSHOT.war".POST_M
      ODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "mhc-maven-
      jboss-1.0-SNAPSHOT.war"

      My pom.xml (some parts of it Auto-generated by NetBeans) is:


      @<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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>

        <groupId>org.mhc</groupId>
        <artifactId>mhc-maven-jboss</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>war</packaging>

        <name>mhc-maven-jboss</name>
        <url>http://maven.apache.org</url>

        <dependencies>
        <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
        </dependency>
        </dependencies>

        <build>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
        <source>1.6</source>
        <target>1.6</target>
        </configuration>
        </plugin>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
        </plugin>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.1</version>
        <executions>
        <execution>
        <phase>validate</phase>
        <goals>
        <goal>copy</goal>
        </goals>
        <configuration>
        <outputDirectory>${endorsed.dir}</outputDirectory>
        <silent>true</silent>
        <artifactItems>
        <artifactItem>
        <groupId>javax</groupId>
        <artifactId>javaee-endorsed-api</artifactId>
        <version>6.0</version>
        <type>jar</type>
        </artifactItem>
        </artifactItems>
        </configuration>
        </execution>
        </executions>
        </plugin>
        <plugin> 
        <groupId>org.jboss.as.plugins</groupId> 
        <artifactId>jboss-as-maven-plugin</artifactId> 
        <version>7.5.Final</version> 
        </plugin> 
        </plugins>
        </build>
        <repositories>
        <repository>
        <id>unknown-jars-temp-repo</id>
        <name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name>
        <url>file:${project.basedir}/lib</url>
        </repository>
        </repositories>
      </project>


      My persistence.xml is (which is almost the same with the one I created using Glassfish server):


      @<?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="mhcDS" transaction-type="JTA">
        <jta-data-source>java:jboss/datasources/mhcDS</jta-data-source>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties/>
        </persistence-unit>
      </persistence>


      And my JBoss' standalone.xml datasource:


      @<datasource jndi-name="java:jboss/datasources/mhcDS" pool-name="mhcDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:mysql://127.0.0.1:3306/mhcdb</connection-url>

                          <connection-property name="useUnicode">

                              true

                          </connection-property>

                          <connection-property name="characterEncoding">

                              utf8

                          </connection-property>

                          <connection-property name="autoReconnect">

                              true

                          </connection-property>

                          <driver>mysql-jdbc</driver>

                          <pool>

                              <min-pool-size>5</min-pool-size>

                              <max-pool-size>25</max-pool-size>

                          </pool>

                          <security>

                              <user-name>root</user-name>

                              <password>password</password>

                          </security>

                          <validation>

                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>

                              <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>

                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>

                          </validation>

                          <timeout>

                              <idle-timeout-minutes>1</idle-timeout-minutes>

                          </timeout>

                          <statement>

                              <prepared-statement-cache-size>32</prepared-statement-cache-size>

                          </statement>

                      </datasource>

       

      Could someone explain how to resolve this?