sorry scott, do u mean the jboss-service.xml?

<?xml version="1.0" encoding="UTF-8"?>
<server>
        <classpath codebase="lib" archives="scheduler-plugin.jar"/>
        <mbean code="org.jboss.varia.scheduler.Scheduler" 
name="scm:service=SCMDueDateScheduler">
                <attribute name="StartAtStartup">true</attribute>
                <attribute 
name="SchedulableClass">com.cargosoft.scmtool.server.services.mbean.DueDateScheduler</attribute>
                <attribute name="SchedulableArguments">4711</attribute>
                <attribute name="SchedulableArgumentTypes">java.lang.String</attribute>
                <attribute name="InitialStartDate">NOW</attribute>
                <attribute name="InitialRepetitions">-1</attribute>
                <attribute name="SchedulePeriod">86400000</attribute>
        </mbean>
</server>

-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Auftrag von Scott M
Stark
Gesendet: Samstag, 22. November 2003 06:39
An: [EMAIL PROTECTED]
Betreff: Re: [JBoss-user] Error Redeploying Ear with Schedulable MBean



How is the schedulable registered with the scheduler?

-- 
xxxxxxxxxxxxxxxxxxxxxxxx
Scott Stark
Chief Technology Officer
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx

Scheil, Sven wrote:

> i repost my question, because i found no solution :-( should i post more detailed 
> information?
> 
> does anyone have experience in deploying schedulable mbeans as trigger for an slsb?
> 
> 
> 
> we are using jboss 3.2.2, win 2k, mySQL 4.0.13.
> 
> I've developed a simple implementation of the Schedulable interface. Packed
> it into a sar together with a jboss-service.xml. This sar is packed into the
> ear (together with a jboss-app.xml) of my application that should be
> triggered by the Scheduler. Deploying the ear with the DueDateScheduler
> mbean works great for the first time. But when I'm redeploying the ear I get
> a java.lang.ClassCastException every time the Scheduler is called:
> 
> 2003-11-17 15:49:20,799 ERROR
> [com.cargosoft.scmtool.server.services.mbean.DueDateScheduler]
> DueDateScheduler::perform(date, param) 4711 abgebrochen:
> java.lang.ClassCastException
>       at
> com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemo
> teObject.java:293)
>       at
> javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
>       at
> com.cargosoft.scmtool.server.services.mbean.DueDateScheduler.getTimeSchedule
> r(DueDateScheduler.java:49)
>       at
> com.cargosoft.scmtool.server.services.mbean.DueDateScheduler.perform(DueDate
> Scheduler.java:37)
>       at
> org.jboss.varia.scheduler.Scheduler$Listener.handleNotification(Scheduler.ja
> va:1263)
>       at
> org.jboss.mx.server.NotificationListenerProxy.handleNotification(Notificatio
> nListenerProxy.java:69)
>       at
> javax.management.NotificationBroadcasterSupport.sendNotification(Notificatio
> nBroadcasterSupport.java:95)
>       at javax.management.timer.Timer.sendNotifications(Timer.java:441)
>       at javax.management.timer.Timer.access$000(Timer.java:31)
>       at
> javax.management.timer.Timer$RegisteredNotification.doRun(Timer.java:612)
>       at
> org.jboss.mx.util.SchedulableRunnable.run(SchedulableRunnable.java:164)
>       at org.jboss.mx.util.ThreadPool$Worker.run(ThreadPool.java:225)
> 
> Even when I restart the Scheduler mbean via jmx-console the errore stays the
> same. Only a restart of the server (with the ear ramining deployed) is a way
> out of this problem. But I can't restart our production server every time I
> update the application!
> 
> 
> What did I wrong? Any hints?
> 
> 
> Thanks in advance...
> 
> 
> Source:
> 
> public class DueDateScheduler implements Schedulable {
>     protected static Logger logger;
> 
>     {
>         logger = Logger.getLogger(DueDateScheduler.class);
>     }
> 
>     private String testArg;
> 
>     public DueDateScheduler(String arg0) {
>         testArg = arg0;
>     }
> 
>     public void perform(java.util.Date date, long param) {
>         try {
>             getTimeScheduler().checkDueDates();
>             logger.info("DueDateScheduler::perform(date, param) " + testArg
> + " ausgef�hrt");
>         }
>         catch (Exception ex) {
>             logger.error("DueDateScheduler::perform(date, param) " + testArg
> + " abgebrochen:", ex);
>         }
>     }
> 
>     private TimeScheduler getTimeScheduler() throws Exception {
>         Context ctx = getJBossInitialContext();
>         Object ref = ctx.lookup("SCMTool/TimeScheduler");
> 
>         TimeSchedulerHome timeSchedulerHome = (TimeSchedulerHome)
>             PortableRemoteObject.narrow(ref, TimeSchedulerHome.class);
>         return timeSchedulerHome.create();
>     }
> 
>     private javax.naming.Context getJBossInitialContext() throws
> NamingException {
>         java.util.Hashtable JNDIParm = new java.util.Hashtable();
>         JNDIParm.put(Context.PROVIDER_URL, "localhost");
>         JNDIParm.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
>         return new InitialContext(JNDIParm);
>     }
> 
> }
> 




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to