I made a little progress with my problem, but I still don't have an optimal solution.
I now have my Schedulable class included in my app's ear file, rather than having it in a special jarfile that was located in jboss/server/default/lib (I was following the example in scheduler-service.xml)
although I have the dependency line in the Scheduler MBean:
jboss.j2ee:service=EJB,jndiName=ejb/MyBean
I get the following error when starting up JBoss:
INFO [org.jboss.system.ServiceConfigurator] Problem configuring service jboss:service=Scheduler
org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@91f005 on mbean jboss:service=Scheduler; - nested throwable: (java.security.InvalidParameterException: Given class schedtest.MySchedulable is not valid or not found)
I'm not sure why JBoss is trying to configure the scheduler service this early when it depends on a bean in my application.
anyway, once my app deploys, I can 'touch ./deploy/scheduler-service.xml', causing JBoss to redeploy the scheduler service. This allows scheduler to start up normally and eliminates the ClassCastException, but I don't think I should have to do this.
As I mentioned previously, the scheduler service is destroyed and recreated when my app is redeployed, but unless I 'touch' the scheduler deployment descriptor, I get the ClassCastException.
This method does not work if I put my Schedulable class in a jar in the lib/ directory rather than in my app's jarfile in deploy/
Any ideas on eliminating having to 'touch' scheduler-service.xml after app deployment are appreciated...
thanks again
Justin
I'm still trying to figure this out. Can anyone tell me where my Schedulable class should be kept? in a jarfile in server/lib, in my application's earfile, or somewhere else?
thanks
justin