1 java.lang.IllegalStateException: Failed to load ApplicationContext 2 at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157) 3 at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) 4 at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) 5 at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321) 6 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211) 7 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288) 8 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) 9 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:290) 10 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) 11 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) 12 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) 13 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) 14 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) 15 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) 16 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) 17 at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) 18 at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) 19 at org.junit.runners.ParentRunner.run(ParentRunner.java:236) 20 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) 21 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) 22 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) 23 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) 24 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) 25 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) 26 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) 27 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startQuertz' defined in URL [file:/E:/myeclipseStar/operation/target/classes/spring/quartz-ApplicationContext.xml]: Invocation of init method failed; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.startQuertz': java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException [See nested exception: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException]] 28 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) 29 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 30 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 31 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) 32 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) 33 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) 34 at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) 35 at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:587) 36 at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925) 37 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472) 38 at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103) 39 at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1) 40 at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228) 41 at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124) 42 at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148) 43 ... 24 more 44 Caused by: org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.startQuertz': java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException [See nested exception: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException]] 45 at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:612) 46 at org.quartz.impl.jdbcjobstore.JobStoreCMT.initialize(JobStoreCMT.java:142) 47 at org.springframework.scheduling.quartz.LocalDataSourceJobStore.initialize(LocalDataSourceJobStore.java:151) 48 at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1274) 49 at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1465) 50 at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:598) 51 at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:479) 52 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) 53 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) 54 ... 38 more 55 Caused by: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.startQuertz': java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException [See nested exception: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException] 56 at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:165) 57 at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3758) 58 at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3730) 59 at org.quartz.impl.jdbcjobstore.JobStoreSupport.cleanVolatileTriggerAndJobs(JobStoreSupport.java:752) 60 at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:610) 61 ... 46 more 62 Caused by: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.InterruptedException 63 at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) 64 at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65) 65 at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62) 66 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:531) 67 at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) 68 at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:129) 69 at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:109) 70 at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:162) 71 ... 50 more 72 Caused by: java.lang.InterruptedException 73 at java.lang.Object.wait(Native Method) 74 at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1315) 75 at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) 76 at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) 77 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) 78 ... 54 more
测试报错了 求解 咋回事
xml文件
<?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:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-autowire="byName"> <bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="dataSource"> <ref bean="taskDataSource" /> </property> <property name="autoStartup"> <value>true</value> </property> <property name="startupDelay" > <value>10</value> </property> <property name="applicationContextSchedulerContextKey"> <value>applicationContext</value> </property> <property name="waitForJobsToCompleteOnShutdown"> <value>true</value> </property> <property name="quartzProperties"> <props> <prop key="org.quartz.threadPool.threadCount">8</prop> <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop> <prop key="org.quartz.plugin.jobChainListenerLoader.class">com.cubead.thunder.core.JobChainListenerLoaderPlugin</prop> </props> </property> </bean> </beans>
是不是之前好好的 项目重启或者修改配置之后reload之后报这个错误吗?
是的 求解 那里错了啊 我该咋弄啊老大
@skateweb: 上次的进程还在处理中,没有完毕,然后你重启或者reload。就会出现这个问题,具体的我也不清楚
@吉吉的城: 。。。。好吧