Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
10. Jul 2008, 19:28 America/New_York | Link

Quartz has been giving me a headache. The job runs on Startup, but not again.

Here is my setup:

components.xml Added schema: xmlns:async="http://jboss.com/products/seam/async" Added quartz: <async:quartz-dispatcher />

build.xml Added quartz.jar to be deployed in the ear

Action @Name("myBulkAction") @Scope( ScopeType.APPLICATION ) @Startup public class MyBulkAction { @Logger(value="com.my.log4j.category.") private Log log; @Create public void create(){ startJob1(new Date(), "0,15,30,45 * * * *", getExpiration()); startJob2(new Date(), "10,25,40,55 * * * *", getExpiration()); } @Asynchronous public void startJob1(@Expiration Date when, @IntervalCron String cron, @FinalExpiration Date endDate) { doSomething(); } @Asynchronous public void startJob2(@Expiration Date when, @IntervalCron String cron, @FinalExpiration Date endDate) { doSomethingElse(); } ... private Date getExpiration(){ Calendar cal = Calendar.getInstance (); cal.set (3000, Calendar.JAN, 1); return cal.getTime(); } }

Any suggestions would be much appreciated. Being a unix geek, the Cron format makes perfect sense to me.

Thanks in advance!

- Mike Schwartz

11 Replies:
10. Jul 2008, 19:36 America/New_York | Link

Sorry about the formatting, trying again:

@Name("myBulkAction") 
@Scope( ScopeType.APPLICATION ) 
@Startup 
public class MyBulkAction { 
    @Logger(value="com.my.log4j.category.") 
    private Log log; 

    @Create 
    public void create(){ 
        startJob1(new Date(), "0,15,30,45 * * * *", getExpiration()); 
        startJob2(new Date(), "10,25,40,55 * * * *", getExpiration()); 
    }
 
    @Asynchronous public void startJob1(@Expiration Date when, 
                                        @IntervalCron String cron, 
                                        @FinalExpiration Date endDate) { 
        doSomething(); 
    } 

    @Asynchronous public void startJob2(@Expiration Date when, 
                                        @IntervalCron String cron, 
                                        @FinalExpiration Date endDate) {         
        doSomethingElse(); 
    }
 
    ... 

    private Date getExpiration(){ 
        Calendar cal = Calendar.getInstance (); 
        cal.set (3000, Calendar.JAN, 1); 
        return cal.getTime(); 
    } 
}
10. Jul 2008, 20:29 America/New_York | Link

I added seam.quartz.properties and deployed to the same location as seam.properties. Still no beans.

#============================================================================
# Configure Main Scheduler Properties
#============================================================================

org.quartz.scheduler.instanceName Sched1
org.quartz.scheduler.instanceId AUTO
org.quartz.scheduler.rmi.export false
org.quartz.scheduler.rmi.proxy false

#============================================================================
# Configure ThreadPool
#============================================================================

org.quartz.threadPool.class org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount 3

#============================================================================
# Configure JobStore
#============================================================================

org.quartz.jobStore.misfireThreshold 60000
org.quartz.jobStore.class org.quartz.simpl.RAMJobStore
11. Jul 2008, 01:24 America/New_York | Link
Arbi Sookazian

Compare to my code (uses Quartz or EJB3 timer):

components.xml: <event type=org.jboss.seam.postInitialization> <action execute=#{controller.scheduleTimer}/> </event> <!-- Install the QuartzDispatcher --> <async:quartz-dispatcher/> <!-- Install the EJB timer service --> <!-- <async:timer-service-dispatcher /> -->

@Name("controller")
@AutoCreate
public class ScheduleController implements Serializable { 
   
    @In ScheduleProcessor processor;    
    @Logger Log log;   	
	private Map<String,List<UserItem>> map;	
	private String distinguishedNameShims;	
	private String distinguishedNameItJava;	
	private Timer timer;	
	private QuartzTriggerHandle quartzTriggerHandle;
	
