3 Replies Latest reply on Jan 5, 2009 5:34 AM by Ralf Heydenreich

    ClassNotFoundException while lookup a Service

    Ralf Heydenreich Newbie

      Hi all,
      I'm using quartz 1.6.3 and JBoss 4.2.2GA (with ejb3). I have deployed an ear file and inside this are some ejbs and servlets. Furthermore, I have a Job scheduled in a quartz service that triggers a method from a servlet. If the job begins to run, it starts the method (which is from a jar file inside the ear). Inside my method I have to lookup an EJB from JNDI. The ejb classes are located in the same ear file. Now, the method is compaining about ClassNotFoundException, because it can't find any class outside the jar which contains the servlet. Perhaps this sounds a little sophisticated, therefore a little example helps. (no code, just pseudocode)

      MyServletClass implements Job{
       execute() {
       OtherBean b = lookup(OtherBean);

      My EAR file contains the following:

      MyServletJar.jar (which contains MyServletClass)
      MyBeans.jar (which contains the ejbs)

      If I start the execute() method "manually" (i.e. per mbean call from webinterface), it is executed correctly.
      It seams, that quartz runs in another classloader and therefore it can't find my other classes from ear. How can I make this work???