Quartz+Spring+Hibernate集群环境下 ClusterManager: Error managing cluster: null

[2013-12-19 14:43:44] [ERROR] QuartzScheduler_quartzScheduler-NON_CLUSTERED_ClusterManager) - ClusterManager: Error managing cluster: null
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy28.rollback(Unknown Source)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:3588)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3199)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3798)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3834)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71)
... 5 more
Caused by: java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:3450)
at com.jolbox.bonecp.ConnectionHandle.rollback(ConnectionHandle.java:958)
... 10 more

##========================#
quartz.properties配置如下:
##==========================

#Configure Main Scheduler Properties

##==========================
org.quartz.scheduler.instanceName = quartzScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.scheduler.rmi.export = false
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false

##=========================

#Configure ThreadPool

##=========================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true

##========================

#Configure JobStore

##========================
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.maxMisfiresToHandleAtATime=10
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 15000

#============================#
applicationContext-quartz-server.xml配置:
#============================#

     <bean id="quartzDataSource" 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="maxActive" value="5"></property>
    <property name="maxIdle" value="20"></property>
    <property name="maxWait" value="50"></property>
    <property name="defaultAutoCommit" value="true"></property>
</bean>



<bean name="quartzScheduler"
    class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="dataSource" ref="quartzDataSource" />
    <property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
    <property name="configLocation" value="classpath:config/quartz.properties" />
    <property name="triggers">
        <list>
            <ref bean="Trigger1" />
            <ref bean="Trigger2" />
            <ref bean="Trigger3" />
            <ref bean="Trigger4"/>
        </list>
    </property>
</bean>

四台机器集群,不压力测试没问题,压力测试就出现以上错误,求大神帮忙解决啊!
quartz-all-1.6.6.jar

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Quartz+Spring+Hibernate集群环境下 ClusterManager: Error managing cluster: null

[2013-12-19 14:43:44] [ERROR] [QuartzScheduler_quartzScheduler-NON_CLUSTERED_ClusterManager] (org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3804)) - ClusterManager: Error managing cluster: null java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy28.rollback(Unknown Source) at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:3588) at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3199) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3798) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3834) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71) ... 5 more Caused by: java.sql.SQLException: Closed Connection at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445) at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:3450) at com.jolbox.bonecp.ConnectionHandle.rollback(ConnectionHandle.java:958) ... 10 more ##========================# quartz.properties配置如下: ##========================== # #Configure Main Scheduler Properties ##========================== org.quartz.scheduler.instanceName = quartzScheduler org.quartz.scheduler.instanceId = AUTO org.quartz.scheduler.rmi.export = false org.quartz.scheduler.rmi.proxy = false org.quartz.scheduler.wrapJobExecutionInUserTransaction = false ##========================= # #Configure ThreadPool ##========================= org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount = 10 org.quartz.threadPool.threadPriority = 5 org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true ##======================== # #Configure JobStore ##======================== org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.tablePrefix = QRTZ_ org.quartz.jobStore.maxMisfiresToHandleAtATime=10 org.quartz.jobStore.isClustered = true org.quartz.jobStore.clusterCheckinInterval = 15000 #============================# applicationContext-quartz-server.xml配置: #============================# <bean id="quartzDataSource" 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="maxActive" value="5"></property> <property name="maxIdle" value="20"></property> <property name="maxWait" value="50"></property> <property name="defaultAutoCommit" value="true"></property> </bean> <bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="dataSource" ref="quartzDataSource" /> <property name="applicationContextSchedulerContextKey" value="applicationContextKey" /> <property name="configLocation" value="classpath:config/quartz.properties" /> <property name="triggers"> <list> <ref bean="Trigger1" /> <ref bean="Trigger2" /> <ref bean="Trigger3" /> <ref bean="Trigger4"/> </list> </property> </bean> 四台机器集群,不压力测试没问题,压力测试就出现以上错误,求大神帮忙解决啊! quartz-all-1.6.6.jar