    public void scheduleTimer()
    {    	    	    	
    	Long pollingInterval = null;
	   		
		String activeDirectoryPollingInterval = CoxProperties.getPropertyObject().getProperty(CoxConstants.ACTIVE_DIRECTORY_POLLING_INTERVAL);
		if (activeDirectoryPollingInterval != null) {
			pollingInterval = Long.valueOf(activeDirectoryPollingInterval);
		}
		
		Boolean usingEjbTimer = Boolean.valueOf(CoxProperties.getPropertyObject().getProperty(CoxConstants.USING_EJB_TIMER)==null?"false":CoxProperties.getPropertyObject().getProperty(CoxConstants.USING_EJB_TIMER));		
		distinguishedNameShims = CoxProperties.getPropertyObject().getProperty(CoxConstants.DISTINGUISHED_NAME_SHIMS);			
				
		if (usingEjbTimer) {					
			timer = processor.createEjbTimer(new Date(), pollingInterval, distinguishedNameShims);
		}
		else {
			quartzTriggerHandle = processor.createQuartzTimer(new Date(), pollingInterval, distinguishedNameShims);
		}
	   
    }
	           
    
    public Map<String, List<UserItem>> getMembersOfRoleMap(){
    	
    	//get the map from the application context of EJBPollingProcessorBean        	
    	map = processor.getMap();
    	    	
    	return map;
    }
    	
	
}
@Name("processor")
@AutoCreate
@Scope(ScopeType.APPLICATION)
public class ScheduleProcessor { 
    
	//TO DO: map needs to be stored in application context as it is session-independent data
	//TO DO: convert this into an ArrayList of map objects b/c we will need a map
	// for every drop-down in each app
    
    private List<UserItem> userItemList;
    
    private Map<String, List<UserItem>> map;
    
    private Boolean cancelComplete = false;
    
    @Logger Log log;
    
    //@In(create=true) TimerService timerService;
    
    //EJB Timer version...
    @Asynchronous
    @Transactional
    public Timer createEjbTimer(@Expiration Date when, @IntervalDuration Long interval, String distinguishedGroupName) 
    {       	
    	process(when, interval, distinguishedGroupName);
    	
    	return null;
    }
    
    //Quartz version...
    @Asynchronous
    @Transactional
    public QuartzTriggerHandle createQuartzTimer(@Expiration Date when, @IntervalDuration Long interval, String distinguishedGroupName)
    {
    	process(when, interval, distinguishedGroupName);
    	
    	return null;
    }
    
    private void process(Date when, Long interval, String distinguishedGroupName) {
    	/*if(!cancelComplete) {
			//cancel existing timers...
	    	Collection collection = timerService.getTimers();
	    	if (collection != null) {
	    		Iterator it = collection.iterator();
	    		while(it.hasNext()) {
	    			Timer timer = (Timer) it.next();
	    			timer.cancel();
	    		}
	    		cancelComplete = true;
	    	}
		}*/
		
		log.info("when = " + when);
		log.info("interval = " + interval);
		log.info("distinguishedGroupName = "+distinguishedGroupName);
		
		String searchBase = CoxProperties.getPropertyObject().getProperty(CoxConstants.ACTIVE_DIRECTORY_SEARCH_BASE);
	    String providerUrl = CoxProperties.getPropertyObject().getProperty(CoxConstants.ACTIVE_DIRECTORY_PROVIDER_URL);
	    String principal = CoxProperties.getPropertyObject().getProperty(CoxConstants.ACTIVE_DIRECTORY_USER);
	    String credentials = CoxProperties.getPropertyObject().getProperty(CoxConstants.ACTIVE_DIRECTORY_PWD);
	
	    // Declare holders search result's
	    SearchAdapterResult<UserItem> userSearchResults = null;        
	    
	    // Create a new instance of CADILS search adapter
	    SearchAdapter sa = new SearchAdapter(searchBase, providerUrl, principal, credentials);
	
	    try {
	          String groupSearchFilter = "*)(memberOf=" + distinguishedGroupName;   
	          userSearchResults = sa.searchBySAMAccountName(groupSearchFilter);
	
	          if (userSearchResults.hasItems()) {
	              //List of all the AD users who belong to your group
	        	  userItemList = userSearchResults.getItemList();
	        	  if (map == null) {
	        		  map = new TreeMap<String, List<UserItem>>();
	        	  }
	        	  map.put(distinguishedGroupName, userItemList);
	          }
	    } 
	    catch (SearchFailedException sfe) {
	          log.error(sfe);
	    }
	    
    }
    
    
    public Map<String, List<UserItem>> getMap() {
    	return map;
    }
}
19. Jul 2008, 05:07 America/New_York | Link

