Chinaunix首页 | 论坛 | 博客
  • 博客访问: 540325
  • 博文数量: 59
  • 博客积分: 1169
  • 博客等级: 少尉
  • 技术积分: 572
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-01 18:03
个人简介

信息量太大,每天疲于辨别信息得真伪。

文章分类

全部博文(59)

文章存档

2016年(1)

2014年(9)

2013年(1)

2011年(48)

分类: Java

2014-08-11 15:23:17

在整合spring security时,报了一个异常,说是找不到spring security的命名空间。其实是找不到解析这个命名空间的handle。只要把jar包spring-security-config加上就好了。如果有自定义的标签在spring配置文件中使用,需要在META-INFO中加入spring.handlers和spring.schemas。
maven配置信息如下

<dependency>

<groupId>org.springframework.securitygroupId>

<artifactId>spring-security-configartifactId>

<version>3.2.4.RELEASEversion>

dependency>




点击(此处)折叠或打开

  1. 15:15:49,460 ERROR main org.springframework.web.context.ContextLoader - Context initialization failed
  2. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
  3. Offending resource: file [/Users/qyfmac/Documents/workspace4.3/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/box-web/WEB-INF/classes/applicationContext-security.xml]

  4.     at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
  5.     at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
  6.     at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
  7.     at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:318)
  8.     at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1435)
  9.     at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
  10.     at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)
  11.     at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
  12.     at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
  13.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
  14.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
  15.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
  16.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
  17.     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
  18.     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
  19.     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
  20.     at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
  21.     at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
  22.     at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
  23.     at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
  24.     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
  25.     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
  26.     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
  27.     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  28.     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
  29.     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
  30.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  31.     at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
  32.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  33.     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
  34.     at org.apache.catalina.core.StandardService.start(StandardService.java:525)
  35.     at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
  36.     at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
  37.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  38.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  39.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  40.     at java.lang.reflect.Method.invoke(Method.java:597)
  41.     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  42.     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  43. 2014-8-11 15:15:49 org.apache.catalina.core.StandardContext listenerStart
  44. 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  45. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
  46. Offending resource: file [/Users/qyfmac/Documents/workspace4.3/.metadata/.plugins/org.eclipse.wst.server.core/tmp9/wtpwebapps/box-web/WEB-INF/classes/applicationContext-security.xml]

  47.     at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
  48.     at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
  49.     at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)
  50.     at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:318)
  51.     at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1435)
  52.     at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
  53.     at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:195)
  54.     at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
  55.     at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
  56.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
  57.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
  58.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
  59.     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
  60.     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
  61.     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
  62.     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
  63.     at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
  64.     at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
  65.     at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
  66.     at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
  67.     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
  68.     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
  69.     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
  70.     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  71.     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
  72.     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
  73.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  74.     at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
  75.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  76.     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
  77.     at org.apache.catalina.core.StandardService.start(StandardService.java:525)
  78.     at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
  79.     at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
  80.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  81.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  82.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  83.     at java.lang.reflect.Method.invoke(Method.java:597)
  84.     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  85.     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  86. 2014-8-11 15:15:49 org.apache.catalina.core.StandardContext start
  87. 严重: Error listenerStart
  88. 2014-8-11 15:15:49 org.apache.catalina.core.StandardContext start
  89. 严重: Context [/box-web] startup failed due to previous errors
  90. 2014-8-11 15:15:49 org.apache.catalina.core.ApplicationContext log
  91. 信息: Closing Spring root WebApplicationContext
  92. 15:15:49,466 INFO main org.springframework.web.context.support.XmlWebApplicationContext - Closing Root WebApplicationContext: startup date [Mon Aug 11 15:15:12 CST 2014]; root of context hierarchy
  93. 15:15:49,470 WARN main org.springframework.web.context.support.XmlWebApplicationContext - Exception thrown from ApplicationListener handling ContextClosedEvent
  94. java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Mon Aug 11 15:15:12 CST 2014]; root of context hierarchy
  95.     at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)
  96.     at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
  97.     at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049)
  98.     at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
  99.     at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:586)
  100.     at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
  101.     at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4245)
  102.     at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4886)
  103.     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4750)
  104.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  105.     at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
  106.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  107.     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
  108.     at org.apache.catalina.core.StandardService.start(StandardService.java:525)
  109.     at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
  110.     at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
  111.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  112.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  113.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  114.     at java.lang.reflect.Method.invoke(Method.java:597)
  115.     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  116.     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  117. 15:15:49,477 WARN main org.springframework.web.context.support.XmlWebApplicationContext - Exception thrown from LifecycleProcessor on context close
  118. java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Aug 11 15:15:12 CST 2014]; root of context hierarchy
  119.     at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
  120.     at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
  121.     at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
  122.     at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:586)
  123.     at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
  124.     at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4245)
  125.     at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4886)
  126.     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4750)
  127.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  128.     at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
  129.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  130.     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
  131.     at org.apache.catalina.core.StandardService.start(StandardService.java:525)
  132.     at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
  133.     at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
  134.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  135.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  136.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  137.     at java.lang.reflect.Method.invoke(Method.java:597)
  138.     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  139.     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  140. 2014-8-11 15:15:49 org.apache.catalina.core.StandardContext listenerStop
  141. 严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
  142. java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
  143.     at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
  144.     at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1090)
  145.     at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1064)
  146.     at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
  147.     at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:586)
  148.     at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
  149.     at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4245)
  150.     at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4886)
  151.     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4750)
  152.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  153.     at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
  154.     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
  155.     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
  156.     at org.apache.catalina.core.StandardService.start(StandardService.java:525)
  157.     at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
  158.     at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
  159.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  160.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  161.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  162.     at java.lang.reflect.Method.invoke(Method.java:597)
  163.     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  164.     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  165. 2014-8-11 15:15:49 org.apache.catalina.core.ApplicationContext log

阅读(24330) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~