由于包冲突,或者一开始加载一些不用到的包导致的异常,可以在配置文件中加上default-lazy-init="true",让项目用到哪个bean再加载。
<?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: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-3.0.xsd" default-lazy-init="true">
<context:component-scan base-package="com.biz.www"></context:component-scan>