-
1. Re: Deployment of a Schedulable class
saurabh_r_s May 29, 2006 3:07 PM (in response to nvanevski)I am getting the exact same error for my Schedulable Class as well. The same class with the same settings in the scheduler XML file works on 4.0.1, but not on 4.0.4
Try to deploy the same file in 4.0.1SP1 and see what happens. -
2. Re: Deployment of a Schedulable class
nvanevski May 30, 2006 1:01 PM (in response to nvanevski)Ok, this is the procedure that I'm using : Creating a class Test1 like this :
package schtest; import java.util.Date; import org.jboss.varia.scheduler.Schedulable; public class Test1 implements Schedulable { private String m_Name; public Test1(String TheName) { m_Name = TheName; } public void perform(java.util.Date aDate, long aReps) { System.out.println("Scheduler tick for "+m_Name); } }
The META-INF/jboss-service.xml is :<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.varia.scheduler.Scheduler" name="wmSched:service=Scheduler"> <attribute name="StartAtStartup">true</attribute> <attribute name="SchedulableClass">schtest.Test1</attribute> <attribute name="SchedulableArguments">TheName</attribute> <attribute name="SchedulableArgumentTypes">String</attribute> <attribute name="InitialStartDate">NOW</attribute> <attribute name="SchedulePeriod">10000</attribute> <attribute name="InitialRepetitions">-1</attribute> </mbean> </server>
The WEB-INF/jboss-web.xml file :<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd"> <jboss-web> <class-loading java2ClassLoadingCompliance="true" /> <context-root>wmSched</context-root> </jboss-web>
The WEB-INF/web.xml file :<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>wmSched</display-name> </web-app>
I package all this in a file wmSched.war using Borland JBuilder 2005. When I deploy the .sar file, I get a loooong exception stack trace and following message :18:48:38,500 ERROR [URLDeploymentScanner] Incomplete Deployment listing: --- MBeans waiting for other MBeans --- ObjectName: wmSched:service=Scheduler State: FAILED Reason: org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute: name=SchedulableClass value=schtest.Test1 on mbean wmSched:service=Scheduler; - nested throwable: (java.security.InvalidParameterException: Given class schtest.Test1 is not found) --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- ObjectName: wmSched:service=Scheduler State: FAILED Reason: org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute: name=SchedulableClass value=schtest.Test1 on mbean wmSched:service=Scheduler; - nested throwable: (java.security.InvalidParameterException: Given class schtest.Test1 is not found)
JBoss is 4.0.3SP1. What am I doing wrong? Please help!!! -
3. Re: Deployment of a Schedulable class
nvanevski May 31, 2006 8:26 AM (in response to nvanevski)Hmmm.. Feels like talking to myself :) :) :)
I solved the problem by packaging everything in one .sar package, including all the classes I need. There is now another problem : JNDI-bound datasource can not be seen from within the sar - when I try to perform a lookup for java:comp/env/jdbc/MyDatasrc it fails with env not bound exception. I have everything set up in web.xml and jboss-web.xml, and the lookup works fine outside the sar.
Is there any workaround for this? -
5. Re: Deployment of a Schedulable class
nvanevski Jun 1, 2006 6:55 AM (in response to nvanevski)Cool!! Now everything works just fine.
Dimitris, if you are in Athens, next time I'm there - you get a beer! :)