0

可能重复:
security.xml 使用 Spring 的奇怪错误

请我有一个问题,我正在使用带有 jsf 1.2 的 spring-security 3.1,并且我正在尝试使用数据库作为我的用户的来源。

这是 application-context.xml 的一部分

控制台错误:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自 ServletContext 资源 [/WEB-INF/applicationContext.xml] 的 XML 文档中的第 19 行无效;嵌套异常是 org.xml.sax.SAXParseException;行号:19;列号:94;元素“b:bean”的前缀“b”未绑定。

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:security="http://www.springframework.org/schema/security"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:jee="http://www.springframework.org/schema/jee"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:jdbc="http://www.springframework.org/schema/jdbc"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
  
    <b:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <beans:property name="driverClassName" value="org.postgresql.Driver" />
        <beans:property name="url" value="jdbc:postgresql://localhost/protopaie" />
        <beans:property name="username" value="??????" />
        <beans:property name="password" value="??????" />
    </b:bean>

    <security:http auto-config="true">
    
        <security:intercept-url pattern="/loginUtilisateur.jsf"
                            access="IS_AUTHENTICATED_ANONYMOUSLY"/>
        <security:intercept-url pattern="/images/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
        <security:intercept-url pattern="/css/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
        <security:intercept-url pattern="/js/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
    
        <security:intercept-url pattern="/accessDenied.jsp"
                            access="IS_AUTHENTICATED_ANONYMOUSLY"/>
        <security:intercept-url pattern="/**" access="ROLE_FORMATEUR"/>
    
    <security:form-login
        login-processing-url="/j_spring_security_check"
        login-page="/loginUtilisateur.jsf"
        authentication-failure-url="/accessDenied.jsp" 
        default-target-url="/pages/gestionAdministration/accueil/pageAccueil.jsf"/>
    <!--<security:logout logout-success-url="/index.jsf"/>-->
    </security:http>

</beans>
4

0 回答 0