Exception in thread "baseScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError: GC

 错误如下:

Exception in thread "baseScheduler_QuartzSchedulerThread" java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.util.Arrays.copyOfRange(Arrays.java:3664)
	at java.lang.String.<init>(String.java:201)
	at java.lang.String.substring(String.java:1921)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3322)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3295)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1852)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1975)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2470)
	at com.mysql.jdbc.StatementImpl.executeSimpleNonQuery(StatementImpl.java:1267)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1712)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTriggerToAcquire(StdJDBCDelegate.java:2613)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2800)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport$40.execute(JobStoreSupport.java:2759)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport$40.execute(JobStoreSupport.java:2757)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3787)
	at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2756)
	at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:272)

解决方法:在ecliplse中设置:

-Xms1024M -Xmx2048M -XX:PermSize=256M -XX:MaxNewSize=256M -XX:MaxPermSize=512M

 

已标记关键词 清除标记
错误: 信息: Reloading Context with name [/sjzlgl] is completed 2016-11-25 15:18:54,194 DEBUG [org.quartz.utils.ExceptionHelper] - Detected JDK support for nested exceptions. 2016-11-25 15:18:54,204 ERROR [org.quartz.core.ErrorLogger] - An error occured instantiating job to be executed. job= 'DEFAULT.jobDetailBean' org.quartz.SchedulerException: Job instantiation failed [See nested exception: java.lang.NullPointerException] at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:61) at org.quartz.core.JobRunShell.initialize(JobRunShell.java:132) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:386) Caused by: java.lang.NullPointerException at org.springframework.scheduling.quartz.AdaptableJobFactory.createJobInstance(AdaptableJobFactory.java:79) at org.springframework.scheduling.quartz.AdaptableJobFactory.newJob(AdaptableJobFactory.java:57) ... 2 more 2016-11-25 15:18:54,204 INFO [org.quartz.simpl.RAMJobStore] - All triggers of Job DEFAULT.jobDetailBean set to ERROR state. 2016-11-25 15:19:00,005 DEBUG [org.quartz.core.JobRunShell] - Calling execute on job DEFAULT.StartJob 配置文件 <?xml version="1.0" encoding="UTF-8"?> -<beans xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd" xmlns:task="http://www.springframework.org/schema/task" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns="http://www.springframework.org/schema/beans"> <bean class="com.ym.backadmin.testQuartz.GetNowDate" id="getNowDate"/> -<bean class="org.springframework.scheduling.quartz.JobDetailBean" id="jobDetailBean"> -<property name="jobDataAsMap"> -<map> <entry value-ref="getNowDate" key="jobData"/> </map> </property> </bean> -<bean class="org.springframework.scheduling.quartz.SimpleTriggerBean" id="simpleTriggerBean"> <property name="jobDetail" ref="jobDetailBean"/> <property name="startDelay" value="2000"/> <property name="repeatInterval" value="1000"/> </bean> -<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" id=""> -<property name="triggers"> -<list> <ref bean="simpleTriggerBean"/> </list> </property> </bean> </beans> Job类和demo类 job: package com.ym.backadmin.testQuartz; import java.text.SimpleDateFormat; import java.util.Date; public class GetNowDate { public String getDate(){ return new SimpleDateFormat("yyyy-MM-DD HH:mm:ss").format(new Date()); } } demo: package com.ym.backadmin.testQuartz; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.scheduling.quartz.QuartzJobBean; public class QuartzDemo extends QuartzJobBean{ private GetNowDate getNowDate; public GetNowDate getGetNowDate() { return getNowDate; } public void setGetNowDate(GetNowDate getNowDate) { this.getNowDate = getNowDate; } @Override protected void executeInternal(JobExecutionContext context) throws JobExecutionException { System.out.println(getNowDate.getDate()+":已经进行了QuartzDemo测试"); } }
©️2020 CSDN 皮肤主题: 博客之星2020 设计师:CY__0809 返回首页