【发布时间】:2014-01-31 13:48:24
【问题描述】:
技术是 spring-web-flow2.3.0。 jsf2.0 springsecurity3.0 primefaces4.0
我正在低于错误。 请给我建议....
错误:
18:15:47,076 错误 [org.springframework.web.context.ContextLoader](MSC 服务线程 1-5)上下文初始化失败:org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:导入失败来自相对位置的 bean 定义 [webmvc-config.xml] 违规资源:ServletContext资源[/WEB-INF/config/web-application-config.xml];嵌套异常是 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自 ServletContext 资源 [/WEB-INF/config/webmvc-config.xml] 的 XML 文档中的第 11 行无效;嵌套异常是 org.xml.sax.SAXParseException;行号:11;列号:21; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素“faces:resources”的声明。 在 org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 在 java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03] 引起:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自ServletContext资源[/WEB-INF/config/webmvc-config.xml]的XML文档中的第11行无效;嵌套异常是 org.xml.sax.SAXParseException;行号:11;列号:21; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素“faces:resources”的声明。 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:255) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] ... 27 更多 引起:org.xml.sax.SAXParseException;行号:11;列号:21; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素“faces:resources”的声明。 在 org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:196) 在 org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:132) 在 org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:285) 在 org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] ... 30 更多
18:15:47,096 错误 [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/eSociety-web]](MSC 服务线程 1-5)异常发送上下文初始化事件到类 org.springframework.web.context.ContextLoaderListener 的侦听器实例:org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法从相对位置导入 bean 定义 [webmvc-config.xml] 违规资源:ServletContext资源[/WEB-INF/config/web-application-config.xml];嵌套异常是 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自 ServletContext 资源 [/WEB-INF/config/webmvc-config.xml] 的 XML 文档中的第 11 行无效;嵌套异常是 org.xml.sax.SAXParseException;行号:11;列号:21; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素“faces:resources”的声明。 在 org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:] 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:] 在 org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 在 java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03] 引起:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自ServletContext资源[/WEB-INF/config/webmvc-config.xml]的XML文档中的第11行无效;嵌套异常是 org.xml.sax.SAXParseException;行号:11;列号:21; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素“faces:resources”的声明。 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:255) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] ... 27 更多 引起:org.xml.sax.SAXParseException;行号:11;列号:21; cvc-complex-type.2.4.c:匹配通配符是严格的,但找不到元素“faces:resources”的声明。 在 org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:196) 在 org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:132) 在 org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:390) 在 org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:322) 在 org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:285) 在 org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE] ... 30 更多
18:15:47,249 INFO [javax.enterprise.resource.webcontainer.jsf.config](MSC 服务线程 1-5)为上下文“/eSociety-”初始化 Mojarra 2.1.7-jbossorg-1 (20120227-1401)网络' 18:15:50,509 INFO [org.primefaces.webapp.PostConstructApplicationEventListener](MSC 服务线程 1-5)在 PrimeFaces 4.0 上运行 18:15:50,527 INFO [org.primefaces.extensions.application.PostConstructApplicationEventListener](MSC 服务线程 1-5)在 PrimeFaces 扩展 0.6.3 上运行 18:15:50,588 错误 [org.apache.catalina.core.StandardContext](MSC 服务线程 1-5)错误 listenerStart 18:15:50,588 错误 [org.apache.catalina.core.StandardContext](MSC 服务线程 1-5)上下文 [/eSociety-web] 由于先前的错误,启动失败 18:15:50,589 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/eSociety-web]](MSC 服务线程 1-5)关闭 Spring 根 WebApplicationContext 18:15:50,589 INFO [org.springframework.web.context.support.XmlWebApplicationContext](MSC 服务线程 1-5)Closing Root WebApplicationContext:启动日期 [Fri Jan 31 18:14:22 IST 2014];上下文层次的根 18:15:50,591 WARN [org.springframework.web.context.support.XmlWebApplicationContext](MSC 服务线程 1-5)从 ApplicationListener 处理 ContextClosedEvent 引发的异常:java.lang.IllegalStateException:ApplicationEventMulticaster 未初始化 - 在多播之前调用“刷新”通过上下文的事件:Root WebApplicationContext:启动日期 [Fri Jan 31 18:14:22 IST 2014];上下文层次的根 在 org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 在 java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
18:15:50,596 WARN [org.springframework.web.context.support.XmlWebApplicationContext](MSC 服务线程 1-5)在上下文关闭时从 LifecycleProcessor 抛出异常:java.lang.IllegalStateException:LifecycleProcessor 未初始化 - 调用'在通过上下文调用生命周期方法之前刷新':Root WebApplicationContext:启动日期[Fri Jan 31 18:14:22 IST 2014];上下文层次的根 在 org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 在 java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
18:15:50,600 错误 [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/eSociety-web]](MSC 服务线程 1-5)异常发送上下文org.springframework.web.context.ContextLoaderListener 类的监听器实例的销毁事件:java.lang.IllegalStateException:BeanFactory 未初始化或已关闭 - 在通过 ApplicationContext 访问 bean 之前调用“刷新” 在 org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171) [spring-context-3.2.1.RELEASE.jar:3.2.1.RELEASE] 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03] 在 java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
18:15:50,616 错误 [org.jboss.msc.service.fail](MSC 服务线程 1-5)MSC00001:无法启动服务 jboss.web.deployment.default-host./eSociety-web:org服务 jboss.web.deployment.default-host./eSociety-web 中的 .jboss.msc.service.StartException:JBAS018040:无法启动上下文 在 org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) ]
This is my webmvc-flow.xml
please suggest me.....
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:faces="http://www.springframework.org/schema/faces"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.4.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
<faces:resources />
<!-- Maps request URIs to controllers. Here we have two kinds of flows one is login flow and another is main flow -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<value>
/main=flowController
/login=loginController
</value>
</property>
<property name="defaultHandler">
<!-- Selects view names to render based on the request URI: e.g. /main selects "main" -->
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
</property>
</bean>
<!-- it is used to handle the flow control Adaptor in 2.3.0. This will come from spring framework.web.servlet3.2.1 -->
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
<!-- it trigers to the loginFlowController -->
<bean id="loginController" class="com.LoginFlowController">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
<!-- Handles requests mapped to the Spring Web Flow system and ajaxHandler.
after security we need to enable the ajax for that we need to write one property i.e ajaxHandler -->
<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
<property name="flowExecutor" ref="flowExecutor" />
<property name="ajaxHandler">
<bean class="org.springframework.faces.webflow.JsfAjaxHandler"/>
</property>
</bean>
<!-- Maps logical view names to Facelet templates in /WEB-INF (e.g. 'search' to '/WEB-INF/search.xhtml' -->
<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
<property name="prefix" value="/WEB-INF/" />
<property name="suffix" value=".xhtml" />
</bean>
<bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" />
<!-- ========================= MESSAGE SOURCE DEFINITION ========================= -->
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="messages" />
</bean>
</beans>
【问题讨论】:
-
你检查了那个错误信息吗?这条线呢?
Line 11 in XML document from ServletContext resource [/WEB-INF/config/webmvc-config.xml] is invalid; -
在第 11 行我这样写“
”如果我要删除这个总项目不起作用.....即总 ui 页面无法正确显示 -
我们需要的不仅仅是这条线。我建议通过一些 XML 验证器运行它。甚至还有在线的。 Google 是您的朋友。
-
我正在附加 webmvc-flow.xml 文件,请建议我
标签: primefaces