2012-10-24 45 views
0

我正在使用JBoss 7.1。我的應用程序使用spring 3.1,spring安全性,對於使用Richfaces [4.2.1 final]的JSF 2組件。 這裏是我的web.xml的一部分>JBoss 7.1上的Spring安全性錯誤>沒有定義名爲'springSecurityFilterChain'的bean

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:**/*Context.xml</param-value> 
</context-param> 

<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 

    <filter> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 
</filter> 
<filter-mapping> 
    <filter-name>springSecurityFilterChain</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

內部WEB-INF,我有applicationContext.xml中和securityContext.xml春天配置。 我曾嘗試與該配置過於>

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:**/applicationContext.xml, classpath:**/securityContext.xml </param-value> 
</context-param> 

而且,正如我檢查我可以看到WEB-INF \ lib文件夾包括:根據我的Maven依賴[$ JBOSS_HOME \獨立的內部失敗後部署預計所有春天罐子\部署\項目名稱\ WEB-INF \ lib中]

而且,當我試圖把它從Eclipse的部署,現在的錯誤堆棧跟蹤:

09:52:50,588 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA 
09:52:51,998 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA 
09:52:52,179 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting 
09:52:59,384 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http) 
09:52:59,435 INFO [org.xnio] XNIO Version 3.0.3.GA 
09:52:59,563 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA 
09:52:59,623 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA 
09:52:59,784 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers 
09:52:59,983 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem 
09:52:59,982 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem 
09:52:59,995 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension 
09:52:59,992 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem. 
09:52:59,990 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem 
09:52:59,991 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem 
09:53:00,580 INFO [org.jboss.as.security] (MSC service thread 1-5) JBAS013100: Current PicketBox version=4.0.7.Final 
09:53:00,906 INFO [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final) 
09:53:02,387 INFO [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service 
09:53:02,478 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default] 
09:53:03,552 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3) 
09:53:05,215 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080 
09:53:07,662 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-1) JBoss Web Services - Stack CXF Server 4.0.2.GA 
09:53:10,500 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory F:\work\softwares\Application Servers\JBoss\jboss-as-7.1.1.Final\jboss-as-7.1.1.Final\standalone\deployments 
09:53:10,648 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found com.misl.treasury.ui.war in deployment directory. To trigger deployment create a file called com.misl.treasury.ui.war.dodeploy 
09:53:10,719 INFO [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on localhost/127.0.0.1:4447 
09:53:10,719 INFO [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on /127.0.0.1:9999 
09:53:11,471 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS] 
09:53:12,046 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "com.misl.treasury.ui.war" 
09:53:24,162 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/com.misl.treasury.ui]] (MSC service thread 1-2) No Spring WebApplicationInitializer types detected on classpath 
09:53:24,238 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/com.misl.treasury.ui]] (MSC service thread 1-2) Initializing Spring root WebApplicationContext 
09:53:24,242 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Root WebApplicationContext: initialization started 
09:53:24,337 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-2) Refreshing Root WebApplicationContext: startup date [Wed Oct 24 09:53:24 ALMT 2012]; root of context hierarchy 
09:53:24,472 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-2) Pre-instantiating singletons in org.s[email protected]15dd61: defining beans []; root of factory hierarchy 
09:53:24,479 INFO [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Root WebApplicationContext: initialization completed in 234 ms 
09:53:24,575 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/com.misl.treasury.ui]] (MSC service thread 1-2) Exception starting filter springSecurityFilterChain: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1097) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:326) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:236) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:194) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE] 
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3269) [jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3865) [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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_23] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_23] 
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_23] 

09:53:24,613 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error filterStart 
09:53:24,615 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/com.misl.treasury.ui] startup failed due to previous errors 
09:53:24,617 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/com.misl.treasury.ui]] (MSC service thread 1-2) Closing Spring root WebApplicationContext 
09:53:24,620 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-2) Closing Root WebApplicationContext: startup date [Wed Oct 24 09:53:24 ALMT 2012]; root of context hierarchy 
09:53:24,623 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-2) Destroying singletons in org.s[email protected]15dd61: defining beans []; root of factory hierarchy 
09:53:24,688 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host."/com.misl.treasury.ui": org.jboss.msc.service.StartException in service jboss.web.deployment.default-host."/com.misl.treasury.ui": JBAS018040: Failed to start context 
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95) 
    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:886) [rt.jar:1.6.0_23] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_23] 
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_23] 

09:53:24,703 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015951: Admin console listening on http://127.0.0.1:9990 
09:53:24,705 ERROR [org.jboss.as] (MSC service thread 1-2) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 35657ms - Started 460 of 539 services (2 services failed or missing dependencies, 76 services are passive or on-demand) 
09:53:24,908 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "com.misl.treasury.ui.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host.\"/com.misl.treasury.ui\"" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host.\"/com.misl.treasury.ui\": JBAS018040: Failed to start context"}} 
09:53:24,913 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report 
JBAS014777: Services which failed to start:  service jboss.web.deployment.default-host."/com.misl.treasury.ui": org.jboss.msc.service.StartException in service jboss.web.deployment.default-host."/com.misl.treasury.ui": JBAS018040: Failed to start context 

09:53:24,937 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.web.deployment.default-host.\"/com.misl.treasury.ui\"" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host.\"/com.misl.treasury.ui\": JBAS018040: Failed to start context"}}}} 
09:53:25,282 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment com.misl.treasury.ui.war in 361ms 

這個程序是工作的罰款,直到我開始把它從Tomcat 7遷移到JBoss 7.1 在此先感謝

回答

1

/WEB-INF不在類路徑中。你必須包括你的Spring配置文件象下面這樣:

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value> 
     /WEB-INF/applicationContext.xml 
     /WEB-INF/securityContext.xml 
    </param-value> 
</context-param> 

參見:

+0

由於拉維。擺脫了春季配置錯誤。儘管我現在有新的錯誤。但是,這看起來像一個JSF錯誤。我會爲此提出一個單獨的問題。 – Mashrur

0

嘗試,而不是:

 <param-value> 
     /WEB-INF/applicationContext.xml 
     /WEB-INF/applicationContext-security.xml 
    </param-value> 

做以下的/WEB-INF/applicationContext.xml的:

<import resource="applicationContext-security.xml"/> 
+0

爲什麼?爲什麼會更好? – eis

相關問題