quartz 集群环境下,停掉一个点,该点下的定时任务不被其他点承接,定时任务不再执行

集群环境下 springboot + quartz,停掉一个点,该点下的定时任务不被其他点承接,定时任务不再执行 两个job类20秒执行一次 0/20 * * * * ? 启动两个,能看到控制台的两个项目分别打印两个定时任务的日志,停掉其中一个项目,日志不变,停掉项目中的任务没有被运行的项目执行,运行的项目还执行原任务 配置文件 ``` #quartz集群配置 # =========================================================================== # Configure Main Scheduler Properties 调度器属性 # =========================================================================== #调度标识名 集群中每一个实例都必须使用相同的名称 org.quartz.scheduler.instanceName=DefaultQuartzScheduler #ID设置为自动获取 每一个必须不同 org.quartz.scheduler.instanceid=AUTO #============================================================================ # Configure ThreadPool #============================================================================ #线程池的实现类(一般使用SimpleThreadPool即可满足几乎所有用户的需求) org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool #指定线程数,至少为1(无默认值)(一般设置为1-100直接的整数合适) org.quartz.threadPool.threadCount=10 #设置线程的优先级(最大为java.lang.Thread.MAX_PRIORITY 10,最小为Thread.MIN_PRIORITY 1,默认为5) org.quartz.threadPool.threadPriority=5 #============================================================================ # Configure JobStore #============================================================================ # 信息保存时间 默认值60秒 org.quartz.jobStore.misfireThreshold=60000 #数据保存方式为数据库持久化 org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX #数据库代理类,一般org.quartz.impl.jdbcjobstore.StdJDBCDelegate可以满足大部分数据库 org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate #JobDataMaps是否都为String类型 org.quartz.jobStore.useProperties=false #数据库别名 随便取 org.quartz.jobStore.dataSource=myDS #表的前缀,默认QRTZ_ org.quartz.jobStore.tablePrefix=QRTZ_ #是否加入集群 org.quartz.jobStore.isClustered=true #调度实例失效的检查时间间隔 org.quartz.jobStore.clusterCheckinInterval=15000 ``` ``` @Configuration public class QuartzConfiguration { @Autowired DataSource dataSource; /** * 继承org.springframework.scheduling.quartz.SpringBeanJobFactory 实现任务实例化方式 */ public static class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware { private transient AutowireCapableBeanFactory beanFactory; @Override public void setApplicationContext(final ApplicationContext context) { beanFactory = context.getAutowireCapableBeanFactory(); } /** * 将job实例交给spring ioc托管 我们在job实例实现类内可以直接使用spring注入的调用被spring ioc管理的实例 * * @param bundle * @return * @throws Exception */ @Override protected Object createJobInstance(final TriggerFiredBundle bundle) throws Exception { final Object job = super.createJobInstance(bundle); /** * 将job实例交付给spring ioc */ beanFactory.autowireBean(job); return job; } } /** * 配置任务工厂实例 * * @param applicationContext spring上下文实例 * @return */ @Bean public JobFactory jobFactory(ApplicationContext applicationContext) { /** * 采用自定义任务工厂 整合spring实例来完成构建任务 see {@link AutowiringSpringBeanJobFactory} */ AutowiringSpringBeanJobFactory jobFactory = new AutowiringSpringBeanJobFactory(); jobFactory.setApplicationContext(applicationContext); return jobFactory; } /** * 配置任务调度器 使用项目数据源作为quartz数据源 * * @param jobFactory 自定义配置任务工厂 * @return * @throws Exception */ @Bean(destroyMethod = "destroy", autowire = Autowire.NO) public SchedulerFactoryBean schedulerFactoryBean(JobFactory jobFactory) throws Exception { SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean(); // 将spring管理job自定义工厂交由调度器维护 schedulerFactoryBean.setJobFactory(jobFactory); // 设置覆盖已存在的任务 schedulerFactoryBean.setOverwriteExistingJobs(true); // 项目启动完成后,等待10秒后开始执行调度器初始化 schedulerFactoryBean.setStartupDelay(10); // 设置调度器自动运行 schedulerFactoryBean.setAutoStartup(true); // 设置数据源,使用与项目统一数据源 schedulerFactoryBean.setDataSource(dataSource); // 设置上下文spring bean name schedulerFactoryBean.setApplicationContextSchedulerContextKey("applicationContext"); // 设置配置文件位置 schedulerFactoryBean.setConfigLocation(new ClassPathResource("/application-quartz.properties")); return schedulerFactoryBean; } } ```

