I need to call the ejb method from a quartz job, and I am having trouble finding an ejb job. I defined a local interface and a stateless implementation. When deploying to websphere 7, EjbInvokerJob cannot find my component in my jndi tree. This is the definition of my quartz job (this is loaded via the init quartz servlet)
JobDetail jd = JobBuilder// .newJob(EJBInvokerJob.class)// .withIdentity("job", "group")// .usingJobData(EJBInvokerJob.EJB_JNDI_NAME_KEY, "ejb/myBean")// .usingJobData(EJBInvokerJob.EJB_METHOD_KEY, "update")// .build(); String cronExpr = getInitParameter("cronExpr"); Trigger cronTrigger = TriggerBuilder// .newTrigger() // .forJob(jd) // .startNow() // .withSchedule(CronScheduleBuilder.cronSchedule(cronExpr))// .build(); Scheduler sched = StdSchedulerFactory.getDefaultScheduler(); sched.scheduleJob(jd, cronTrigger); sched.start();
And my bean has this annotation on top of it
@Stateless(name = "myBean")
How do I bind EJB_JNDI_NAME_KEY? in websphere or should I do this with this configuration. I think the problem is related to a lack of knowledge about jinjis. Since the servlet that runs the job runs in the same jvm, so the local interface should be enough
jelle source share