incomplete exception report and insufficient infomation, can't help youbut it seems the bean "clickNumbeDao" and "clicknumberService" weren't loaded successfully, please check the applicationContext.xml
调试欢乐多
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>org.gjt.mm.mysql.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/struts?useUnicode=true&characterEncoding=GBK</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>8888</value>
</property>
</bean>
<bean id="dataSource1"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:microsoft:sqlserver://localhost:1433;databaseName=test_2</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value>terryyie1980</value>
</property>
</bean>
<bean id="JdbcTemplate" class="dbcommon.JDBCTemplate">
<property name="datasource"><ref local="dataSource"/></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<list>
<value>beans/user/user.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
<prop key="c3p0.min_size">5</prop>
<prop key="c3p0.max_size">30</prop>
<prop key="c3p0.time_out">1800</prop>
<prop key="c3p0.max_statement">50</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
<bean id="userDao" class="dbcommon.Dao">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
<bean id="userDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="target"><ref local="userDao"/></property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean></beans>
对了我建了一个Spring讨论群,欢迎大家一起来讨论吧! 群号:10556809
看看这里的配置,参考一下。