quartz集群使用spring数据源报错

quartz集群使用spring数据源报错。如果在quartz.properties文件中配置数据源可以顺利启动服务且定时器运行正常。 这是quartz.xml中的配置,其中<ref bean="myDataSource"/>指向spring中配置的数据源。 ``` <bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <!-- 这里就设置使用Spring的数据源 --> <property name="dataSource"> <ref bean="myDataSource"/> </property> <property name="triggers"> <list> <ref bean="doTimehour" /> <!-- <ref bean="doTimeDay" /> <ref bean="doTimeWeek" /> <ref bean="doTimeMonth" /> <ref bean="doTimeXun" /> --> </list> </property> <property name="applicationContextSchedulerContextKey" value="applicationContext" /> <property name="configLocation" value="classpath:quartz.properties" /> </bean> ``` 虽然可以不用spring的数据源改为在quartz中单独配置数据源使用,但是这个问题困扰我好几天不解决心里总是感觉不舒服,希望高手能指点一下。 以下是错误信息: 2016-5-27 17:35:08 org.apache.catalina.core.StandardContext listenerStart 严重: 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 'startQuertz' defined in ServletContext resource [/WEB-INF/springContext/quartz.xml]: Invocation of init method failed; nested exception is org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-01002: 提取违反顺序 [See nested exception: java.sql.SQLException: ORA-01002: 提取违反顺序 ] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:394) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: ORA-01002: 提取违反顺序 [See nested exception: java.sql.SQLException: ORA-01002: 提取违反顺序 ] at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:109) at org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:112) at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:235) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3712) at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1095) at org.quartz.core.QuartzScheduler.addJob(QuartzScheduler.java:905) at org.quartz.impl.StdScheduler.addJob(StdScheduler.java:266) at org.springframework.scheduling.quartz.SchedulerFactoryBean.addJobToScheduler(SchedulerFactoryBean.java:830) at org.springframework.scheduling.quartz.SchedulerFactoryBean.addTriggerToScheduler(SchedulerFactoryBean.java:853) at org.springframework.scheduling.quartz.SchedulerFactoryBean.registerJobsAndTriggers(SchedulerFactoryBean.java:789) at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:612) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257) ... 22 more Caused by: java.sql.SQLException: ORA-01002: 提取违反顺序 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451) at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:943) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2126) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2331) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:422) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:366) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93) at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:89) ... 34 more

使用spring和quartz,如果一部分任务需要集群配置,另一部分任务不用集群配置,应该如何配置?

quartz的配置文件,是否集群的地方isClustered应该配置true还是false?还是做成两个文件?

Spring hibernate quartz动态配置时间查询数据库表信息

研究好几天quartz了,只看懂了静态配置,想换成持久化,然后页面能查询进行管理,没有没有大神帮帮忙给个demo

quartz deadlocked死锁 的问题

org.quartz.JobPersistenceException: Failure updating scheduler state when checking-in: Transaction (Process ID 63) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. at org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterCheckIn(JobStoreSupport.java:3422) ~[quartz-2.2.3.jar:na] at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3269) ~[quartz-2.2.3.jar:na] at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3874) [quartz-2.2.3.jar:na] at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3911) [quartz-2.2.3.jar:na]

