gpt4 book ai didi

java - 如何修复未定义名为 'springSecurityFilterChain' 的 bean

转载 作者:行者123 更新时间:2023-12-02 05:44:01 26 4
gpt4 key购买 nike

我正在使用 spring、hibernate 和 primefaces 开发一个 Web 应用程序。

在此应用程序中,我从数据库获取数据并使用它来显示图表。

当我运行我的应用程序时,出现此错误:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

这是应用程序上下文文件:

<?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.6.SEC01.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.6.SEC01.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.6.SEC01.xsd
">


<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost/biblio?useUnicode=true&amp;characterEncoding=UTF-8&amp;characterSetResults=UTF-8</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value></value>
</property>

</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
<property name="mappingResources">
<list>
<value>Mapping/Status.hbm.xml</value>
<value>Mapping/Authorities.hbm.xml</value>
<value>Mapping/Livre.hbm.xml</value>
<value>Mapping/Users.hbm.xml</value>
<value>Mapping/Auteur.hbm.xml</value>
<value>Mapping/Emprunteur.hbm.xml</value>
<value>Mapping/Collection.hbm.xml</value>
<value>Mapping/Emprunt.hbm.xml</value>
<value>Mapping/Cathegorie.hbm.xml</value>

</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>

<!--Spring Data Access Exception Translator Defintion-->
<bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator" >
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<!--Hibernate Template Defintion-->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate" >
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
<property name="jdbcExceptionTranslator">
<ref bean="jdbcExceptionTranslator"/>
</property>
</bean>
<!--Hibernate Transaction Manager Definition-->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" >
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<!--========================= Start of DAO BEANS DEFINITIONS =========================-->
<bean id="autDao" class="Implementation.dao.AuteurDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>
<bean id="statusDao" class="Implementation.dao.StatusDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>
<bean id="categDao" class="Implementation.dao.CategorieDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>
<bean id="empDao" class="Implementation.dao.EmprunteurDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>

<bean id="colleDao" class="Implementation.dao.CollectionDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>

<bean id="livDao" class="Implementation.dao.LivreDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>
<bean id="emprDao" class="Implementation.dao.EmpruntDaoImpl" >
<property name="hibernateTemplate" ref="hibernateTemplate"/>
</bean>

<!--========================= Start of SERVICE BEANS DEFINITIONS =========================-->
<bean id="auDao" class="Implementation.service.AuteurServiceImpl" >
<property name="auteurDao" ref="autDao"/>
</bean>
<bean id="statDao" class="Implementation.service.StatusServiceImpl" >
<property name="statusDao" ref="statusDao"/>
</bean>
<bean id="catDao" class="Implementation.service.CategorieServiceImpl" >
<property name="categorieDao" ref="categDao"/>
</bean>
<bean id="emprunDao" class="Implementation.service.EmprunteurServiceImpl" >
<property name="emprunteurDao" ref="empDao"/>
</bean>
<bean id="collectionDao" class="Implementation.service.CollectionServiceImpl" >
<property name="collectionDao" ref="colleDao"/>
</bean>
<bean id="livrDao" class="Implementation.service.LivreServiceImpl" >
<property name="livreDao" ref="livDao"/>
</bean>
<bean id="empruDao" class="Implementation.service.EmpruntServiceImpl" >
<property name="empruntDao" ref="emprDao"/>
</bean>
</beans>

如何解决这个问题?

最佳答案

看起来您正在应用程序中使用 Spring Security 过滤器。你能发布你的 web.xml 吗?

关于java - 如何修复未定义名为 'springSecurityFilterChain' 的 bean,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24261586/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com