Thank you for your post. It is working just great. Well I will post simplification of your code.

package edu.baylor.icpc.session.email;

import java.util.Date;

import javax.ejb.Timer;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.annotations.async.Asynchronous;
import org.jboss.seam.annotations.async.Expiration;
import org.jboss.seam.annotations.async.IntervalDuration;
import org.jboss.seam.async.QuartzTriggerHandle;
import org.jboss.seam.log.Log;

@Name("processor")
@AutoCreate
@Scope(ScopeType.APPLICATION)
public class ScheduleProcessor {

    @Logger
    Log log;

    //EJB Timer version...
    @Asynchronous
    @Transactional
    public Timer createEjbTimer(@Expiration
    Date when, @IntervalDuration
    Long interval, String text) {
        process(when, interval, text);

        return null;
    }

    //Quartz version...
    @Asynchronous
    @Transactional
    public QuartzTriggerHandle createQuartzTimer(@Expiration
    Date when, @IntervalDuration
    Long interval, String text) {
        process(when, interval, text);

        return null;
    }

    private void process(Date when, Long interval, String text) {

        log.info("when = " + when);
        log.info("interval = " + interval);
        log.info("text = " + text);

    }

}

components.xml

<event type="org.jboss.seam.postInitialization"> 
      <action execute="#{controller.scheduleTimer}"/> 
   </event>
   
   <!-- Install the QuartzDispatcher -->
   <async:quartz-dispatcher />
package edu.baylor.icpc.session.email;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

import javax.ejb.Timer;

import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.async.QuartzTriggerHandle;
import org.jboss.seam.log.Log;

@Name("controller")
@AutoCreate
public class ScheduleController implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -6332836501640042340L;

    @In
    ScheduleProcessor processor;

    @Logger
    Log log;

    private String text = "ahoj";

    private Timer timer;

    private QuartzTriggerHandle quartzTriggerHandle;

    public void scheduleTimer() {
        Long pollingInterval = 5000L;

        boolean usingEjbTimer = true;

        if (usingEjbTimer) {
            timer = processor.createEjbTimer(new Date(), pollingInterval, text);
        } else {
            quartzTriggerHandle = processor.createQuartzTimer(new Date(),
                    pollingInterval, text);
        }

    }

}
19. Jul 2008, 07:37 America/New_York | Link

Thanks for posting this code, it helped greatly. Here is my version, which is slightly different and just uses quartz:

package edu.nova.itss.grouper.async;

import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.annotations.async.Asynchronous;
import org.jboss.seam.annotations.async.Expiration;
import org.jboss.seam.annotations.async.IntervalCron;
import org.jboss.seam.async.QuartzTriggerHandle;
import org.jboss.seam.log.Log;

import edu.nova.itss.grouper.facade.AuthManagerSearchService;
import edu.nova.itss.grouper.facade.AuthManagerWriteService;
import edu.nova.itss.grouper.model.People;
import edu.nova.itss.grouper.model.Person;
import edu.nova.itss.grouper.util.BulkUtil;

@Name("processor")
@AutoCreate
@Scope(ScopeType.APPLICATION)
public class ScheduleProcessor { 
    
	@Logger(value="edu.nova.itss.grouper.async.addlog")
	private Log logadd;
	
	@Logger(value="edu.nova.itss.grouper.async.rolelog")
	private Log logrole;
	
	@In(required=false, create=true)
	AuthManagerWriteService authManagerService;
	
	@In(required=false, create=true)
	AuthManagerSearchService amSearch;
	
