spring4+hibernate4+c3p0配置启动报错问题
< 返回列表时间: 2019-08-06来源:开源中国
HDC调试需求开发(15万预算),能者速来!>>>
配置完成后,程序启动时卡一段时间后,一直报如下问题:

检查过确认不是用户名密码错误,配置文件如下:
<?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:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd"
default-lazy-init="false">
<description>Spring datables config </description>
<!-- 数据源配置,使用应用服务器的数据库连接池 -->
<jee:jndi-lookup id="dataSource" jndi-name="${conn.jdbc.egrant}" />
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- Hibernate配置 -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<!-- <property name="namingStrategy">
<bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
</property> -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop>
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop>
<prop key="net.sf.ehcache.configurationResourceName">${ehcache_config_file}</prop>
<prop key="hibernate.jdbc.batch_size">50</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com.iris.egrant.consts.model</value>
<value>com.iris.egrant.security.model</value>
<value>com.iris.egrant.proposal.pojo.model.setting</value>
<value>com.iris.egrant.tableConfig.model</value>
<value>com.iris.egrant.component.model</value>
</list>
</property>
<property name="mappingResources">
<list>
<value>jbpm.repository.hbm.xml</value>
<value>jbpm.execution.hbm.xml</value>
<value>jbpm.history.hbm.xml</value>
<value>jbpm.task.hbm.xml</value>
<value>jbpm.identity.hbm.xml</value>
</list>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
jndi 连接池
conn.jdbc.egrant=java\:/comp/env/jdbc/sun_egrant
context配置文件
<Resource
name="jdbc/sun_egrant"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
maxPoolSize="3"
minPoolSize="1"
acquireIncrement="1"
maxIdleTime="120"
initialPoolSize="1"
factory="org.apache.naming.factory.BeanFactory"
user="sun_egrant_dev"
password="sun_egrant_dev"
driverClass="oracle.jdbc.driver.OracleDriver"
jdbcUrl="jdbc:oracle:thin:@192.168.15.14:1521:ora11g" />
各位大神看下是否有什么问题?
热门排行