Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jakarta ee 调用类org.glassfish.ejb.startup.EjbApplication启动方法时发生异常_Jakarta Ee_Glassfish - Fatal编程技术网

Jakarta ee 调用类org.glassfish.ejb.startup.EjbApplication启动方法时发生异常

Jakarta ee 调用类org.glassfish.ejb.startup.EjbApplication启动方法时发生异常,jakarta-ee,glassfish,Jakarta Ee,Glassfish,我正在尝试在应用程序部署时启动作业调度器。我使用的quartz api包含了所有必需的jar文件,但是我得到了java.lang.NoClassDefFoundError。以下是异常的服务器日志消息: SEVERE: Exception while invoking class org.glassfish.ejb.startup.EjbApplication start method javax.ejb.EJBException: javax.ejb.CreateException: Ini

我正在尝试在应用程序部署时启动作业调度器。我使用的quartz api包含了所有必需的jar文件,但是我得到了
java.lang.NoClassDefFoundError
。以下是异常的服务器日志消息:

SEVERE:   Exception while invoking class org.glassfish.ejb.startup.EjbApplication start method
javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton Cam2JobSchedular
    at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:656)
    at....more

Caused by: java.lang.Exception: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:209)
    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:986)....
下面是我在部署应用程序时尝试运行的简单代码:

@Singleton
@Startup
public class Cam2JobSchedular 
{

    private static final Logger logger=Logger.getLogger(Cam2JobSchedular.class.getName());

    @PostConstruct  
    public void init() {
        //start the trigger
       try
       {
         JobDetail job = JobBuilder.newJob(Cam2UpdateCentralDBJob.class)
                    .withIdentity("UpdateCam2Data").build();
            // specify the running period of the job

            Trigger trigger = TriggerBuilder.newTrigger()
                    .withSchedule(SimpleScheduleBuilder.simpleSchedule()
                    .withIntervalInSeconds(30)
                    .repeatForever()).build();

            //schedule the job

            SchedulerFactory schFactory = new StdSchedulerFactory();
            Scheduler sch = schFactory.getScheduler();
            sch.start();
            sch.scheduleJob(job, trigger);

            logger.info("New Job started, Job ID: "+job.getKey().getGroup());
       }
       catch(Exception ex){}
    }
}
谢谢,我将非常感谢你们的帮助,你们需要下载最新的jar文件并将其放到你们的类路径中