<?xml version="1.0" encoding="UTF-8"?><beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<!--定义C3PO连接池的数据源  -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">

<!--定义数据库的JDBC驱动 -->
<property name="driverClass">
<value>com.mysql.jdbc.Driver</value>
</property>

<!-- 定义数据库所用的URL -->
<property name="jdbcUrl">
<value>jdbc:mysql://localhost:3306/db_manager</value>
</property>

<!--  定义数据库用户-->
<property name="user">
<value>root</value>
</property>
<!--  定义数据库密码-->
<property name="password">
<value>1234</value>
</property>

<!--  定义数据库连接池最大连接数-->
<property name="maxPoolSize">
<value>30</value>
</property>

<!--  定义数据库连接池最小连接数-->
<property name="minPoolSize">
<value>3</value>
</property>

<!--  定义数据库连接池初始化连接数目-->
<property name="initialPoolSize">
<value>3</value>
</property>

<!--  定义数据库最大闲置时间,以秒为单位-->
<!-- 
<property name="maxldle">
<value>30</value>
</property>
 -->
<!-- 定义最大等待时间 -->
<!-- 
<property name="maxWait">
<value>1800</value>
</property>
 -->
</bean>

    <!-- 定义Hibernate的SessionFactory -->
 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
 
      <!-- 注册Hibernate的ORM映射文件 -->
  <property name="dataSource" ref="dataSource"/>
  <property name="mappingResources">
  <list>
  <value>com/eportal/ORM/category.hbm.xml</value>
  </list>
  </property>
 
  <!-- 设置Hibernate的相关属性 -->
  <property name="hibernateProperties">
 
  <props >
  <prop key="hibernate.dailect">org.hibernate.dialect.MySQLDialect</prop>
  <prop key="show_sql">true</prop>
  <prop key="hibernate.jdbc.batch_size">100</prop>
  </props>
 
  </property>
</bean>

    <!--定义Hibernate的事务管理器HibernateTransactionManager -->
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
     <property name="sessionFactory" ref="sessionFactory"/>
    </bean>

<!--定义Spring的事务拦截器TransactionInterceptor -->
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">

<property name="transactionManager" ref="transactionManager"/>

<!-- 定义事务需要拦截的事务方法以及采用的事务采用的控制类型 -->
<property name="transactionAttributes">

<props>
<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="browse*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>

</property>
</bean>

<!-- 定义BeanNamesAutoProxyCreator进行spring的事务管理 -->
<bean  name="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">

<!-- 针对指定的bean生成业务处理 -->
<property name="beanNames">

<list>
<value>categoryService</value>
</list>

</property>

<!--  这个属性为true时,表示被代理的是目标类本身而不是目标类的接口 -->
<property name="proxyTargetClass">
<value>true</value>
</property>

<!--  依赖注入上面定义的事务拦截器transactionInterceptor -->
<property name="interceptorNames">

<list>
<value>transactionInterceptor</value>
</list>

</property>
</bean>

<bean id="dao" class="com.epotal.DAO.DaoBaseImp">
<property name="sessionFactory" ref="sessionFactory"/>
</bean> <!-- 装配通用数据库访问类BaseDAOImpl --> 
<bean id="categoryService" class="com.epartal.service.CategoryServiceImp" >

<property name="dao" ref="dao"/>

</bean>
</beans>
然后提示下面的错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at testMerchandise.WireBean.getBean(WireBean.java:13)
at testMerchandise.TestORM.testAppContxt(TestORM.java:310)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalStateException: No bean class specified on bean definition
at org.springframework.beans.factory.support.AbstractBeanDefinition.getBeanClass(AbstractBeanDefinition.java:348)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:49)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
... 33 more