小编ste*_*phy的帖子

Quartz JobStore:JobPersistenceException:无法检索触发器:ClassNotFoundException

我希望你们中的一位可爱的人能够帮助我解决这个问题,因为我已经花费了许多毫无结果的时间已经试图让一切顺利进行!

我已经将问题追溯到类加载,并且能够看到当 Quartz 尝试从 jobStore (jobStoreCMT) 反序列化 jobDetail 时,使用的类加载器不包含任何我的应用程序类,并且仅包含在EAR lib 文件夹。

所以...我显然正在使用应用程序服务器,在本例中尝试针对 Glassfish 3.1.1/3.1.2

尝试使用 Spring 3.1.0.RELEASE 对抗 Quartz 1.8.6/2.1.5

弹簧/石英配置:

<bean id="schedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="overwriteExistingJobs" value="true" />

    <property name="triggers">
        <list>
            <ref bean="notificationEmailsSimpleTrigger" />
        </list>
    </property>

    <property name="quartzProperties">
        <props>
            <prop key="org.quartz.scheduler.instanceName">QuartzScheduler</prop>
            <prop key="org.quartz.scheduler.instanceId">AUTO</prop>

            <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop>
            <prop key="org.quartz.threadPool.threadCount">25</prop>
            <prop key="org.quartz.threadPool.threadPriority">5</prop>
            <prop key="org.quartz.jobStore.class">org.quartz.impl.jdbcjobstore.JobStoreCMT</prop>
            <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
            <prop key="org.quartz.jobStore.misfireThreshold">60000</prop>
            <prop key="org.quartz.jobStore.tablePrefix">QRTZ_</prop>
            <!-- <prop key="org.quartz.jobStore.isClustered">true</prop> -->
            <!-- <prop key="org.quartz.jobStore.clusterCheckinInterval">20000</prop> -->

            <prop key="org.quartz.scheduler.classLoadHelper.class">org.quartz.simpl.CascadingClassLoadHelper</prop>
            <prop key="org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer">true</prop>
            <prop key="org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread">true</prop>

            <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
        </props>
    </property>
</bean> …
Run Code Online (Sandbox Code Playgroud)

macos spring quartz-scheduler classnotfoundexception glassfish-3

6
推荐指数
1
解决办法
2万
查看次数