01-03-2012 05:38 AM
11:33:00,020 User:System ERROR [quartz.core.JobRunShell] Job jobGroup.jobD threw an unhandled Exception:
java.lang.NullPointerException
at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getNodes(CronScheduledQueryBasedTemplateActionDefinition.java:223)
at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:397)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
11:33:00,020 User:System ERROR [quartz.core.ErrorLogger] Job (jobGroup.jobD threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.NullPointerException
at org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition.getNodes(CronScheduledQueryBasedTemplateActionDefinition.java:223)
at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition$1.doWork(AbstractScheduledAction.java:397)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:508)
at org.alfresco.repo.action.scheduled.AbstractScheduledAction$JobDefinition.execute(AbstractScheduledAction.java:392)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
… 1 more
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="runScriptAction" class="org.alfresco.repo.action.scheduled.SimpleTemplateActionDefinition">
<property name="actionName">
<value>script</value>
</property>
<property name="parameterTemplates">
<map>
<entry>
<key>
<value>script-ref</value>
</key>
<!– Note that as of Alfresco 4.0, due to a Spring upgrade, the FreeMarker ${foo} entries must be escaped –>
<value>\$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:webscripts/app:org/app:examples/cm:maxversion.get.js"' )\}</value>
</entry>
</map>
</property>
<property name="dictionaryService">
<ref bean="DictionaryService"/>
</property>
<property name="actionService">
<ref bean="ActionService"/>
</property>
<property name="templateService">
<ref bean="TemplateService"/>
</property>
</bean>
<!–
Run the script every minute - select the single node company home that is not used …
–>
<bean id="runScript" class="org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition">
<property name="transactionMode">
<value>UNTIL_FIRST_FAILURE</value>
</property>
<property name="compensatingActionMode">
<value>IGNORE</value>
</property>
<property name="searchService">
<ref bean="SearchService"/>
</property>
<property name="templateService">
<ref bean="TemplateService"/>
</property>
<property name="queryLanguage">
<value>lucene</value>
</property>
<property name="stores">
<list>
<value>workspace://SpacesStore</value>
</list>
</property>
<property name="queryTemplate">
<value>PATH:"/app:company_home"</value>
</property>
<property name="cronExpression">
<value>0 0/1 * * * ?</value>
</property>
<property name="jobName">
<value>jobD</value>
</property>
<property name="jobGroup">
<value>jobGroup</value>
</property>
<property name="triggerName">
<value>triggerD</value>
</property>
<property name="triggerGroup">
<value>triggerGroup</value>
</property>
<property name="scheduler">
<ref bean="schedulerFactory"/>
</property>
<property name="actionService">
<ref bean="ActionService"/>
</property>
<property name="templateActionDefinition">
<ref bean="runScriptAction"/> <!– This is name of the action (bean) that gets run –>
</property>
<property name="transactionService">
<ref bean="TransactionService"/>
</property>
<property name="runAsUser">
<value>System</value>
</property>
</bean></beans>
01-03-2012 06:07 AM
<!– Note that as of Alfresco 4.0, due to a Spring upgrade, the FreeMarker ${foo} entries must be escaped –>
Pas la peine d'échaper ${} en version 3.4.d.<property name="templateActionModelFactory">
<ref bean="templateActionModelFactory"/>
</property>
<property name="queryTemplate">
<value>PATH:"/app:company_home"</value>
</property>
… mais nous n'y sommes pas encore 😉01-03-2012 06:33 AM
01-03-2012 07:13 AM
Concernant le commentaire sur la 4.0, c'est tiré d'un exemple de code où j'ai laissé ce commentaire inutile.Vous n'avez pas fait que laisser ce commentaire, vous avez également suivi ses indications. En effet, vous avez écrit :
<value>\$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:webscripts/app:org/app:examples/cm:maxversion.get.js"' )\}</value>
qui est la façon de faire en 4.0, au lieu de :<value>${selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:webscripts/app:org/app:examples/cm:maxversion.get.js"' )}</value>
qui est la façon de faire en 3.4. En 3.4 "$", "{" et "}" sont écrits "$", "{" et "}" et pas "\$", "\{" et "\}".01-03-2012 09:10 AM
Après il faudra probablement revoir cette partie là… mais nous n'y sommes pas encore 😉<property name="queryTemplate">
<value>PATH:"/app:company_home"</value>
</property>
Cordialement,
Charles Le Seac'h
14:55:00,025 ERROR [quartz.core.ErrorLogger] Job (jobGroup.jobD threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.error.AlfrescoRuntimeException: 00030050 Invalid store ref: Does not contain :// //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:webscripts/app:org/app:examples]
at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 00030050 Invalid store ref: Does not contain :// //SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/app:webscripts/app:org/app:examples
01-03-2012 01:55 PM
01-04-2012 01:50 AM
3.4.d et 3.4.e avec Tomcat 6.0.29 (bien) et 6.0.33 (pas bien) sans y parvenir.
01-04-2012 08:42 AM
<value>\$\{selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/cm:webscripts/cm:org/cm:example/cm:maxversion.get.js"' )\}</value>
comme conseillé dans le bug https://issues.alfresco.com/jira/browse/ALF-9981, je n'ai plus d'erreur mais le script ne se lance pas."Invalid store ref:" Does not contain …
01-05-2012 08:02 AM
01-05-2012 08:29 AM
<value>#{"${"}selectSingleNode('workspace://SpacesStore', 'lucene', 'PATH:"/app:company_home/app:dictionary/cm:webscripts/cm:org/cm:example/cm:maxversion.get.js"' )#{"}"}</value>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.