3 Replies Latest reply on Feb 7, 2017 8:57 AM by piyushgoel996

    Failed to load module errors

    bosra

      Hi all

       

      I am getting the following errors in my project when I try to run it. The server just hangs. These problems arose after I managed to add Arquillian framework to the project. I am able to run a test but nothing else. Would anyone know why these errors are arising? I have pasted the POM.xml below too.. Thanks in advance

       

      23:11:14,297 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.module.service."deployment.webapp.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.webapp.war".main: Failed to load module: deployment.webapp.war:main

                at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_15]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_15]

                at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_15]

       

       

      Caused by: org.jboss.modules.ModuleNotFoundException: Module org.4j:main is not found in local module loader @1b688c0 (roots: /opt/jboss-as-7.1.0.Final/modules)

                at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)

                at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)

                at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)

                at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)

                at org.jboss.modules.Module.addPaths(Module.java:841)

                at org.jboss.modules.Module.link(Module.java:1181)

                at org.jboss.modules.Module.relinkIfNecessary(Module.java:1207)

                at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208)

                at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                ... 5 more

       

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

                <modelVersion>4.0.0</modelVersion>

                <parent>

                          <artifactId>project</artifactId>

                          <groupId>com.project</groupId>

                          <version>1.0 -SNAPSHOT</version>

                          <relativePath>..</relativePath>

                </parent>

                <artifactId>webapp</artifactId>

                <packaging>war</packaging>

       

       

            <url>http://jboss.org/jbossas</url>

          <licenses>

              <license>

                  <name>Apache License, Version 2.0</name>

                  <distribution>repo</distribution>

                  <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>

              </license>

          </licenses>

       

       

          <properties>

              <!-- Explicitly declaring the source encoding eliminates the following

                  message: -->

              <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered

                  resources, i.e. build is platform dependent! -->

              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

       

       

              <!-- JBoss dependency versions -->

              <jboss.as.plugin.version>7.1.1.Final</jboss.as.plugin.version>

              <!-- Define the version of the JBoss BOMs we want to import. The

                  JBoss BOMs specify tested stacks. -->

              <jboss.bom.version>1.0.0.Final</jboss.bom.version>

              <!-- Alternatively, comment out the above line, and un-comment the

                  line below to use version 1.0.2.Final-redhat-1 which is a release certified

                  to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6

                  maven repository. -->

              <!-- <jboss.bom.version>1.0.2.Final-redhat-1</jboss.bom.version> -->

       

       

              <!-- other plugin versions -->

              <compiler.plugin.version>2.3.1</compiler.plugin.version>

              <surefire.plugin.version>2.4.3</surefire.plugin.version>

              <war.plugin.version>2.1.1</war.plugin.version>

       

       

              <!-- maven-compiler-plugin -->

              <maven.compiler.target>1.6</maven.compiler.target>

              <maven.compiler.source>1.6</maven.compiler.source>

          </properties>

       

       

       

       

          <dependencyManagement>

              <dependencies>

                  <!-- JBoss distributes a complete set of Java EE 6 APIs including

                      a Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or

                      a collection) of artifacts. We use this here so that we always get the correct

                      versions of artifacts. Here we use the jboss-javaee-6.0-with-tools stack

                      (you can read this as the JBoss stack of the Java EE 6 APIs, with some extras

                      tools for your project, such as Arquillian for testing) and the jboss-javaee-6.0-with-hibernate

                      stack you can read this as the JBoss stack of the Java EE 6 APIs, with extras

                      from the Hibernate family of projects) -->

                  <dependency>

                      <groupId>org.jboss.bom</groupId>

                      <artifactId>jboss-javaee-6.0-with-tools</artifactId>

                      <version>${jboss.bom.version}</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.bom</groupId>

                      <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>

                      <version>${jboss.bom.version}</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

                  <!-- Similarly to the JBoss Java EE 6 BOM above, the RichFaces BOM specifies the

                      versions of artifacts required for using RichFaces in your project. -->

                  <dependency>

                      <groupId>org.richfaces</groupId>

                      <artifactId>richfaces-bom</artifactId>

                      <version>4.2.2.Final</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

              </dependencies>

          </dependencyManagement>

       

          <dependencies>

       

       

              <!-- First declare the APIs we depend on and need for compilation.

                  All of them are provided by JBoss AS 7 -->

       

       

              <!-- Import the CDI API, we use provided scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>javax.enterprise</groupId>

                  <artifactId>cdi-api</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Import the Common Annotations API (JSR-250), we use provided

                  scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>org.jboss.spec.javax.annotation</groupId>

                  <artifactId>jboss-annotations-api_1.1_spec</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Import the JAX-RS API, we use provided scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>org.jboss.spec.javax.ws.rs</groupId>

                  <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Import the JPA API, we use provided scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>org.hibernate.javax.persistence</groupId>

                  <artifactId>hibernate-jpa-2.0-api</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Import the EJB API, we use provided scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>org.jboss.spec.javax.ejb</groupId>

                  <artifactId>jboss-ejb-api_3.1_spec</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- JSR-303 (Bean Validation) Implementation -->

              <!-- Provides portable constraints such as @Email -->

              <!-- Hibernate Validator is shipped in JBoss AS 7 -->

              <dependency>

                  <groupId>org.hibernate</groupId>

                  <artifactId>hibernate-validator</artifactId>

                  <scope>provided</scope>

      <!--             <exclusions> -->

      <!--                 <exclusion> -->

      <!--                     <groupId>org.4j</groupId> -->

      <!--                     <artifactId>4j-api</artifactId> -->

      <!--                 </exclusion> -->

      <!--             </exclusions> -->

              </dependency>

       

       

              <!-- Import the JSF API, we use provided scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>org.jboss.spec.javax.faces</groupId>

                  <artifactId>jboss-jsf-api_2.1_spec</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Import the Servlet API, we use provided scope as the API is included in JBoss AS 7 -->

              <dependency>

                  <groupId>org.jboss.spec.javax.servlet</groupId>

                  <artifactId>jboss-servlet-api_3.0_spec</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Import the RichFaces core library -->

              <dependency>

                  <groupId>org.richfaces.core</groupId>

                  <artifactId>richfaces-core-impl</artifactId>

                  <exclusions>

                      <exclusion>

                          <artifactId>cssparser</artifactId>

                          <groupId>net.sourceforge.cssparser</groupId>

                      </exclusion>

                      <exclusion>

                          <artifactId>guava</artifactId>

                          <groupId>com.google.guava</groupId>

                      </exclusion>

                  </exclusions>

              </dependency>

              <!-- Import the RichFaces components -->

              <dependency>

                  <groupId>org.richfaces.ui</groupId>

                  <artifactId>richfaces-components-ui</artifactId>

              </dependency>

       

       

              <!-- Import the Atmosphere framework for a4j:push -->

              <dependency>

                  <groupId>org.atmosphere</groupId>

                  <artifactId>atmosphere-runtime</artifactId>

      <!--             <exclusions> -->

      <!--                 <exclusion> -->

      <!--                     <groupId>org.4j</groupId> -->

      <!--                     <artifactId>4j-api</artifactId> -->

      <!--                 </exclusion> -->

      <!--             </exclusions> -->

              </dependency>

       

       

              <!-- Now we declare any tools needed -->

       

       

              <!-- Annotation processor to generate the JPA 2.0 metamodel classes

                  for typesafe criteria queries -->

              <dependency>

                  <groupId>org.hibernate</groupId>

                  <artifactId>hibernate-jpamodelgen</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- The rewrite library allows us to do url rewriting - used here for rewriting mobile devices to mobile specific views -->

              <dependency>

                  <groupId>org.ocpsoft.rewrite</groupId>

                  <artifactId>rewrite-servlet</artifactId>

              </dependency>

       

       

              <!-- The cdi integration allows for CDI injection into the rewrite configuration class -->

              <dependency>

                  <groupId>org.ocpsoft.rewrite</groupId>

                  <artifactId>rewrite-integration-cdi</artifactId>

              </dependency>

       

       

              <!-- Annotation processor that raising compilation errors whenever

                  constraint annotations are incorrectly used. -->

              <dependency>

                  <groupId>org.hibernate</groupId>

                  <artifactId>hibernate-validator-annotation-processor</artifactId>

                  <scope>provided</scope>

              </dependency>

       

       

              <!-- Needed for running tests (you may also use TestNG) -->

              <dependency>

                  <groupId>junit</groupId>

                  <artifactId>junit</artifactId>

                  <scope>test</scope>

              </dependency>

       

       

              <!-- Optional, but highly recommended -->

              <!-- Arquillian allows you to test enterprise code such as EJBs and

                  Transactional(JTA) JPA from JUnit/TestNG -->

              <dependency>

                  <groupId>org.jboss.arquillian.junit</groupId>

                  <artifactId>arquillian-junit-container</artifactId>

                  <scope>test</scope>

              </dependency>

       

       

              <dependency>

                  <groupId>org.jboss.arquillian.protocol</groupId>

                  <artifactId>arquillian-protocol-servlet</artifactId>

                  <scope>test</scope>

              </dependency>

       

       

          </dependencies>

       

       

          <build>

              <!-- Maven will append the version to the finalName (which is the

                  name given to the generated war, and hence the context root) -->

              <finalName>${project.artifactId}</finalName>

              <plugins>

                  <!-- Compiler plugin enforces Java 1.6 compatibility and activates

                      annotation processors -->

                  <plugin>

                      <artifactId>maven-compiler-plugin</artifactId>

                      <version>${compiler.plugin.version}</version>

                      <configuration>

                          <source>${maven.compiler.source}</source>

                          <target>${maven.compiler.target}</target>

                      </configuration>

                  </plugin>

                  <plugin>

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

                      <version>${war.plugin.version}</version>

                      <configuration>

                          <!-- Java EE 6 doesn't require web.xml, Maven needs to

                              catch up! -->

                          <failOnMissingWebXml>false</failOnMissingWebXml>

                          <archive>

                              <manifestEntries>

                                  <Dependencies>com.google.guava,org.4j</Dependencies>

                              </manifestEntries>

                          </archive>

                      </configuration>

                  </plugin>

                  <!-- The JBoss AS plugin deploys your war to a local JBoss AS

                      container -->

                  <!-- To use, run: mvn package jboss-as:deploy -->

                  <plugin>

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

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

                      <version>${jboss.as.plugin.version}</version>

                  </plugin>

              </plugins>

          </build>

       

       

          <profiles>

              <profile>

                  <!-- The default profile skips all tests, though you can tune

                      it to run just unit tests based on a custom pattern -->

                  <!-- Seperate profiles are provided for running all tests, including

                      Arquillian tests that execute in the specified container -->

                  <id>default</id>

                  <activation>

                      <activeByDefault>true</activeByDefault>

                  </activation>

                  <build>

                      <plugins>

                          <plugin>

                              <artifactId>maven-surefire-plugin</artifactId>

                              <version>${surefire.plugin.version}</version>

                              <configuration>

                                  <skip>true</skip>

                              </configuration>

                          </plugin>

                      </plugins>

                  </build>

              </profile>

       

       

              <profile>

                  <!-- An optional Arquillian testing profile that executes tests

                      in your JBoss AS instance -->

                  <!-- This profile will start a new JBoss AS instance, and execute

                      the test, shutting it down when done -->

                  <!-- Run with: mvn clean test -Parq-jbossas-managed -->

                  <id>arq-jbossas-managed</id>

                  <dependencies>

                      <dependency>

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

                          <artifactId>jboss-as-arquillian-container-managed</artifactId>

                          <scope>test</scope>

                      </dependency>

                  </dependencies>

              </profile>

       

       

              <profile>

                  <!-- An optional Arquillian testing profile that executes tests

                      in a remote JBoss AS instance -->

                  <!-- Run with: mvn clean test -Parq-jbossas-remote -->

                  <id>arq-jbossas-remote</id>

                  <dependencies>

                      <dependency>

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

                          <artifactId>jboss-as-arquillian-container-remote</artifactId>

                          <scope>test</scope>

                      </dependency>

                  </dependencies>

              </profile>

       

       

              <profile>

                  <!-- When built in OpenShift the 'openshift' profile will be

                      used when invoking mvn. -->

                  <!-- Use this profile for any OpenShift specific customization

                      your app will need. -->

                  <!-- By default that is to put the resulting archive into the

                      'deployments' folder. -->

                  <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->

                  <id>openshift</id>

                  <build>

                      <plugins>

                          <plugin>

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

                              <version>${war.plugin.version}</version>

                              <configuration>

                                  <outputDirectory>deployments</outputDirectory>

                                  <warName>ROOT</warName>

                              </configuration>

                          </plugin>

                      </plugins>

                  </build>

              </profile>

       

       

              <profile>

                  <!-- Activate this profile to identify to the IDE which version of the JSF impl is being used by the

                      application server.-->

                  <!-- Be sure to include the JBoss maven repository, as the JBoss jsf-impl artifacts are not in maven

                      central. -->

                  <!-- See: https://community.jboss.org/wiki/MavenGettingStarted-Developers -->

                  <id>debug</id>

                  <dependencies>

                      <!-- Import the JSF impl, to allow for application debugging -->

                      <dependency>

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

                          <artifactId>jsf-impl</artifactId>

                          <scope>provided</scope>

                      </dependency>

                  </dependencies>

              </profile>

       

       

          </profiles>

      </project>