Hi,
I have a requirement where I have to manage remote quartz jobs so I have evaluated myschedule and was not able to find such functionality. Let me explain my requirement in detail: I have 2-3 quartz jobs which are running out side myschedule and now I want to view, suspend, delete these jobs (i.e. manage these jobs) from myschedule UI. is it possible at all ? if yes, can you give me some pointer/direction how it can be done?
Thanks in advance.
Amit Kumar
Comment #1
Posted on Jul 12, 2012 by Massive DogHello Amit,
You can try making your remote Quartz to enable RMI listener feature of the Quartz, then in MySchedule you may create a scheduler confit that also enable RMI as client. With this, your remote scheduler will shows up in MySchedule that you may monitor and control, but the job executions will actually be on your remote quartz still.
You may read more on Quartz RMI feature on their documentation.
Zemian
Comment #2
Posted on Jul 12, 2012 by Massive Dog(No comment was entered for this change.)
Comment #3
Posted on Aug 15, 2012 by Helpful PandaHi Zemian,
I'm having an issue using this RMI feature that you mention. I've created a simple RMIServer on my local tomcat instance (with a scheduler), and configured an rmi scheduler on myschedule (also on my local tomcat).
I'd like to be able to add a job that is in the same classpath as the rmiserver but I keep getting a class not found exception in myschedule when I try add it.
Any tips?
Thanks, Brett
Comment #4
Posted on Aug 15, 2012 by Massive DogHI Brett,
The easiet to config is make both RMI client and server process to load same set or jar/classes. Have you verified you loaded them in both? How did you add your jars into myschedule app?
Comment #5
Posted on Aug 16, 2012 by Helpful PandaHi Zemian,
I have managed to get it working by dropping the jar into the lib folder of the myschedule app.
I was hoping to be able to have the myschedule app running as it's own webapp, and pointing to some classes existing in my own webapp, to manage them that way.
I should be able to get it running by creating a jar of the jobs I want and making them available to the myschedule app (i.e. by putting it in the lib folder of the myschedule app or by putting it in the common lib folder).
Next question: is there functionality to have security/access control around the app?
Thanks again, Brett
Thanks, Brett
Comment #6
Posted on Aug 16, 2012 by Massive DogYou may use any standard way of securing a Java Servlet web application in your app server. Again, an easier way might be to edit the WEB-INF/web.xml to use the security-constraint and related elements. Take a look at a very simple web app set here: https://bitbucket.org/saltnlight5/sandbox/src/4e80e4b4114e/webapp-login
Comment #7
Posted on Aug 21, 2012 by Helpful PandaGreat, thanks will check that out.
Comment #8
Posted on Aug 21, 2012 by Massive Dog(No comment was entered for this change.)
Comment #9
Posted on Sep 5, 2012 by Swift RabbitI'm also trying without success to get RMI client/server to work. Can anyone shed some light on this subject?
I have a webapp with a quartz 2.01 instance which I tried to configure as an RMI server, then I deployed myschedule 2.4.4 (quartz 2.1.6 -- not sure if the versions need to match) as a separate webapp under the same glassfish domain and tried to configure it as an RMI client so I could manage my original quartz instance. When I create the RMI client from the myschedule UI I get this error:
myschedule.service.ErrorCodeException: SCHEDULER_PROBLEM: Failed to initialize Quartz scheduler using configProps. at myschedule.service.SchedulerService.initScheduler(SchedulerService.java:119) at myschedule.service.SchedulerService.initService(SchedulerService.java:104) at myschedule.service.AbstractService.init(AbstractService.java:26) at myschedule.service.SchedulerContainer.modifyScheduler(SchedulerContainer.java:90)
Due to Caused by: org.quartz.SchedulerException: Could not get handle to remote scheduler: Not bound: "RmiQuartzScheduler_$_NON_CLUSTERED" (only bound name is "jmxrmi") [See nested exception: java.rmi.NotBoundException: Not bound: "RmiQuartzScheduler_$_NON_CLUSTERED" (only bound name is "jmxrmi")] at org.quartz.impl.RemoteScheduler.getRemoteScheduler(RemoteScheduler.java:118) at org.quartz.impl.RemoteScheduler.getSchedulerName(RemoteScheduler.java:141) at org.quartz.impl.SchedulerRepository.bind(SchedulerRepository.java:79) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:694) at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1484) at myschedule.quartz.extra.SchedulerTemplate.(SchedulerTemplate.java:74) at myschedule.service.SchedulerService.initScheduler(SchedulerService.java:113) ... 34 more Caused by: java.rmi.NotBoundException: Not bound: "RmiQuartzScheduler_$_NON_CLUSTERED" (only bound name is "jmxrmi") at sun.management.jmxremote.SingleEntryRegistry.lookup(SingleEntryRegistry.java:56) at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source) at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:386) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:250) "only bound name is "jmxrmi"".
I have also tried adjusting the provided config properties to set the above scheduler name/instance ID to my original without success.
I don't know if I can use the approach of creating a jar with my jobs. Our quartz usage involves making an API call that then it calls a class (which I am not the author of) which implements org.quartz.StatefulJob.
Can anyone shed any light on this? Thanks!
CJ
Comment #10
Posted on Sep 5, 2012 by Massive DogCJ, Your error seems to be clear, client can't find the name that suppose to be provided by the server. Check your server side config with name and port usage.
If you like further help, you need to share both quartz.properties (or its content) for your RMI server and your client.
Comment #11
Posted on Sep 6, 2012 by Swift RabbitThank you for the speedy response! I agree the error seems clear and to me it indicates I'm not binding the name into the RMI registry and it is using the default, but I can't figure out how to fix that.
Some additional info: I have now learned we have a clustered config with auto generated instanceIds (these look like hostname). Can myschedule work in such an environment?
If the answer to the last question is "yes", then please check my config below.
Server
com.sun.management.jmxremote.ssl=false com.sun.management.jmxremote.authenticate=false com.sun.management.jmxremote.port=1099 com.sun.management.jmxremote org.quartz.scheduler.instanceName=RmiQuartzScheduler org.quartz.scheduler.rmi.export=true org.quartz.scheduler.rmi.serverPort=8692 org.quartz.scheduler.rmi.createRegistry=true org.quartz.scheduler.rmi.registryHost=localhost org.quartz.scheduler.rmi.registryPort=1099
I have tried using this objectName, but still get the message that the only bound name is jmxrmi. It seems
this objectName is not what gets bound into the rmi registry? Furthermore, upon realizing I have a clustered
I have also tried specifying a generated instanceID on the client side. I know this is not a good long-term
plan since they are auto-generated but I wanted to see if I could get something working that way.
org.quartz.scheduler.jmx.objectName=quartz:type=QuartzScheduler,name=RmiQuartzScheduler_,instanceId=NON_CLUSTERED
client - should be the RMI client that shipped with myschedule 2.4.4
org.quartz.scheduler.skipUpdateCheck = true org.quartz.scheduler.instanceName = RmiQuartzScheduler_ org.quartz.scheduler.instanceId = NON_CLUSTERED org.quartz.scheduler.jobFactory.class = org.quartz.simpl.SimpleJobFactory org.quartz.scheduler.rmi.proxy = true org.quartz.scheduler.rmi.registryHost = localhost org.quartz.scheduler.rmi.registryPort = 1099
MySchedule scheduler service parameters (These are not used by quartz itself, but for the webapp only.)
myschedule.schedulerService.autoInit = true myschedule.schedulerService.autoStart = true myschedule.schedulerService.preventAutoStartRemoteScheduler = true myschedule.schedulerService.waitForJobsToComplete = false
Thanks again, CJ
Comment #12
Posted on Sep 7, 2012 by Massive DogCJ, yes, Quartz requires the name and Id must match. You can explicitly set your server id instead of auto generated (eg: use your host name etc). Then you can match your client.
Comment #13
Posted on Sep 7, 2012 by Swift RabbitOkay, I'll have to figure out how that works given our other constraints. Thanks for the response.
CJ
Comment #14
Posted on Jan 3, 2014 by Helpful CamelHi Brett/Zemian,
I am trying to provide the remote access of my jars to myschedule. What all methods are available for this? Brett mentions -
I was hoping to be able to have the myschedule app running as it's own webapp, and pointing to some classes existing in my own webapp, to manage them that way.
I should be able to get it running by creating a jar of the jobs I want and making them available to the myschedule app (i.e. by putting it in the lib folder of the myschedule app or by putting it in the common lib folder).
I wanted to ask if there's any other way to do this rather than copy pasting libraries with each and every small change in both places.
Would really appreciate your time and help.
Thanks
K5J9
Comment #15
Posted on Oct 23, 2014 by Grumpy RhinoI have this same Problem:
Caused by: java.rmi.NotBoundException: Not bound: "RmiQuartzScheduler_$_NON_CLUSTERED" (only bound name is "jmxrmi")
Quartz requires the name and Id must match. You can explicitly set your server id instead of auto generated
Whitch exacly Property is wrong in CJ case? Can you give me example, how to fix this? What is "server id"?
Thanks Marcin
Status: Answered
Labels:
Type-Question
Priority-Medium