weblogic 整合quartz 报错

Nov 06, 2019 4:05:24 AM com.sgcc.uap.kernel.helper.ModuleSRModelHelper setServiceInTargetSource 信息: 引入服务,发布该服务的模块是 Dynamic-Module : [hqmisUtils], ServiceRef : {com.suypower.hqmis.util.springEx.JdbcTemplateEx}={platform_service_idname=JdbcTemplateService, dynamic_module_name=hqmisUtils, platform_service_target=com.suypower.hqmis.util.springEx.JdbcTemplateEx, uap_service_ranking=0, dynamic_module_service=spring_service, service.id=274} [2019-11-06 04:05:26,331] Third's :ERROR org.springframework.scheduling.quartz.LocalDataSourceJobStore:3876 - ClusterManager: Error managing cluster: Failure identifying failed instances when checking-in: Unknown system variable 'OPTION' org.quartz.JobPersistenceException: Failure identifying failed instances when checking-in: Unknown system variable 'OPTION' [See nested exception: java.sql.SQLException: Unknown system variable 'OPTION'] at org.quartz.impl.jdbcjobstore.JobStoreSupport.findFailedInstances(JobStoreSupport.java:3343) at org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterCheckIn(JobStoreSupport.java:3393) at org.quartz.impl.jdbcjobstore.JobStoreSupport.doCheckin(JobStoreSupport.java:3253) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3870) at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:3907) Caused by: java.sql.SQLException: Unknown system variable 'OPTION' at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619) at com.mysql.jdbc.StatementImpl.executeSimpleNonQuery(StatementImpl.java:1606) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2265) at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:135) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectSchedulerStateRecords(StdJDBCDelegate.java:2949) at org.quartz.impl.jdbcjobstore.JobStoreSupport.findFailedInstances(JobStoreSupport.java:3307) ... 4 more

spring4.0+quartz2.1.6整合

1,请导入spring4相关包,注意spring-context-support4.0.0M2.jar 2,quartz2.1.6jar 包导入 3,spring-quartz jar

批量定时(使用quartz.jar) hibernate3.1.3+Spring1.2.8 程序运行一段时间停止

