1 Reply Latest reply on Jan 14, 2008 9:46 AM by tprime

    MBean configuration - ClassLoader issue

    tprime

      I having problem using configuring Quartz MBean. Specifically having problem with JBoss Class Loading.

      Enviorment:
      OS: Linux (Ubuntu 7.10)
      Jboss: 4.0.4 GA
      Java: 1.5

      I have very simple ear with following content:

      myapp.ear
      |--------- META-INF
      | |------------- application.xml (reference modules some.jar and other.jar)
      | |------------- jboss-app.xml (reference to service archive myquartz.sar)
      |
      |--------- some.jar
      | |------------- my.test.SomeJob1 (Does not use any external class)
      | |------------- my.test.SomeJob2 (references/uses my.test.OtherBean)
      |
      |--------- other.jar
      | |------------- my.test.OtherBean
      |
      |--------- myquartz.sar
      |--------- META-INF
      |------------- jboss-service.xml (initialize Quartz MBean)
      


      If i use only my.test.SomeJob1 which does not reference any external class then everything works great.
      (Quartz Scheduler is properly started and jobs get trigger properly too)

      But if i use my.test.SomeJob2 which uses an external class in Other.jar(in the same ear)
      It throws following ClassLoader complain it can not find my.test.OtherBean.

      [main] - 01/14/2008 09:09:55 [QuartzService] ERROR: org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't recover jobs: No ClassLoaders found for: com.illuminatics.accounting.organization.Organization [See nested exception: java.lang.ClassNotFoundException: No ClassLoaders found for: my.test.OtherBean]]
      at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.j ava:512)
      at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:396)
      at org.quartz.impl.StdScheduler.start(StdScheduler.java:147)
      at org.quartz.ee.jmx.jboss.QuartzService.startService(QuartzService.java:239)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.jav a:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport .java:245)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15 5)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:9 78)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      .
      .
      .
      * Nested Exception (Underlying Cause) ---------------
      org.quartz.JobPersistenceException: Couldn't recover jobs: No ClassLoaders found for: com.illuminatics.accounting.organization.Organization [See nested exception: java.lang.ClassNotFoundException: No ClassLoaders found for: com.illuminatics.accounting.organization.Organization]
      at org.quartz.impl.jdbcjobstore.JobStoreSupport.recoverJobs(JobStoreSupport.java:7 17)
      at org.quartz.impl.jdbcjobstore.JobStoreCMT.recoverJobs(JobStoreCMT.java:186)
      at org.quartz.impl.jdbcjobstore.JobStoreSupport.schedulerStarted(JobStoreSupport.j ava:510)
      at org.quartz.core.QuartzScheduler.start(QuartzScheduler.java:396)
      at org.quartz.impl.StdScheduler.start(StdScheduler.java:147)
      at org.quartz.ee.jmx.jboss.QuartzService.startService(QuartzService.java:239)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.jav a:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport .java:245)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:15 5)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:9 78)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      


      Why can Jboss find the the my.test.OtherBean? Does any one have any suggestion to resolve this issue?

      i have been searching for the solution for good time now.

      pike


        • 1. Re: MBean configuration - ClassLoader issue
          tprime

          My configuration xml are like below:

          application.xml

          <application>
          <display-name>My Cool Ear</display-name>
          <module><java>some.jar</java></module>
          <module><java>other.jar</java></module>
          </application>
          

          jboss-aap.xml
          <jboss-app>
          <module><service>quartz.sar</service></module>
          </jboss-app>
          

          jboss-service.xml
          <server>
          <classpath codebase="." archives="*"/>
          
          <mbean code="org.quartz.ee.jmx.jboss.QuartzService"
          name="user:service=QuartzService,name=QuartzService">
          
          <depends>jboss.jca:name=@db.datasource.jndi@,service=LocalTxCM</depend s>
          
          <depends>jboss.jca:name=@db.datasource.jndi@,service=DataSourceBindin g</depends>
          
          <attribute name="JndiName">@quartz.scheduler.jndi@</attribute>
          <attribute name="Properties">
          standard stuff here, detail omitted
          </attribute>
          </mbean>
          </server>
          

          I have being looking around for the solution and reading the docs and DTDs. I have tried adding following to both jboss-app.xml and jboss-service.xml. It Does not seem to work in any configuration.
          <loader-repository>
          my.test:loader=myapp.ear
          </loader-repository>
          

          Also i tried to set the parameter java2ParentDelegation. Nothing seem to working at the moment.

          pike