org.apache.jasper.JasperException: Could not create Hibernate transaction; nested exception is net.sf.hibernate.JDBCException: Cannot open connection。
这个项目是别人做的,我拿来跑都跑不起,数据库什么的都已经附加好了 用的是sqlserver tcpic 协议也启动的 还是报这个错误
下面放下配置文件 求看看有错没
这是链接数据库的配置文件
# Applied by PropertyPlaceholderConfigurer from "applicationContext-hibernate.xml".
jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://127.0.0.1:1433; databaseName=BT
jdbc.username=sa
jdbc.password=sa
datasource.initialSize=5
datasource.logAbandoned=true
datasource.maxIdle=10
datasource.maxActive=100
datasource.maxWait=1000
datasource.removeAbandoned=true
datasource.minIdle=5
datasource.removeAbandonedTimeout=100
applicationContext-dao.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="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/classes/jdbc.properties</value>
</list>
</property>
</bean>
<!-- Define DataSource application tomcat用这个-->
<!-- -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"><value>${jdbc.driverClassName}</value></property>
<property name="url"><value>${jdbc.url}</value></property>
<property name="username"><value>${jdbc.username}</value></property>
<property name="password"><value>${jdbc.password}</value></property>
<property name="initialSize"><value>${datasource.initialSize}</value></property>
<property name="logAbandoned"><value>${datasource.logAbandoned}</value></property>
<property name="maxIdle"><value>${datasource.maxIdle}</value></property>
<property name="maxActive"><value>${datasource.maxActive}</value></property>
<property name="maxWait"><value>${datasource.maxWait}</value></property>
<property name="removeAbandoned"><value>${datasource.removeAbandoned}</value></property>
<property name="minIdle"><value>${datasource.minIdle}</value></property>
<property name="removeAbandonedTimeout"><value>${datasource.removeAbandonedTimeout}</value></property>
</bean>
<!-- tomcat datasource -->
<!--
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/mysql</value>
</property>
</bean>
-->
<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>/WEB-INF/classes/ibatis-config.xml</value>
</property>
<property name="dataSource"><ref local="dataSource"/></property>
</bean>
<!-- Define a hibernate session factory via a spring localSessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<!-- <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</prop> -->
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.max_fetch_depth">3</prop>
<prop key="hibernate.jdbc.fetch_size">30</prop>
<prop key="hibernate.jdbc.batch_size">500</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</prop>
</props>
</property>
</bean>
<!-- Defines a transtraction manager for usage in business or in data access object -->