Q: How can I construct Quartz scheduler? I'm getting the error below when my quartz scheduler tries to execute a Job. 
15:56:01,412 ERROR [org.quartz.core.JobRunShell] (DiscoveryScheduler_Worker-2) Job DEFAULT.6da64b5bd2ee-b3ce1208-e5db-4a1e-be01-e802d419deb7 threw an unhandled Exception: : java.lang.ClassCastException: com.icarotech.portal.to.ScheduleReport cannot be cast to com.icarotech.portal.ejb.bean.client.GenerateSAISSMPBeanRemote at com.icarotech.portal.service.ReportingJob.execute(ReportingJob.java:27) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

15:56:01,414 ERROR [org.quartz.core.ErrorLogger] (DiscoveryScheduler_Worker-2) Job (DEFAULT.6da64b5bd2ee-b3ce1208-e5db-4a1e-be01-e802d419deb7 threw an exception.: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.ClassCastException: com.icarotech.portal.to.ScheduleReport cannot be cast to com.icarotech.portal.ejb.bean.client.GenerateSAISSMPBeanRemote]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.ClassCastException: com.icarotech.portal.to.ScheduleReport cannot be cast to com.icarotech.portal.ejb.bean.client.GenerateSAISSMPBeanRemote
    at com.icarotech.portal.service.ReportingJob.execute(ReportingJob.java:27)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    ... 1 more

Log when I'm scheduling a job:
15:55:39,779 INFO  [stdout] (default task-25) Quartz Scheduler (v2.2.3) 'DiscoveryScheduler' with instanceId 'NON_CLUSTERED'
15:55:39,780 INFO  [stdout] (default task-25)   Scheduler class: 'org.quartz.impl.StdScheduler' - running locally.
15:55:39,780 INFO  [stdout] (default task-25)   Running since: Fri Oct 12 
15:52:51 BRT 2018
15:55:39,780 INFO  [stdout] (default task-25)   Not currently in standby mode.
15:55:39,781 INFO  [stdout] (default task-25)   Number of jobs executed: 1
15:55:39,781 INFO  [stdout] (default task-25)   Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 2 threads.
15:55:39,781 INFO  [stdout] (default task-25)   Using job-store 'org.quartz.impl.jdbcjobstore.JobStoreTX' - which supports persistence. and is not clustered.

====================================================================
My Scheduler class
import org.quartz.CronScheduleBuilder;
import org.quartz.JobBuilder;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.Trigger;
import org.quartz.TriggerBuilder;
import org.quartz.impl.StdSchedulerFactory;
import com.icarotech.portal.ejb.bean.client.GenerateSAISSMPBeanRemote;
import com.icarotech.portal.ejb.bean.client.SchedulingReportBeanRemote;
import com.icarotech.portal.to.ScheduleReport;
import com.icarotech.portal.util.PortalLogger;
import com.icarotech.portal.util.EnumUtil.SchedulingReportStatusEnum;

