spring hibernate junit测试,javaw死掉

悬赏:5 发布时间:2008-07-06 提问人:joryee (初级程序员)

AbstractTransactionalJUnit4SpringContextTests测试类测试一个DAO,启动时到
1687 [main] DEBUG org.hibernate.validator.ClassValidator  - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
1687 [main] DEBUG org.hibernate.validator.ClassValidator  - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
1687 [main] DEBUG org.hibernate.validator.ClassValidator  - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
1687 [main] DEBUG org.hibernate.validator.ClassValidator  - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
1703 [main] INFO  org.hibernate.connection.ConnectionProviderFactory  - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
就跳出对话框说javaw发生错误
不知道什么问题
配置文件:
<bean id="dataSource"
		class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName"
			value="com.mysql.jdbc.Driver">
		</property>
		<property name="url"
			value="jdbc:mysql://localhost:3306/only_you">
		</property>
		<property name="username" value="root"></property>
		<property name="password" value="njiokm"></property>
	</bean>
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
		<property name="dataSource">
			<ref bean="dataSource" />
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.MySQLDialect
				</prop>
			</props>
		</property>
		<property name="annotatedClasses">
			<list>
				<value>com.bigwords.entities.City</value>
				<value>com.bigwords.entities.CollegeArea</value>
				<value>com.bigwords.entities.Restaurant</value>
				<value>com.bigwords.entities.RestaurantLabel</value>
				<value>com.bigwords.entities.College</value>
				<value>com.bigwords.entities.Comment</value>
				<value>com.bigwords.entities.FoodStyle</value>
				<value>com.bigwords.entities.MemeberIntegral</value>
				<value>com.bigwords.entities.MemberRating</value>
				<value>com.bigwords.entities.Member</value>
				<value>com.bigwords.entities.CommentResult</value>
				<value>com.bigwords.entities.RestaurantStyle</value></list>
		</property></bean>

问题补充:
换了datasource还是不行啊,这回死在了:
DEBUG org.springframework.jdbc.datasource.DriverManagerDataSource-Creating new JDBC Connection to [jdbc:mysql://localhost:3306/only_you]
该问题已经关闭: 超过15天由系统自动关闭,悬赏平分给所有参与回答的会员

回答


org.apache.commons.dbcp.BasicDataSource

改成
org.springframework.jdbc.datasource.DriverManagerDataSource
lggege (架构师) 2008-07-07