I am using the Scheduler Service that ships with 3.2.1.  I am attempting to
schedule work to be done through a class that implements the Schedulable
interface (as listed in Chapter 10 of the DOCO).

I am getting a NoClassDefFoundException inside my class while trying to
instantiate an object.  However, the class that I am trying to instantiate is in
the very same JAR as the class that implements Schedulable!

17:05:54,285 DEBUG [MailerSchedulable] java.lang.ClassNotFoundException:
Unexpected error during load of: gov.doe.eia.mailer.queue.QueueProperties,
msg=gov/doe/eia/deploy/prop/BasePropertiesLoader
17:10:09,041 ERROR [STDERR] java.lang.NoClassDefFoundError:
gov/doe/eia/mailer/queue/QueueProperties

I used the JMX-Console to look in the repository for the class that causing the
error, not found.  However, if I look for my Schedulable class, it's found, in
the JAR that the other class is in.

Any ideas why this is happening?  Is there a 'better' way to deploy this such
that I don't have this problem?

Thanks.

T


---

scheduler-service.xml

  <mbean code="org.jboss.varia.scheduler.Scheduler" 
         name=":service=MailerScheduler">
    <attribute name="StartAtStartup">true</attribute>
    <attribute
name="SchedulableClass">gov.doe.eia.mailer.scheduler.jboss.MailerSchedulable</att
ribute>
<!--
    <attribute name="SchedulableArguments">Schedulabe Test,12345</attribute>
    <attribute name="SchedulableArgumentTypes">java.lang.String,int</attribute>
-->
    <attribute name="InitialStartDate">NOW</attribute>
    <attribute name="SchedulePeriod">60000</attribute>
    <attribute name="InitialRepetitions">10</attribute>
  </mbean>



[ -- code snippet begin -- ]

public class MailerSchedulable implements Schedulable
{

    private static final Logger log = Logger.getLogger(MailerSchedulable.class);

    /**
     * @see org.jboss.varia.scheduler.Schedulable#perform(java.util.Date, long)
     */
    public void perform(Date now, long remainingRepetitions)
    {
        log.info("attempting to start mail queue processing at " + now);
        try
        {
                        ClassLoader loader =
Thread.currentThread().getContextClassLoader();
                        QueueProperties prop =
QueueProperties.getInstance(loader);  // NoClassDefFoundError here
                ....
        }
        catch ( Exception ex )
        {
        }
    }
}

[ -- code snippet end -- ]



-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to