将应用程序部署到JBoss AS 7.1.1时出现以下异常。
将相同的应用程序部署到Glassfish 3或4时,我对CDI对话过滤器没有任何问题。
22:53:33,911 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-5) Context [/basic-angularjs-ee] startup failed due to previous errors: java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name CDI Conversation Filter
at org.apache.catalina.core.StandardContext.validateFilterMap(StandardContext.java:2040) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:1996) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.JBossContextConfig.processWebMetaData(JBossContextConfig.java:314) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.web.deployment.JBossContextConfig.applicationWebConfig(JBossContextConfig.java:169) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:417) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:182) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:162) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3790) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
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]
的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_3_0.xsd"
version="3.0">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<filter-mapping>
<filter-name>CDI Conversation Filter</filter-name>
<url-pattern>/resources/*</url-pattern>
</filter-mapping>
</web-app>
答案 0 :(得分:1)
据我所知,过滤器名称是特定于平台的。过滤器的默认映射是/*
,所以您真的需要更改映射吗?
答案 1 :(得分:0)
您必须编写类名,因为它是在要使用过滤器的项目中编写的。不带空格和区分大小写。看起来像问题。