0 Replies Latest reply on Sep 10, 2014 8:01 AM by Ajay Kumar

    Jboss Seam + EJB + JSF integration issue

    Ajay Kumar Newbie

      Hi,

       

         I am trying to create simple project with jboss seam, ejb and jsf.

      while deployment  to jboss-eap-6.1 server I am getting errors like below.

       

      17:04:43,387 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.unit."my-seam-project.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."my-seam-project.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "my-seam-project.war"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.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(ServiceControllerImpl.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(ServiceControllerImpl.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_60]

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

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014395: Could not load component class org.jboss.seam.servlet.SeamListener

              at org.jboss.as.ejb3.deployment.processors.dd.DeploymentDescriptorInterceptorBindingsProcessor.deploy(DeploymentDescriptorInterceptorBindingsProcessor.java:135)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              ... 5 more

       

      17:04:43,413 ERROR [org.jboss.as.server] (HttpManagementService-threads - 36) JBAS015870: Deploy of deployment "my-seam-project.war" was rolled back with the following failure message:

      {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"my-seam-project.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"my-seam-project.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"my-seam-project.war\"

          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014395: Could not load component class org.jboss.seam.servlet.SeamListener"}}

      17:04:43,450 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment my-seam-project.war (runtime-name: my-seam-project.war) in 37ms.

       

      I have below configuration for my project.

      1. WEB-INF/web.xml.

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

        id="WebApp_ID" version="2.5">

       

        <listener>

             <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>

        </listener>

         <listener>

             <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

        </listener>

        <context-param>

             param-name>javax.faces.DEFAULT_SUFFIX</param-name>

             <param-value>.xhtml</param-value>

        </context-param>

        <servlet>

            <servlet-name>Faces Servlet</servlet-name>

             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

             <load-on-startup>1</load-on-startup>

        </servlet>

       

       

        <servlet-mapping>

             <servlet-name>Faces Servlet</servlet-name>

             <url-pattern>*.seam</url-pattern>

        </servlet-mapping>


        <session-config>

             <session-timeout>10</session-timeout>

        </session-config>

      </web-app>

       

      2.  WEB-INF/ejb-jar.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"

        version="3.0">

       

       

        <interceptors>

        <interceptor>

        <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>

        </interceptor>

        </interceptors>

       

       

        <assembly-descriptor>

        <interceptor-binding>

        <ejb-name>*</ejb-name>

        <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>

        </interceptor-binding>

        </assembly-descriptor>

       

      </ejb-jar>

      </ejb-jar>


      3. WEB-INF/components.xml


      <?xml version="1.0" encoding="UTF-8"?>

      <components xmlns="http://jboss.com/products/seam/components"     xmlns:core="http://jboss.com/products/seam/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                  xsi:schemaLocation=  "http://jboss.com/products/seam/core  http://jboss.com/products/seam/core-2.2.xsd http://jboss.com/products/seam/components  http://jboss.com/products/seam/components-2.2.xsd">

       

        <core:init debug="true" jndi-pattern="@jndiPattern@" />

       

      </components>

       

      4. WEB-INF/faces-config.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <faces-config xmlns="http://java.sun.com/xml/ns/javaee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee       http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"  version="1.2">

       

        <application>

             <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>

        </application>

      </faces-config>


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

        <groupId>com.ajay</groupId>

        <artifactId>my-seam-project</artifactId>

        <packaging>war</packaging>

        <version>1.0-SNAPSHOT</version>

        <name>my-seam-project Maven Webapp</name>

        <url>http://maven.apache.org</url>

        <dependencies>

        <dependency>

        <groupId>junit</groupId>

        <artifactId>junit</artifactId>

        <version>3.8.1</version>

        <scope>test</scope>

        </dependency>

       

       

        <!-- JBoss Seam minimal -->

        <dependency>

        <groupId>org.jboss.seam</groupId>

        <artifactId>jboss-seam</artifactId>

        <version>2.0.1.GA</version>

        <scope>provided</scope>

        </dependency>

        <dependency>

        <groupId>org.jboss.seam</groupId>

        <artifactId>jboss-seam-ui</artifactId>

        <version>2.0.1.GA</version>

        <scope>provided</scope>

        </dependency>

       

       

        <!-- JSF and facelets -->

        <dependency>

        <groupId>javax.faces</groupId>

        <artifactId>jsf-api</artifactId>

        <version>1.2_04-p02</version>

        </dependency>

       

       

        <dependency>

        <groupId>com.sun.facelets</groupId>

        <artifactId>jsf-facelets</artifactId>

        <version>1.1.11</version>

        </dependency>

       

       

        <!-- ejb dependency -->

        <dependency>

        <groupId>org.jboss.ejb3</groupId>

        <artifactId>jboss-ejb3-ext-api</artifactId>

        <version>1.1.1</version>

        <scope>compile</scope>

        </dependency>

        </dependencies>

        <build>

        <finalName>my-seam-project</finalName>

       

       

        <plugins>

        <plugin>

        <groupId>org.apache.maven.plugins</groupId>

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

        <configuration>

        <source>1.7</source>

        <target>1.7</target>

        </configuration>

        </plugin>

        <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-idea-plugin</artifactId>

        <configuration>

        <downloadSources>true</downloadSources>

        <downloadJavadocs>true</downloadJavadocs>

        </configuration>

        </plugin>

        </plugins>

       

       

        </build>

       

       

        <repositories>

        <repository>

        <id>repository.jboss.org</id>

        <url>http://repository.jboss.org/maven2</url>

        <snapshots>

        <enabled>true</enabled>

        </snapshots>

        </repository>

        </repositories>

      </project>

       

      can anyone please help me out what wrong i did?