程序使用Hibernate 3.1.3+Spring 1.2.8,使用dbcp数据库连接,在程序中使用Quartz.jar定时四个任务,每天定时执行,运行几天后所有任务都不执行了,好像死锁了一样,无异常、无错误抛出,重新启动后又可正常执行。求高手指点,日志如下: 2013-09-17 21:00:41,859 org.hibernate.cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 10.2.0.1.0 2013-09-17 21:00:41,890 org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle9Dialect 2013-09-17 21:00:41,890 org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions) 2013-09-17 21:00:41,890 org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - JDBC batch size: 15 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Connection release mode: on_close 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 1 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.classic.ClassicQueryTranslatorFactory 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Query language substitutions: {} 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Second-level cache: enabled 2013-09-17 21:00:41,890 org.hibernate.cfg.SettingsFactory - Query cache: disabled 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Statistics: enabled 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled 2013-09-17 21:00:41,906 org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo 2013-09-17 21:00:41,921 org.hibernate.impl.SessionFactoryImpl - building session factory 2013-09-17 21:00:41,937 net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/workspace/ZCCL_BatchServer/lib/ehcache-1.1.jar!/ehcache-failsafe.xml 2013-09-17 21:00:42,500 org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured 2013-09-17 21:00:42,578 org.springframework.aop.framework.DefaultAopProxyFactory - CGLIB2 available: proxyTargetClass feature enabled 2013-09-17 21:00:42,640 com.dcits.server.StartServer - Roman-----------systemEnv serverPort-----18171 2013-09-17 21:00:42,640 com.dcits.server.ListenServer - =======管理线程就绪======= 2013-09-17 21:00:42,640 com.dcits.server.ListenServer - 线程[1]启动完成 2013-09-17 21:00:42,640 com.dcits.server.ListenServer - 服务器忙,增加新线程 2013-09-17 21:00:42,640 com.dcits.server.ListenServer - 线程[2]启动完成 2013-09-17 21:00:42,640 com.dcits.server.AcceptServer - G0_L1_CR:=======正在监听端口[18171]======= 2013-09-17 21:00:42,640 com.dcits.server.AcceptServer - G0_L2_CR:=======正在监听端口[18171]======= 2013-09-17 21:00:42,671 org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml] 2013-09-17 21:00:42,687 org.springframework.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase] Hibernate: select * from ( select this_.JOB_ID as JOB1_15_0_, this_.JOB_NAME as JOB2_15_0_, this_.JOB_CLASS as JOB3_15_0_, this_.JOB_TYPE as JOB4_15_0_, this_.JOB_TRIGGER_STATE as JOB5_15_0_, this_.JOB_CRON_EXPRESSION as JOB6_15_0_, this_.JOB_METHOD as JOB7_15_0_, this_.JOB_GROUP as JOB8_15_0_, this_.JOB_SPRING_BEAN as JOB9_15_0_, this_.JOB_EXE_LAST_TIME as JOB10_15_0_, this_.JOB_EXE_NEXT_TIME as JOB11_15_0_, this_.JOB_START_TIME as JOB12_15_0_, this_.JOB_END_TIME as JOB13_15_0_, this_.JOB_TRIGGER_TYPE as JOB14_15_0_, this_.JOB_PRI as JOB15_15_0_, this_.JOB_TRIGGER_NAME as JOB16_15_0_, this_.JOB_TRIGGER_GROUP as JOB17_15_0_, this_.JOB_EXE_STATE as JOB18_15_0_ from CHQB_JOB this_ ) where rownum <= ? 2013-09-17 21:00:42,859 com.dcits.job.util.JobUtil - Roman--------------jobList's size------5 2013-09-17 21:00:42,859 com.dcits.job.util.JobUtil - (JobInfo)job's class -----0 0/3 * * * ? 2013-09-17 21:00:42,921 org.quartz.simpl.SimpleThreadPool - Job execution threads will use class loader of thread: main 2013-09-17 21:00:42,953 org.quartz.simpl.RAMJobStore - RAMJobStore initialized. 2013-09-17 21:00:42,953 org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' 2013-09-17 21:00:42,953 org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 1.4.2 2013-09-17 21:00:42,968 com.dcits.job.util.JobUtil - (JobInfo)job's class -----0 01 11 * * ? 2013-09-17 21:00:42,984 com.dcits.job.util.JobUtil - (JobInfo)job's class -----0 00 16 * * ? 2013-09-17 21:00:43,000 com.dcits.job.util.JobUtil - (JobInfo)job's class -----0 0/1 * * * ? 2013-09-17 21:00:43,046 com.dcits.job.util.JobUtil - (JobInfo)job's class -----0 50 16 * * ? 2013-09-17 21:00:43,062 org.quartz.core.QuartzScheduler - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started. 2013-09-17 21:01:00,015 com.dcits.job.base.BaseJob - ----START------TrpLoadBatchJob---------- 2013-09-17 21:01:00,015 com.dcits.job.TrpLoadBatchJob - Tue Sep 17 21:01:00 CST 2013################START RUN TrpLoadBatchJob ##########0

SpringBatch 和 quartz定时,quartz调用多个springbatchjob异常,

