ssh 使用@autowired注入的对象为什么会是空的?
<?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"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
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
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd"
>
<!-- 全局配置,跟平台和部署无关 -->
<!-- 使用 annotation 自动注册bean,并检查@Controller, @Service, @Repository注解已被注入 -->
<!-- 指定搜索模块的目录 -->
<context:component-scan base-package="com.common,com.biz,com.sysManage,com.sysInterface" />
<!-- hibernate属性配置 -->
<context:annotation-config />
<context:property-placeholder location="classpath:hibernate/hibernate.properties" ignore-unresolvable="true"/>
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="${hibernate.connection.driver_class}"></property>
<property name="url" value="${hibernate.connection.url}"></property>
<property name="username" value="${hibernate.connection.username}"></property>
<property name="password" value="${hibernate.connection.password}"></property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><!-- .annotation.AnnotationSessionFactoryBean -->
<property name="dataSource" ref="dataSource" />
<!-- <property name="packagesToScan" value="com.**.domain"/> -->
<property name="mappingDirectoryLocations">
<list>
<value>classpath:com/sysManage/domain/</value>
<value>classpath:com/common/domain/</value>
<value>classpath:com/biz/gis/domain/</value>
<value>classpath:com/biz/petition/domain/</value>
<value>classpath:com/sysInterface/domain/</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<!-- <prop key="hibernate.generate_statistics">true</prop> -->
<prop key="hibernate.connection.release_mode">${hibernate.connection.release_mode}</prop>
<prop key="hibernate.autoReconnect">${hibernate.autoReconnect}</prop>
<!-- <prop key="hibernate.hbm2ddl.auto">update</prop> -->
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache/ehcache.xml</prop>
<prop key="hibernate.c3p0.max_size">20</prop>
</props>
</property>
</bean>
</beans>