Wildfly:ClassNotFoundException:org.ajax4jsf.Filter

时间:2014-08-28 12:06:15

标签: java maven netbeans wildfly wildfly-8

我正在尝试在Wildfly上运行WAR项目,尽管它失败了。这个项目非常基础。除了修改过的pom.xml和web.xml之外,其他内容都没有。除此之外,它是NetBeans中创建的Maven / Web应用程序。

我要做的是创建使用Maven构建的最简单的最RichFaces项目。设置有什么问题?

在这里您可以找到输出,pom.xml和web.xml。

输出:

makachi@lpt-makachi-xps:~$ ./wildfly-8.1.0.Final/bin/standalone.sh 
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/makachi/wildfly-8.1.0.Final

  JAVA: java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
20:59:00,650 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
20:59:00,873 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
20:59:00,952 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.1.0.Final "Kenny" starting
20:59:02,047 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment abc.war
20:59:02,067 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
20:59:02,089 INFO  [org.xnio] (MSC service thread 1-15) XNIO version 3.2.2.Final
20:59:02,096 INFO  [org.xnio.nio] (MSC service thread 1-15) XNIO NIO Implementation Version 3.2.2.Final
20:59:02,122 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
20:59:02,126 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
20:59:02,136 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
20:59:02,151 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
20:59:02,164 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
20:59:02,166 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
20:59:02,167 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.5.Final)
20:59:02,178 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
20:59:02,186 INFO  [org.jboss.as.security] (MSC service thread 1-7) JBAS013170: Current PicketBox version=4.0.21.Beta1
20:59:02,190 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
20:59:02,193 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-11) JBAS010417: Started Driver service with driver-name = h2
20:59:02,193 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-13) JBAS017502: Undertow 1.0.15.Final starting
20:59:02,195 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.0.15.Final starting
20:59:02,276 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service
20:59:02,279 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-8) JBAS015400: Bound mail session [java:jboss/mail/Default]
20:59:02,309 INFO  [org.jboss.remoting] (MSC service thread 1-15) JBoss Remoting version 4.0.3.Final
20:59:02,500 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path /home/makachi/wildfly-8.1.0.Final/welcome-content
20:59:02,514 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017525: Started server default-server.
20:59:02,535 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-16) JBAS017531: Host default-host starting
20:59:02,633 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017519: Undertow HTTP listener default listening on /127.0.0.1:8080
20:59:02,724 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) JBAS015012: Started FileSystemDeploymentService for directory /home/makachi/wildfly-8.1.0.Final/standalone/deployments
20:59:02,731 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "abc.war" (runtime-name: "abc.war")
20:59:02,779 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-12) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
20:59:03,018 INFO  [org.jboss.ws.common.management] (MSC service thread 1-9) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.4.Final
20:59:03,616 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment abc.war
20:59:03,689 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-7) HV000001: Hibernate Validator 5.1.0.Final
20:59:03,846 WARN  [org.jboss.as.ee] (MSC service thread 1-16) JBAS011006: Not installing optional component org.ajax4jsf.Filter due to an exception (enable DEBUG log level to see the cause)
20:59:03,935 INFO  [org.jboss.weld.deployer] (MSC service thread 1-16) JBAS016005: Starting Services for CDI deployment: abc.war
20:59:03,978 INFO  [org.jboss.weld.Version] (MSC service thread 1-16) WELD-000900: 2.1.2 (Final)
20:59:04,023 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment abc.war
20:59:04,384 INFO  [org.jboss.weld.Bootstrap] (weld-worker-8) WELD-000119: Not generating any bean definitions from org.ajax4jsf.Filter because of underlying class loading error: Type org.ajax4jsf.Filter from [Module "deployment.abc.war:main" from Service Module Loader] not found.  If this is unexpected, enable DEBUG logging to see the full error.
20:59:04,871 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.ajax4jsf.Filter from [Module "deployment.abc.war:main" from Service Module Loader]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:884)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:245)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
Caused by: java.lang.ClassNotFoundException: org.ajax4jsf.Filter from [Module "deployment.abc.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:689)
    ... 6 more

20:59:04,879 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "abc.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.ajax4jsf.Filter from [Module \"deployment.abc.war:main\" from Service Module Loader]
    Caused by: java.lang.ClassNotFoundException: org.ajax4jsf.Filter from [Module \"deployment.abc.war:main\" from Service Module Loader]"}}
20:59:04,925 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "abc.war" (runtime-name : "abc.war")
20:59:04,927 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.ajax4jsf.Filter from [Module "deployment.abc.war:main" from Service Module Loader]

20:59:05,057 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
20:59:05,058 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
20:59:05,059 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: WildFly 8.1.0.Final "Kenny" started (with errors) in 4762ms - Started 284 of 341 services (3 services failed or missing dependencies, 91 services are lazy, passive or on-demand)
20:59:05,169 INFO  [org.jboss.weld.deployer] (MSC service thread 1-14) JBAS016009: Stopping weld service for deployment abc.war
20:59:05,204 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015877: Stopped deployment abc.war (runtime-name: abc.war) in 49ms
20:59:05,312 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018558: Undeployed "abc.war" (runtime-name: "abc.war")
20:59:05,315 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."abc.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.deployment.unit."abc.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.deployment.unit."abc.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.deployment.unit."abc.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.deployment.unit."abc.war".component."managed-bean.org.richfaces.skin.SkinBean".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.deployment.unit."abc.war".component."org.jboss.weld.servlet.WeldInitialListener".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.deployment.unit."abc.war".component."org.jboss.weld.servlet.WeldTerminalListener".START (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./abc] 
      service jboss.undertow.deployment.default-server.default-host./abc (missing) dependents: [service jboss.deployment.unit."abc.war".deploymentCompleteService] 
JBAS014777:   Services which failed to start:      service jboss.undertow.deployment.default-server.default-host./abc.UndertowDeploymentInfoService

的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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>com.glasses</groupId>
    <artifactId>abc</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>

    <name>abc</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-api</artifactId>
            <version>4.3.7.Final</version>
        </dependency>
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-impl</artifactId>
            <version>4.3.7.Final</version>
        </dependency>
        <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-components-ui</artifactId>
            <version>4.3.7.Final</version>
        </dependency>
        <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-components-api</artifactId>
            <version>4.3.7.Final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</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>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

的web.xml:

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

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
    <display-name>abc</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>
</web-app>

1 个答案:

答案 0 :(得分:1)

根据对此SO Question的接受回答,org.ajax4jsf.Filter不应在web.xml上声明,因为只有RichFaces 3.x需要(您使用的是RichFaces 4.x )。

我希望这会有所帮助。