tomcat6.0配制数据源+spring

做项目时,将数据源从application.xml中移到了tomcat下,交由tomcat来管理,spring中使用jndi来查找数据源。
在tomcat/conf/context.xml中配制如下

<Resource name="dcomDS"
auth="Container"
type="javax.sql.DataSource"
maxActive="4"
maxIdle="30"
maxWeight="5000"
username="dcom_033"
password="dcom_033"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@172.18.188.21:1521:dcom" />


spring中通过jndi查找如下

<bean id="jndiDcomDs" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/dcomDS</value>
</property>
</bean>
<bean id="dataSource" class="com.skywares.saf.db.MultiDataSource">
<property name="dataSource" ref="jndiDcomDs"/>
</bean>


结果启动tomcat时报错,错误日志如下

信息: Illegal access: this web application instance has been stopped already. Could not load org.quartz.core.JobRunShell$VetoedException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.quartz.impl.StdJobRunShellFactory.borrowJobRunShell(StdJobRunShellFactory.java:86)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:385)


但在tomcat5.5下这样配制就没有任何问题,后来查找发现,tomcat6.0下,配制数据源后,需要在tomcat/lib 目录下提该数据库对应的驱动包
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值