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 目录下提该数据库对应的驱动包

你可能感兴趣的:(tomcat6)