2 Replies Latest reply on May 23, 2012 12:15 PM by Sabarinath Selvaraj

    Not installing optional component org.ajax4jsf.Filter due to exception: java.lang.ClassNotFoundException:

    Sabarinath Selvaraj Newbie

      I'm learing RichFaces now for my JSF project, but i have problem while deploying it in JBoss 7.1.1.

       

      user.java

       

      package demo;

       

       

      public class user {

       

         private String name="";

       

         public String getName() {

       

            return name;

       

         }

       

         public void setName(String name) {

       

            this.name = name;

       

         }

       

      }

       

       

       

      faces-config.xml

       

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

       

      <faces-config version="1.2"

       

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

       

                          xmlns:xi="http://www.w3.org/2001/XInclude"

       

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

       

         <managed-bean>

       

            <description>UsernName Bean</description>

       

            <managed-bean-name>user</managed-bean-name>

       

            <managed-bean-class>demo.user</managed-bean-class>

       

            <managed-bean-scope>request</managed-bean-scope>

       

            <managed-property>

       

               <property-name>name</property-name>

       

               <property-class>java.lang.String</property-class>

       

               <value/>

       

            </managed-property>

       

         </managed-bean>

       

      </faces-config>

       

      web.xml

       

      <?xml version="1.0"?>

       

      <web-app version="2.5"

       

                      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-app_2_5.xsd">

       

      <display-name>Greeter</display-name>

       

       

       

      <context-param>

       

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

       

         <param-value>server</param-value>

       

      </context-param>

       

       

       

      <context-param>

       

         <param-name>org.richfaces.SKIN</param-name>

       

         <param-value>blueSky</param-value>

       

      </context-param>

       

       

       

      <context-param>

       

            <param-name>org.richfaces.CONTROL_SKINNING</param-name>

       

            <param-value>enable</param-value>

       

      </context-param>

       

       

       

      <filter>

       

         <display-name>RichFaces Filter</display-name>

       

         <filter-name>richfaces</filter-name>

       

         <filter-class>org.ajax4jsf.Filter</filter-class>

       

      </filter>

       

       

       

      <filter-mapping>

       

         <filter-name>richfaces</filter-name>

       

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

       

         <dispatcher>REQUEST</dispatcher>

       

         <dispatcher>FORWARD</dispatcher>

       

         <dispatcher>INCLUDE</dispatcher>

       

      </filter-mapping>

       

       

       

      <listener>

       

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

       

      </listener>

       

       

       

      <!-- Faces Servlet -->

       

      <servlet>

       

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

       

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

       

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

       

      </servlet>

       

       

       

      <!-- Faces Servlet Mapping -->

       

      <servlet-mapping>

       

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

       

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

       

      </servlet-mapping>

       

       

       

      <login-config>

       

         <auth-method>BASIC</auth-method>

       

         </login-config>

       

         <welcome-file-list>

          <welcome-file>

                index.html

            </welcome-file>

          </welcome-file-list>

       

      </web-app>

       

       

      index.html

       

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

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xmlns:f="http://java.sun.com/jsf/core"

            xmlns:h="http://java.sun.com/jsf/html"

            xmlns:a4j="http://richfaces.org/a4j"

            xmlns:rich="http://richfaces.org/rich" >

       

       

       

            <h:body>

       

                  <f:view>

       

                        <a4j:form>

       

                              <rich:panel header="RichFaces Greeter" style="width: 315px">

       

                                    <h:outputText value="Your name: " />

       

                                    <h:inputText value="#{user.name}" >

       

                                          <f:validateLength minimum="1" maximum="30" />

       

                                    </h:inputText>

       

       

       

                                    <a4j:commandButton value="Get greeting" reRender="greeting" />

       

       

       

                                    <h:panelGroup id="greeting" >

       

                                          <h:outputText value="Hello, " rendered="#{not empty user.name}" />

       

                                          <h:outputText value="#{user.name}" />

       

                                          <h:outputText value="!" rendered="#{not empty user.name}" />

       

                                    </h:panelGroup>

       

                              </rich:panel>

       

                        </a4j:form>

       

                  </f:view>

       

            </h:body>

       

      </html>

       

      I m include the following jar's under WEB-INF/lib

       

      richfaces-archetype-kitchensink.jar

      richfaces-archetype-simpleapp.jar

      richfaces-components-api-4.2.2.Final.jar

      richfaces-components-api-4.2.2.Final-sources.jar

      richfaces-components-ui-4.2.2.Final.jar

      richfaces-components-ui-4.2.2.Final-sources.jar

      richfaces-core-api-4.2.2.Final.jar

      richfaces-core-api-4.2.2.Final-sources.jar

      richfaces-core-impl-4.2.2.Final.jar

      richfaces-core-impl-4.2.2.Final-sources.jar

       

      I got the following error while deploying(in JBoss 7.1.1) :

       

      17:44:07,312 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "RichFacesExample.war"

      17:44:09,225 ERROR [org.jboss.web] (MSC service thread 1-2) JBAS018211: Could not load JSF managed bean class: org.richfaces.skin.SkinBean

      17:44:09,227 ERROR [org.jboss.web] (MSC service thread 1-2) JBAS018211: Could not load JSF managed bean class: org.richfaces.VersionBean

      17:44:09,267 WARN  [org.jboss.as.ee] (MSC service thread 1-8) JBAS011006: Not installing optional component org.ajax4jsf.Filter due to exception: java.lang.ClassNotFoundException: org.ajax4jsf.Fi

      lter from [Module "deployment.RichFacesExample.war:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [rt.jar:1.6.0_06]

              at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_06]

              at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_06]

              at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:79)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.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$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]

              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]

       

      17:44:09,295 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."RichFacesExample.war".INSTALL: org.jboss.msc.service.StartExcepti

      on in service jboss.deployment.unit."RichFacesExample.war".INSTALL: Failed to process phase INSTALL of deployment "RichFacesExample.war"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.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$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_06]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_06]

              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_06]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Deployment error processing SCI for JAR: richfaces-core-impl-4.2.2.Final-sources.jar

              at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:186)

              at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:121)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

              ... 5 more

      Caused by: java.lang.ClassNotFoundException: org.richfaces.webapp.RichFacesServletsInitializer from [Module "deployment.RichFacesExample.war:main" from Service Module Loader]

              at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]

              at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:183)

              ... 7 more

       

      17:44:09,321 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "RichFacesExample.war" was rolled back with failure message {"JBAS014671: Failed services

      " => {"jboss.deployment.unit.\"RichFacesExample.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"RichFacesExample.war\".INSTALL: Failed to process phase

      INSTALL of deployment \"RichFacesExample.war\""}}

      17:44:09,334 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment RichFacesExample.war in 13ms

      17:44:09,336 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."RichFacesExample.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."RichFacesEx

      ample.war".INSTALL: Failed to process phase INSTALL of deployment "RichFacesExample.war"

       

      17:44:09,344 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2

      " => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"RichFacesExample.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"RichFacesExample.war\"

      .INSTALL: Failed to process phase INSTALL of deployment \"RichFacesExample.war\""}}}}

       

       

       

       

       

       

       

       

       

       


       

       

       

      Thanks Advance