异常如下: 2015-05-12 11:49:30.046 [startQuertz_Worker-5] ERROR org.quartz.core.JobRunShell - Job DEFAULT.busBatchJobDetail threw an unhandled Exception: org.springframework.dao.CannotSerializeTransactionException: PreparedStatementCallback; SQL [INSERT into BATCH_JOB_EXECUTION(JOB_EXECUTION_ID, JOB_INSTANCE_ID, START_TIME, END_TIME, STATUS, EXIT_CODE, EXIT_MESSAGE, VERSION, CREATE_TIME, LAST_UPDATED) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; ORA-08177: 无法连续访问此事务处理 ; nested exception is java.sql.SQLException: ORA-08177: 无法连续访问此事务处理 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:267) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:658) ~[spring-jdbc-4.0.0.RELEASE.jar:4.0.0.RELEASE] 以下是.xml配置 <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> <property name="jobRepository" ref="jobRepository"/> </bean> <!--// Spring batch 持久化机制 默认id为jobRepository--> <bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="transactionManager" ref="transactionManager"/> <property name="lobHandler" ref="lobHandler"/> <property name="isolationLevelForCreate" value="ISOLATION_READ_COMMITTED"/> </bean> <!--// mapJobRepository 不将JobExecution和jobExectution存入数据库--> <!--<bean id="jobRepository"--> <!--class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"--> <!--lazy-init="true" autowire-candidate="false"/>--> <!--//stopping, restarting, or summarizing a Job--> <bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator"> <property name="jobLauncher" ref="jobLauncher"/> <property name="jobExplorer" ref="jobExplorer"/> <property name="jobRepository" ref="jobRepository"/> <property name="jobRegistry" ref="jobRegistry"/> </bean> <!--// 读取jobRepository类,只读。--> <bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"> <property name="dataSource" ref="dataSource"/> </bean> <!--//用来记载多个jobs,进行注册 并可以修改相应job的参数--> <bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry"/> <bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler"/> <!--必须配置ExecutionContextPromotionListener才能往jobExecutionContext中写--> <bean id="promotionListener" class="org.springframework.batch.core.listener.ExecutionContextPromotionListener"> <property name="keys" value="size"/> </bean> 同时我还想将JobExecution和jobExectution存到数据库

quartz 集群后存在问题

环境是这样的 :websphere集群。5台机器,每台机器有2-3个节点。 有一个任务 要在每个机器上生成 索引。现在quartz集群后。任务不能保证被所有 机器都会执行 。如果做能让 每个机器上只有一个节点执行呢

SpringMVC+quartz 报错

配置文件: ```<!-- 执行调度任务业务类 --> <bean id="consultJob" class="com.bytc.consult.quartz.ConsultRedisJob"> </bean> <!-- 配置执行类和方法 --> <bean id="consultJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="consultJob"></property> <property name="targetMethod" value="consultTypeCopy"></property> <property name="concurrent" value="false"></property> </bean> <!-- 配置定时执行时间 --> <bean id="consultTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="consultJobDetail"></property> <property name="cronExpression"> <value>0/10 * * * * ?</value> </property> </bean> <!-- 配置调度资源 --> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false" autowire="no"> <property name="autoStartup" value="true"></property> <property name="startupDelay" value="0"/> <property name="triggers"> <list> <ref local="consultTrigger"/> </list> </property> </bean> ``` 报错信息: ```Caused by: org.quartz.JobPersistenceException: The job (DEFAULT.consultJobDetail) referenced by the trigger does not exist. at org.quartz.simpl.RAMJobStore.storeTrigger(RAMJobStore.java:422) at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:932) at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:258) at org.springframework.scheduling.quartz.SchedulerAccessor.addTriggerToScheduler(SchedulerAccessor.java:312) at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:235) at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:512) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ... 57 more ``` 使用 RAMJobStore 模式,不需要持久化到数据,启动时抛出如上异常?求解答!!

spring集成quartz时不执行问题

