0

我正在使用 JBoss 7.1。我的应用程序使用的是 spring 3.1、spring security,对于 JSF 2 组件,它使用的是 Richfaces [4.2.1 final]。这是我的 web.xml 的一部分 >

    <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 中,我有用于 spring 配置的 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 文件夹包含所有 spring jar,根据我的 maven 依赖项 [在 $JBOSS_HOME\standalone\deployments\projectname\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.springframework.beans.factory.support.DefaultListableBeanFactory@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.springframework.beans.factory.support.DefaultListableBeanFactory@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 提前谢谢

4

2 回答 2

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>

也可以看看:

于 2012-10-25T01:56:10.540 回答
0

尝试代替:

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

在 /WEB-INF/applicationContext.xml 中执行以下操作:

    <import resource="applicationContext-security.xml"/>
于 2013-12-10T21:39:35.583 回答