TOMCAT下配置连接池后不能正常启动
在TOMCAT下配置连接池后不能正常启动.
连接池配置
JNDI Name: jdbc/rlzy
Data Source URL: jdbc:microsoft:sqlserver://localhost:1433;databaseName=test
JDBC Driver Class:com.microsoft.jdbc.sqlserver.SQLServerDriver
User Name:sa
Password:
Max. Active Connections: 4
Max. Active Connections: 2
Max. Wait for Connection: 5000
Validation Query://不填
重启TOMCAT后运行http://localhost:8080/
出现错误提示:
type Status report
message /
description The requested resource (/) is not available.
在STDERR.LOG文件里的出错信息是:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/classes/application.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
application.xml中的代码是:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>java:comp/env/jdbc/rlzy</value></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<list>
<value>com/hn/rlzy/bean/code/Zzmm.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.jdbc.fetch_size">50</prop>
<prop key="hibernate.jdbc.batch_size">25</prop>
</props>
</property>
</bean>
请问这是什么原因?急急急