發(fā)布項目提示ShiroFilterFactoryBean找不到,但是包是導入了的
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.shiro.spring.web.ShiroFilterFactoryBean] for bean with name 'shiroFilter' defined in class path resource [spring/spring.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.shiro.spring.web.ShiroFilterFactoryBean
<?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:mvc="http://www.springframework.org/schema/mvc" ???????xmlns:context="http://www.springframework.org/schema/context" ???????xsi:schemaLocation="http://www.springframework.org/schema/beans?http://www.springframework.org/schema/beans/spring-beans.xsd?http://www.springframework.org/schema/context?http://www.springframework.org/schema/context/spring-context.xsd"> ????<context:component-scan?base-package="com.imooc"/> ????<bean?id="shiroFilter"?class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> ????????<property?name="securityManager"?ref="securityManager"/> ????????<property?name="loginUrl"?value="login.html"/> ????????<property?name="unauthorizedUrl"?value="403.html"/> ????????<property?name="filterChainDefinitions"> ????????????<value> ????????????????/login.html?=?anon ????????????????/subLogin?=?anon ????????????????/*=authc ????????????</value> ????????</property> ????</bean> ????<!--創(chuàng)建securityManager?--> ????<bean?class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"?id="securityManager"?> ????????<property?name="realm"?ref="real"?/> ????</bean> ????<bean?class="com.imooc.shiro_realm.CustomRealm"?id="real"> ????</bean> ????<bean?class="org.apache.shiro.authc.credential.HashedCredentialsMatcher"?id="hashedCredentialsMatcher"> ????????<property?name="hashAlgorithmName"?value="md5"/> ????????<property?name="hashIterations"?value="1"/> ????</bean> ????<!--?配置數(shù)據(jù)源?--> ????<bean?name="dataSource"?class="com.alibaba.druid.pool.DruidDataSource"?init-method="init"?destroy-method="close"> ????????<property?name="url"?value="${jdbc.jdbcUrl}"?/> ????????<property?name="username"?value="${jdbc.user}"?/> ????????<property?name="password"?value="${jdbc.password}"?/> ????????<property?name="initialSize"?value="1"?/> ????????<property?name="maxActive"?value="20"?/> ????????<property?name="minIdle"?value="1"?/> ????????<property?name="maxWait"?value="60000"?/> ????????<property?name="validationQuery"?value="true"?/> ????????<property?name="testOnBorrow"?value="false"?/> ????????<property?name="testOnReturn"?value="false"?/> ????????<property?name="testWhileIdle"?value="true"?/> ????????<property?name="timeBetweenEvictionRunsMillis"?value="60000"?/> ????????<property?name="minEvictableIdleTimeMillis"?value="25200000"?/> ????????<property?name="removeAbandoned"?value="true"?/> ????????<property?name="removeAbandonedTimeout"?value="1800"?/> ????????<property?name="logAbandoned"?value="true"?/> ????????<property?name="filters"?value="stat,wall"/> ????????<!--?<property?name="connectionProperties"?value="config.decrypt=true;config.decrypt.key=${publickey}"?/>?--> ????</bean> ????<!--<bean?class="org.springframework.jdbc.core.JdbcTemplate"?id="jdbcTemplate"> ????????<property?name="dataSource"?ref="dataSource"?/> ????</bean>--> ????<!--?myBatis文件?--> ????<bean?id="sqlSessionFactory"?class="org.mybatis.spring.SqlSessionFactoryBean"> ????????<property?name="dataSource"?ref="dataSource"?/> ????????<property?name="configLocation"?value="classpath:mybatis/MyBatis-Configuration.xml"?/> ????????<property?name="mapperLocations"?value="classpath:com/imooc/dao/mapper/**/*Mapper.xml"?/> ????????<!--?<list> ????????????<value>classpath*:com/mssm/dao/admin/mapper/*Mapper.xml</value> ????????????<value>classpath*:com/mssm/dao/menu/mapper/*Mapper.xml</value> ????????</list> ????</property>?--> ????</bean> ????<bean?class="org.mybatis.spring.mapper.MapperScannerConfigurer"> ????????<property?name="basePackage"?value="com.imooc.dao"?/> ????????<property?name="sqlSessionFactoryBeanName"?value="sqlSessionFactory"?/> ????</bean> ????<bean?class="org.mybatis.spring.mapper.MapperScannerConfigurer"> ????????<property?name="markerInterface"?value="tk.mybatis.mapper.common.Mapper"/> ????</bean> ????<!--?配置事務管理器?--> ????<bean?id="transactionManager"?class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> ????????<property?name="dataSource"?ref="dataSource"?/> ????</bean> </beans>
2018-06-06
你的spring配置文件出現(xiàn)問題?? filter名字要和web.xml中名字一樣才行
2018-05-31
web.xml有注入嗎