public class ReportScheduler {

private Scheduler scheduler;

public ReportScheduler() {
try {
Properties prop = new Properties();


prop.put("org.quartz.jobStore.class","org.quartz.impl.jdbcjobstore.JobStoreTX");
            prop.put("org.quartz.scheduler.instanceName", "DiscoveryScheduler");
prop.put("org.quartz.scheduler.instanceId", "AUTO");
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
prop.put("org.quartz.threadPool.threadCount", "2");
prop.put("org.quartz.threadPool.threadPriority", "5");
prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.StdJDBCDelegate");
prop.put("org.quartz.jobStore.dataSource", "sais");
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
prop.put("org.quartz.dataSource.sais.jndiURL", "java:/jdbc/portalds");
SchedulerFactory schedulerFactory = new StdSchedulerFactory(prop);

System.out.println(schedulerFactory.getScheduler().getMetaData());
scheduler = schedulerFactory.getScheduler();
//          scheduler.start();
} catch (SchedulerException e) {
PortalLogger.error("[ReportScheduler] Error on instantiating the scheduler", e);
} catch(Exception err) {
System.out.println(err);
}       
}

public boolean addReport(ScheduleReport report, GenerateSAISSMPBeanRemote generateSAISBean, SchedulingReportBeanRemote schedulingReport) {
try {
JobDataMap jobMap = new JobDataMap();

jobMap.put("generateSAISBean", generateSAISBean);
jobMap.put("schedulingReport", schedulingReport);
jobMap.put("generateSAISBean", report);

JobDetail job = JobBuilder.newJob(ReportingJob.class)
                    .withIdentity(report.getQtzJobName())
                    .usingJobData(jobMap)
                    .build();

Trigger trigger = null;

if (report.getScheduleType().equals(SchedulingReportStatusEnum.RECURRENT)) {

Calendar calendar = Calendar.getInstance();
calendar.setTime(report.getDateAgenda());               
trigger = TriggerBuilder.newTrigger()                                
.withSchedule(CronScheduleBuilder.dailyAtHourAndMinute(
calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE)))
                                .build();

} else if 
(report.getScheduleType().equals(SchedulingReportStatusEnum.SCHEDULED)) {
trigger = TriggerBuilder.newTrigger()
            .startAt(report.getDateAgenda()).build();
}

scheduler.scheduleJob(job, trigger);        
} catch (SchedulerException e) {
PortalLogger.error("[ReportScheduler] Error trying to create a new scheduling.", e);
}
return false;
}

public boolean removeReport (String qtzJobName) {
try {
    JobKey jobKey = new JobKey(qtzJobName);
    scheduler.deleteJob(jobKey);

    PortalLogger.debug("[ReportScheduler] Scheduling deleted. ID_REPORT = " + qtzJobName);
    return true;
} catch (SchedulerException e) {
            PortalLogger.error("[ReportScheduler] Error trying to delete the scheduling.", e);
        }

        return false;
    }
    public String getJobString(ScheduleReport report) {
        return JobBuilder.newJob(ReportingJob.class)
                    .usingJobData(ReportingJob.ID_REPORT, 
                            report.getDateAgenda().getTime())
                    .build().getKey().getName();
    }


}

=========================================
Here's my class that implements Job
package com.icarotech.portal.service;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.quartz.SchedulerContext;
import org.quartz.SchedulerException;

import com.icarotech.portal.ejb.bean.client.GenerateSAISSMPBeanRemote;
import com.icarotech.portal.ejb.bean.client.SchedulingReportBeanRemote;
import com.icarotech.portal.to.ScheduleReport;
import com.icarotech.portal.util.EnumUtil.ReportStatusEnum;
import com.icarotech.portal.util.EnumUtil.SchedulingReportStatusEnum;
import com.icarotech.portal.util.PortalLogger;

public class ReportingJob implements Job{

public static final String ID_REPORT = "ID_REPORT";

@Override
public void execute(JobExecutionContext jobExecution) throws 
JobExecutionException {

SchedulerContext schedulerContext;
try {


schedulerContext = jobExecution.getScheduler().getContext();
GenerateSAISSMPBeanRemote generateSAISBean = (GenerateSAISSMPBeanRemote) jobExecution.getJobDetail().getJobDataMap().get("generateSAISBean");
ScheduleReport report  = (ScheduleReport) jobExecution.getJobDetail().getJobDataMap().get("report");
if (report.getScheduleType().equals(SchedulingReportStatusEnum.SCHEDULED)) {
                SchedulingReportBeanRemote schedulingReport = (SchedulingReportBeanRemote) jobExecution.getJobDetail().getJobDataMap().get("schedulingReport");
                report.setStatus(ReportStatusEnum.EXECUTED);
                schedulingReport.updateReport(report);
            }

            generateSAISBean.generateSaisSMP(report.getCreateBy());
        } catch (SchedulerException e) {
            PortalLogger.error("[ReportingJob] Error trying to get the 
context.", e);
        }
    }

}

================================
I'm using JDBC Store
Please, help me!! 
If anyone think thats a good option, we can call with skype or google hangouts, but unfortunately I can't provide my all code.

A: I find that one line of code was missing on my scheduler class, right after the line of "Trigger trigger = null;"
scheduler.scheduleJob(job, trigger);
So, i put this at my code and no it's all working,
Hope this question help someone.
