簡體   English   中英

在Spring 4中獲取“無法為XML模式命名空間[http://www.springframework.org/schema/security]找到Spring NamespaceHandler”

[英]getting 'Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]' with spring 4

我正在將OSGi項目的spring版本升級到spring4.2.x。

我已經刪除了Spring DM依賴項,並添加了Gemini藍圖依賴項( org.eclipse.gemini.blueprint.coreorg.eclipse.gemini.blueprint.extenderorg.eclipse.gemini.blueprint.io ),這些在處女座中處於活動狀態RT服務器。
我添加了spring-security-config依賴項,它也處於ACTIVE狀態。

但我面臨以下問題

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置問題:無法找到XML模式命名空間的Spring NamespaceHandler [ http://www.springframework.org/schema/security]令人反感的資源:URL [bundleentry:// 157。 fwk1212103909 / META-INF /彈簧/的applicationContext-security.xml文件]

我的applicationContext-security.xml文件是這樣的

<?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:security="http://www.springframework.org/schema/security"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security.xsd">

  <security:global-method-security pre-post-annotations="enabled" run-as-manager-ref="runAsManager"
secured-annotations="enabled">
    <security:expression-handler ref="expressionHandler" />
  </security:global-method-security> 

  ... 

</beans>

我已經將xsd與版本一起使用。 同樣的結果。

你知道是什么原因導致這個問題嗎?

如果您聲明使用的是處女座的版本,那將有所幫助。 您是否知道Virgo 3.7.0包含Spring 4的事實?

我必須在項目中的META-INF / spring.handlers文件中添加以下行。

http\://www.springframework.org/schema/security=org.springframework.security.config.SecurityNamespaceHandler

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM