Search code examples
javaquartz-schedulerrmiquartz

Scheduler client initiation failed -> Could not get handle to remote scheduler: Sched1_$_NON_CLUSTERED


I'm using Quartz 2.3.1

RMI NON_CLUSTERED mode.

    properties for the server are set as follow:
    org.quartz.scheduler.instanceName: Sched1
    org.quartz.scheduler.rmi.export: true
    org.quartz.scheduler.rmi.registryHost: localhost
    org.quartz.scheduler.rmi.registryPort: 1099
    org.quartz.scheduler.rmi.createRegistry: true

    org.quartz.scheduler.skipUpdateCheck: true

AND FOR CLIENT

    org.quartz.scheduler.instanceName: Sched1
    org.quartz.scheduler.logger: schedLogger
    org.quartz.scheduler.skipUpdateCheck: true
    org.quartz.scheduler.rmi.proxy: true
    org.quartz.scheduler.rmi.registryHost: localhost
    org.quartz.scheduler.rmi.registryPort: 1099

When I try to run the client I get the following exception:

org.quartz.SchedulerException: Could not get handle to remote scheduler: QrtzScheduler_$_NON_CLUSTERED [See nested exception: java.rmi.NotBoundException: Sched1_$_NON_CLUSTERED]

This is working in windows server using above properties file but it is not work in Linux(ubuntu) and gives above exception.


Solution

  • Follow the below steps :

    Step 1: Add below property in schedular-server.properties : org.quartz.scheduler.rmi.serverPort = 1100

    Step 2: Run below command in ubuntu:
    sudo rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false &

    Step 3: Restart your java code (Schedular).