File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Problems with Quartz PlugIn for Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Problems with Quartz PlugIn for Struts" Watch "Problems with Quartz PlugIn for Struts" New topic
Author

Problems with Quartz PlugIn for Struts

Paola Orsini
Greenhorn

Joined: Sep 21, 2007
Posts: 2
Hi, I have this problem each time I run the application when the JobDetail is called I got an Exception and my struts application can not load.
Also the ApplicationJob class is never call.
I have Struts 1.3, quartz-1.6.0.jar, jgs-struts-0.3-dev.jar, jgs-quartz-0.2.1-dev.jar, commons-collections-3.2.jar


//struts-config.xml
<plug-in className="com.banvalor.demon.ApplicationAuto"/>

//ApplicationAuto.java
package com.banvalor.demon;

import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;


public class ApplicationAuto implements PlugIn
{

public void init(ActionServlet servlet, ModuleConfig config) throws ServletException
{
try {
System.out.println("Initializing NewsLetter PlugIn");
ApplicationSchedule objPlugin = new ApplicationSchedule();
} catch (Exception ex) {
ex.printStackTrace();
}
}

public void destroy() {
}
}

//ApplicationSchedule.java
package com.banvalor.demon;

import java.util.Date;

import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;
import org.quartz.impl.StdSchedulerFactory;

public class ApplicationSchedule
{

public ApplicationSchedule()throws Exception
{
SchedulerFactory sf=new StdSchedulerFactory();
Scheduler sched=sf.getScheduler();
sched.start();
JobDetail jd= new JobDetail("myjob",sched.DEFAULT_GROUP,ApplicationJob.class);
//jd.getJobDataMap().put("Socket", smt);
SimpleTrigger st=new SimpleTrigger("mytrigger",sched.DEFAULT_GROUP,new Date(),null,SimpleTrigger.REPEAT_INDEFINITELY,60L*1000L);
sched.scheduleJob(jd, st);
}
}



javax.servlet.UnavailableException: org.apache.commons.collections.SetUtils.orderedSet(Ljava/util/Set Ljava/util/Set;
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:402)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)



Please help me I can not found why is the error
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Make sure that commons-collections-3.1.jar is in your CLASSPATH (/WEB-INF/lib). Quartz uses this library. It should be in the lib/core folder of your Quartz installation.


[My Blog]
All roads lead to JavaRanch
 
 
subject: Problems with Quartz PlugIn for Struts