    @Asynchronous
    @Transactional
    public QuartzTriggerHandle createQuartzAddTimer(@Expiration Date when, @IntervalCron String interval){
    	bulkAddPerson();
    	return null;
    }
    
    @Asynchronous
    @Transactional
    public QuartzTriggerHandle createQuartzRoleTimer(@Expiration Date when, @IntervalCron String interval){
		String date = new Date().toString();
		try{
			bulkUpdateRole();
		} catch (Exception e){
			logrole.error(date + ": Error processing role log file.");
			e.printStackTrace();
		}
    	return null;
    }

.
.
.
}

And the Controller

package edu.nova.itss.grouper.async;
import java.io.Serializable;
import java.util.Date;

import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.async.QuartzTriggerHandle;
import org.jboss.seam.log.Log;

import edu.nova.itss.grouper.util.BulkUtil;

@Name("controller")
@AutoCreate
public class ScheduleController implements Serializable { 
   
	private static final long serialVersionUID = 7609983147081676186L;

	@In 
    ScheduleProcessor processor;    

    @Logger 
    Log log;  
     
	private QuartzTriggerHandle quartzAddTriggerHandle;
	
	private QuartzTriggerHandle quartzRoleTriggerHandle;
	
    public void scheduleTimer() {
		String addCronInterval = null;
		String roleCronInterval = null;
		try{
			addCronInterval = BulkUtil.getProperty("addCronInterval");
			roleCronInterval = BulkUtil.getProperty("roleCronInterval");
		} catch (Exception e){
			e.printStackTrace();
		}
		if ((addCronInterval != null)&(roleCronInterval != null)) {		
			quartzAddTriggerHandle = processor.createQuartzAddTimer(new Date(), addCronInterval);
			quartzRoleTriggerHandle = processor.createQuartzRoleTimer(new Date(), roleCronInterval);
		}
		
	}

}

build.xml

.
.
.
        <target name="jar" depends="compile,copyclasses" 
                        description="Build the distribution .jar file">
                <copy todir="${jar.dir}">
                        <fileset dir="${basedir}/resources">
                                <include name="seam.properties" />
                        	 	<include name="seam.quartz.properties" />
                                <include name="*.drl" />
                        </fileset>
                </copy>
.
.
.
        <target name="ear" description="Build the EAR">
                <copy todir="${ear.dir}">
                        <fileset dir="${basedir}/resources">
                                <include name="*jpdl.xml" />
                                <include name="*hibernate.cfg.xml" />
                                <include name="jbpm.cfg.xml" />
                        </fileset>
                		<fileset dir="${lib.dir}">
                				<include name="jboss-seam.jar" />
            					<include name="quartz.jar" />
                		</fileset>
                 </copy>
.
.
.

seam.quartz.properties

#==============================================================
# Configure Main Scheduler Properties
#==============================================================

org.quartz.scheduler.instanceName Sched1
org.quartz.scheduler.instanceId AUTO
org.quartz.scheduler.rmi.export false
org.quartz.scheduler.rmi.proxy false

#==============================================================
# Configure ThreadPool
#==============================================================

org.quartz.threadPool.class org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount 3

#==============================================================
# Configure JobStore
#==============================================================

org.quartz.jobStore.misfireThreshold 60000
org.quartz.jobStore.class org.quartz.simpl.RAMJobStore

Excerpt of my properties file with the Cron String

addCronInterval=0 0,15,30,45 * * * ?
roleCronInterval=0 10,25,40,55 * * * ?

components.xml

Added schema: 
xmlns:async="http://jboss.com/products/seam/async" 
Added quartz: 
<async:quartz-dispatcher />
17. Sep 2008, 23:00 America/New_York | Link

Did you ever find a solution to this? I'm now encountering the same issue. I have encountered either the case where I can't get it to run the first time or only the first time and never again.

I'm trying to do scheduling on startup as well.

Thanks.

18. Sep 2008, 03:29 America/New_York | Link

Sam,

The sample code I posted, and the original sample code worked for me. Make sure you have two classes.

24. May 2011, 05:52 America/New_York | Link