我用spring集成quartz,用的是cronExpress,当我设置成<property name="cronExpression" value="0 38 * * * ?"></property>,即不设置小时数时,正常执行,当我设置成<property name="cronExpression" value="0 38 8 * * ?"></property>代表每天早上8点38分执行一次,与上面设置不同的就是表达式上加上了小时,但是就不执行了。我的spring应该是2.0版,quartz是1.8.4,我还试过了1.5.2,运行环境是tomcat5.0,关联的jdk是1.5.0。没有异常信息。 请大家帮忙解决一下。 具体配置如下: <bean id="myTest" class="com.harmony.sharedata.service.ScheduleTest"></bean> <!-- 定时器任务设置 --> <bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="myTest"></property> <property name="targetMethod" value="testExcute"></property> </bean> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobDetail"></property> <property name="cronExpression" value="0 38 * * * ?"></property> </bean> <bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="cronTrigger"/> </list> </property> </bean>

求一个quartz的分布式集群的简单例子,不用表的那种

有没有人可以给个基于spring boot的定时器的例子,用于分布式集群的,网上看到的要么是需要一堆表来管理,要么是非集群的,想问问大佬们有没有不需要用到数据库管理的方法。

Spring 整合 Quartz 启动报错

配置文件代码: <?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:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd" default-lazy-init="true"> <!-- Quartz本地Schduler --> <bean id="localQuartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false"> <!-- Triggers集成 --> <property name="triggers"> <list> <ref bean="checkUserTask" /> </list> </property> <!-- Quartz配置 --> <property name="quartzProperties"> <props> <prop key="org.quartz.threadPool.threadCount">3</prop> </props> </property> <!-- 启动时延期3秒开始任务 --> <property name="startupDelay" value="3" /> </bean> <!-- 检测用户是否过期Begin --> <bean id="checkUserTask" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="checkUserJob" /> <property name="cronExpression" value="5 * * * * ?" /> </bean> <bean id="checkUserJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="userTask" /> <property name="targetMethod" value="checkPassedUser" /> </bean> <!-- 检测用户是否过期 End --> </beans> **报错信息:** Error creating bean with name 'localQuartzScheduler' defined in URL [file:/D:/Java/SVN/code/b2c/wzt-oauth-bundle/target/classes/spring/applicationContext-quartz.xml]: Cannot resolve reference to bean 'checkUserTask' while setting bean property 'triggers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'checkUserTask' defined in URL [file:/D:/Java/SVN/code/b2c/wzt-oauth-bundle/target/classes/spring/applicationContext-quartz.xml]: Cannot resolve reference to bean 'checkUserJob' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'checkUserJob' defined in URL [file:/D:/Java/SVN/code/b2c/wzt-oauth-bundle/target/classes/spring/applicationContext-quartz.xml]: Cannot resolve reference to bean 'userTask' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userTask' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:540) at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:510) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:222) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) at RunJetty.main(RunJetty.java:19) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'checkUserTask' defined in URL [file:/D:/Java/SVN/code/b2c/wzt-oauth-bundle/target/classes/spring/applicationContext-quartz.xml]: Cannot resolve reference to bean 'checkUserJob' while setting bean property 'jobDetail'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'checkUserJob' defined in URL [file:/D:/Java/SVN/code/b2c/wzt-oauth-bundle/target/classes/spring/applicationContext-quartz.xml]: Cannot resolve reference to bean 'userTask' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'userTask' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1387) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) ... 27 more

求教:如何通过Spring hibernate quartz动态配置时间查询数据库表信息

quartz将任务时间持久化到数据库中,定时通过hibernate配置文件查询数据库中相应表的数据,因为有很多任务,cron如果写在配置中会很乱。

关于quartz集群的问题,求大神解惑

quartz在集群时要求每个节点的服务器的时间都要一致么?(ps:这里我是只有一个数据库的) 如果是这样,那么为什么不是以数据库的时间为准呢,而要以服务器的时间为基准

quartz在spring javase项目中无法启动

