3 Replies Latest reply on Aug 15, 2011 8:32 AM by Derya Altuntas

    Help with Quartz MBean Service under JBoss using JNDI?

    tech skn Newbie

      I am calling scheduler from a Java Console application. JBoss is running on localhost.
      I am trying to use Quartz Scheduler that has been deployed as a Service under JBoss using the supplied MBean service.xml. In the JBoss logs, I can clearly see that Quartz service is created and an instance of scheduler was also created.
      Log: QuartzService(Quartz) created.


      As Quartz is the default JNDI name, I am using below code and my scheduler is always null. Any help is really appreciated.


      Code:

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      InitialContext ctx = new InitialContext(env);
      Scheduler sched = (Scheduler) ctx.lookup("Quartz");

      at this point my sched is always null. i am unable to figure out whats wrong. The way i am using JNDI?? please advise...