Hello,

I've tried to implement Tomas Cerny's example.

It seems the async tag is unknown. Do I have to implement something? I'm getting the following error:

10:14:01,218 ERROR [[/creditfriend]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: error while reading /WEB-INF/components.xml
	at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:232)
	at org.jboss.seam.init.Initialization.create(Initialization.java:134)
	at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
	at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
	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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
	at $Proxy38.start(Unknown Source)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
	at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
	at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
	at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
	at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
	at org.jboss.system.ServiceController.start(ServiceController.java:460)
	at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
	at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
	at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
	at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
	at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
	at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
	at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
	at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
	at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
	at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
	at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
	at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
	at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
	at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
	at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
	at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
	at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
	at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
	at org.jboss.Main.boot(Main.java:221)
	at org.jboss.Main$1.run(Main.java:556)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.dom4j.DocumentException: Error on line 23 of document  : The prefix "async" for element "async:quartz-dispatcher" is not bound. Nested exception: The prefix "async" for element "async:quartz-dispatcher" is not bound.
	at org.dom4j.io.SAXReader.read(SAXReader.java:482)
	at org.dom4j.io.SAXReader.read(SAXReader.java:343)
	at org.jboss.seam.util.XML.getRootElement(XML.java:24)
	at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:228)
	... 72 more

Thx for your help

Ben

24. May 2011, 05:55 America/New_York | Link

Here's my components.xml

<components xmlns="http://jboss.com/products/seam/components"
	xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence"
	xmlns:drools="http://jboss.com/products/seam/drools" xmlns:bpm="http://jboss.com/products/seam/bpm"
	xmlns:security="http://jboss.com/products/seam/security" xmlns:mail="http://jboss.com/products/seam/mail"
	xmlns:web="http://jboss.com/products/seam/web" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">

	<core:init debug="@debug@" jndi-pattern="@jndiPattern@" />

	<event type="org.jboss.seam.postInitialization">
		<action execute="#{controller.scheduleTimer}" />
	</event>

	<!-- Install the QuartzDispatcher -->
	<async:quartz-dispatcher />

	<core:manager concurrent-request-timeout="500"
		conversation-timeout="120000" conversation-id-parameter="cid"
		parent-conversation-id-parameter="pid" />

	<!--
		Make sure this URL pattern is the same as that used by the Faces
		Servlet
	-->
	<web:hot-deploy-filter url-pattern="*.seam" />

	<persistence:managed-persistence-context
		name="entityManager" auto-create="true"
		persistence-unit-jndi-name="java:/myEntityManagerFactory" />

	<drools:rule-base name="securityRules">
		<drools:rule-files>
			<value>/security.drl</value>
		</drools:rule-files>
	</drools:rule-base>

	<security:rule-based-permission-resolver
		security-rules="#{securityRules}" />

	<security:identity authenticate-method="#{authenticator.authenticate}"
		remember-me="true" />

	<event type="org.jboss.seam.security.notLoggedIn">
		<action execute="#{redirect.captureCurrentView}" />
	</event>
	<event type="org.jboss.seam.security.loginSuccessful">
		<action execute="#{redirect.returnToCapturedView}" />
	</event>

	<!-- For use with jBPM pageflow or process management -->
	<!--
		<bpm:jbpm> <bpm:process-definitions></bpm:process-definitions>
		<bpm:pageflow-definitions></bpm:pageflow-definitions> </bpm:jbpm>
	-->

	<core:resource-loader>
		<core:bundle-names>
			<value>text</value>
		</core:bundle-names>
	</core:resource-loader>


</components>
24. May 2011, 09:21 America/New_York | Link

Hi,

you need to add the namespaces definition in the header of the document.

xmlns:async="http://jboss.com/products/seam/async"

and you need to set its schemalocation (for instance, if you want auto-complete in your XML-editor)

http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.2.xsd  

(in this case for a seam 2.2 release.

Leo

 

Please don't forget to quote!

24. May 2011, 15:13 America/New_York | Link

Hi Leo,

thx a lot. The example is working.

Ben