看日志好像是spring 容器关闭了导致的,但是不确定。 Jun 10, 2016 9:36:37 AM org.springframework.scheduling.quartz.SchedulerFactoryBean startScheduler INFO: Starting Quartz Scheduler now Jun 10, 2016 9:36:37 AM org.springframework.context.support.ClassPathXmlApplicationContext doClose INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@4411d970: startup date [Fri Jun 10 09:36:36 CST 2016]; root of context hierarchy Jun 10, 2016 9:36:37 AM org.springframework.context.support.DefaultLifecycleProcessor stop INFO: Stopping beans in phase 2147483647 Jun 10, 2016 9:36:37 AM org.springframework.scheduling.quartz.SchedulerFactoryBean destroy INFO: Shutting down Quartz Scheduler 以下是spring配置: <bean id="sendMailTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean" p:jobDetail-ref="jobDetail" p:cronExpression="* * * * * ?" /> <bean id="scheduler" lazy-init="false" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="sendMailTrigger"/> </list> </property> </bean> <bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" p:targetObject-ref="mailServer" p:targetMethod="sendMail" p:concurrent="false"/>

struts2+spring +ibatis 中使用quartz问题

struts2+spring +ibatis 中使用quartz问题 在spring中配置好了代码如下: <bean id="limitDaysCompanysService" parent="baseTransactionProxyG4"> <property name="target"> <bean class="org.xtone.mt.service.impl.LimitDaysCompanysServiceImpl"> <property name="g4Dao" ref="g4Dao" /> </bean> </property> </bean> <!-- 定义调用对象和调用对象的方法 --> <bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!-- 调用的类 --> <property name="targetObject"> <ref bean="limitDaysCompanysService"/> </property> <!-- 调用类中的方法 --> <property name="targetMethod"> <value>LimitDaysCompanysByClose</value> </property> </bean> <!-- 定义调用对象和调用对象的方法 --> <bean id="jobtask2" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!-- 调用的类 --> <property name="targetObject"> <ref bean="limitDaysCompanysService"/> </property> <!-- 调用类中的方法 --> <property name="targetMethod"> <value>LimitDaysCompanysByState</value> </property> </bean> <!-- 定义触发时间 --> <bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobtask"/> <!-- run at 00:00 everyday --> <property name="cronExpression" value="0 29 13 * * ?"/> </bean> <!-- 定义触发时间 --> <bean id="doTime2" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="jobtask2"/> <!-- run at 00:00 everyday --> <property name="cronExpression" value="0 29 13 * * ?"/> </bean> <!-- 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 --> <bean id="startQuertz" lazy-init="true" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="doTime"/> <ref bean="doTime2"/> </list> </property> </bean> 总管理类中lazy-init设置='false'项目启动,这个可以执行起来。我现在要在页面用按钮来执行控制要启动还是暂停。 struts中如何调用这边的方法才能是我的按钮控制这个?

springboot+quartz集群,启动时打印 NOT STARTED

启动是控制台打印:目前没有发现有什么影响,还请各位大神帮忙解答一下这个是什么意思,怎么解决 Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 20 threads. Using job-store 'org.springframework.scheduling.quartz.LocalDataSourceJobStore' - which supports persistence. and is clustered.

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

Linux命令学习神器!命令看不懂直接给你解释!

大家都知道,Linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务。 一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么就直接用 man 命令去查看守冗长的帮助手册。这两个都可以实现我们的目标,但有没有更简便的方式呢? 答案是必须有的!今天给大家推荐一款有趣而实用学习神器 — kmdr,让你解锁 Linux 学习新姿势...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

史上最全的 python 基础知识汇总篇,没有比这再全面的了,建议收藏

网友们有福了,小编终于把基础篇的内容全部涉略了一遍,这是一篇关于基础知识的汇总的文章,请朋友们收下,不用客气,不过文章篇幅肯能会有点长,耐心阅读吧爬虫(七十)多进程multiproces...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

大学一路走来,学习互联网全靠这几个网站,最终拿下了一把offer

大佬原来都是这样炼成的

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

立即提问
相关内容推荐