问题描述
信息: Using DataSource [com.mchange.v2.c3p0.ComboPooledDataSource@e64686[ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, allUsers -> [root], autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 15ad5c6, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null,forceIgnoreUnresolvedTransactions -> false, identityToken -> e64686, idleConnectionTestPeriod -> 900, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/mysql?useUnicode=true&characterEncoding=UTF-8, maxIdleTime -> 600, maxPoolSize -> 50, maxStatements -> 100, maxStatementsPerConnection -> 0, minPoolSize -> 2, numHelperThreads -> 10, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ]] of Hibernate SessionFactory for HibernateTransactionManager2010-11-15 9:29:05 org.springframework.web.context.ContextLoader initWebApplicationContext信息: Root WebApplicationContext: initialization completed in 4119 ms2010-11-15 9:29:06 org.apache.catalina.core.StandardContext start严重: Error listenerStart2010-11-15 9:29:06 org.apache.catalina.core.StandardContext start严重: Context [/ssh] startup failed due to previous errors2010-11-15 9:29:06 org.springframework.context.support.AbstractApplicationContext doClose信息: Closing org.springframework.web.context.support.XmlWebApplicationContext@76e369: display name [Root WebApplicationContext]; startup date [Mon Nov 15 09:29:01 CST 2010]; root of context hierarchy2010-11-15 9:29:06 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@4c4975: defining beans [propertyConfigurer,dataSource,sessionFactory,transactionManager,transactionInterceptor,org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator,LoginAction,genericDao,userDao,userService]; root of factory hierarchy2010-11-15 9:29:06 org.springframework.orm.hibernate3.AbstractSessionFactoryBean destroy信息: Closing Hibernate SessionFactory2010-11-15 9:29:07 org.springframework.web.servlet.FrameworkServlet initServletBean信息: FrameworkServlet 'dispatcher': initialization started2010-11-15 9:29:07 org.springframework.context.support.AbstractApplicationContext prepareRefresh信息: Refreshing org.springframework.web.context.support.XmlWebApplicationContex没集成hibernate3时,struts2+spring2还是好的,不知道是不是包冲突了,但我加的包的版本都是合适的呀struts2:struts-2.0.14spring2:spring-framework-2.0.8hibernate3:hibernate-distribution-3.6.0.Final希望大大们讲解一下,问题是哪里?applicationContext-hibernate.xml如下:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"><beans><bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <!-- <value>WEB-INF/mail.properties</value>--> <value>WEB-INF/jdbc.properties</value> <!-- <value>WEB-INF/oscache.properties</value>--> </list> </property></bean><!-- MailSender used by EmailAdvice --><!-- <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host" value="${mail.host}"/> </bean>--><bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" dependency-check="none"> <property name="driverClass"> <value>${datasource.driverClassName}</value> </property> <property name="jdbcUrl"> <value>${datasource.url}</value> </property> <property name="user"> <value>${datasource.username}</value> </property> <property name="password"> <value>${datasource.password}</value> </property> <property name="acquireIncrement"> <value>${c3p0.acquireIncrement}</value> </property> <property name="initialPoolSize"> <value>${c3p0.initialPoolSize}</value> </property> <property name="minPoolSize"> <value>${c3p0.minPoolSize}</value> </property> <property name="maxPoolSize"> <value>${c3p0.maxPoolSize}</value> </property> <property name="maxIdleTime"> <value>${c3p0.maxIdleTime}</value> </property> <property name="idleConnectionTestPeriod"> <value>${c3p0.idleConnectionTestPeriod}</value> </property> <property name="maxStatements"> <value>${c3p0.maxStatements}</value> </property> <property name="numHelperThreads"> <value>${c3p0.numHelperThreads}</value> </property></bean><bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="mappingResources"> <list> <value>cn/com/aaCompany/app/biz/hibernate/User.hbm.xml</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.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop> <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop> </props> </property></bean><!-- 配置事务管理器bean,使用 HibernateTransactionManager事务管理器 --><bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <!-- 为事务管理器注入sessionFactory" --> <property name="sessionFactory" ref="sessionFactory"/></bean><!-- 配置事务拦截器Bean --><bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <!-- 为事务拦截器bean注入一个事物管理器 --> <property name="transactionManager" ref="transactionManager"></property> <property name="transactionAttributes"> <!-- 定义事务传播属性 --> <props> <prop key="insert*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="add*">PROPAGATION_REQUIRED</prop> <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="delete*">PROPAGATION_REQUIRED</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="change*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> </props> </property></bean><!-- 定义BeanNameAutoProxyCreator --><bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <!-- 指定满足哪些bean自动生成业务代理 --> <property name="beanNames"> <!-- 需要自动创建事务代理的bean --> <list> <value>userService</value> </list> <!-- 其它需要自动创建事务代理的bean --> </property> <property name="interceptorNames"> <list> <value>transactionInterceptor</value> <!-- 可增加其它的interceptor --> </list> </property></bean></beans> 问题补充:hubeiwangfucai 写道