Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is triggerJob disabled in Quartz's JMX?

I have successfully configured our app to export Quartz's MBeans into JMX and can view everything in JConsole. I can run the majority of the scheduler operations.

The one I really want to run is 'triggerJob', but that is showing up in JConsole as greyed-out/disabled so I can't run it.

I've scanned the commits that added the JMX code to Quartz but can't see any differences between triggerJob and the other operations that are enabled.

Anyone have a clue what's going on?

EDIT - explanation found

A different StackOverflow issue describes what's going on: Why are some methods on the JConsole disabled

triggerJob (and two other operations) take non-primitive parameters, these complex parameters cannot be provided in JConsole.

I am not clear if the MBean provider might provide a custom editor for JConsole (or simlar), but at least I have my answer.

like image 934
Ivan Jensen Avatar asked Feb 03 '12 19:02

Ivan Jensen


1 Answers

Thank you for your explanation. I have successfully triggered a job remotely through JMX using the following Groovy code:

def callParams = new Object[3]
callParams[0] = 'com.test.project.TestJob'
callParams[1] = 'DEFAULT_JOB_GROUP'
callParams[2] = new HashMap()

def callSignature = new String[3]
callSignature[0] = 'java.lang.String'
callSignature[1] = 'java.lang.String'
callSignature[2] = 'java.util.Map'

// server is an instance of MBeanServerConnection
server.invoke('triggerJob', callParams, callSignature)
like image 146
Aston Avatar answered Jan 03 '23 22:01

Aston