This content has been marked as final.
Show 3 replies
-
1. Re: Help with Quartz MBean Service under JBoss using JNDI?
imargelatu Mar 7, 2007 7:54 AM (in response to techskn)I have the exact same problem. In a Jboss instance, the QuartzService is successfully created. Even more, existing Quartz jobs are being executed as expected.
I want to be able to access the Quartz Scheduler from a console application. However the following code prints out 'null' :public static void main(String[] args) throws Exception { InitialContext iniCtx = getInitialContext(); Scheduler scheduler = (Scheduler)iniCtx.lookup("Quartz"); System.out.println(String.format("Scheduler : %s", scheduler)); } public static InitialContext getInitialContext() throws Exception { Hashtable<String, String> props = getInitialContextProperties(); return new InitialContext(props); } private static Hashtable<String, String> getInitialContextProperties() { Hashtable<String, String> props = new Hashtable<String, String>(); props.put(Context.PROVIDER_URL, "jnp://localhost:1099"); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); return props; }
There are no exceptions thrown, however the Scheduler object is null.
Am I doing something wrong ? -
2. Re: Help with Quartz MBean Service under JBoss using JNDI?
imargelatu Mar 7, 2007 8:20 AM (in response to techskn)OK, I found the answer ... the Scheduler class is not Serializable so retrieving it from outside the JBoss server hosting it will return only a null. The Quartz RMI support must be used instead.
Here is the relevant URL (read the Javadoc lines) :
http://fisheye5.cenqua.com/browse/quartz/src/jboss/org/quartz/ee/jmx/jboss/QuartzServiceMBean.java?r=1.6 -
3. Re: Help with Quartz MBean Service under JBoss using JNDI?
deryaaltuntas Aug 15, 2011 8:32 AM (in response to imargelatu)I have exactly same problem.I could not open link you sent