[JBoss jBPM] - Re: Configure JobExecutor in Spring
by jeffj55374
Hi,
I wrote my own sub class of JobExecutor since the setter methods where missing. The code is below. The spring config is shown a the end.
| package org.jbpm.job.executor;
|
| import org.jbpm.JbpmConfiguration;
|
| /** Extend JobExecutor to provide setter methods so JobExecutor can be created by Spring
| *
| * @author jpjohnson
| *
| */
| public class JbpmJobExecutor extends JobExecutor {
| private static final long serialVersionUID = 1L;
| /** Initialize this class and start the threads. Intended to be used via
| * Spring to begin execution of the threads. You may also want to specify
| * lazy-init="true" in the Spring config file and explicitly load the bean
| * in your startup sequence.
| */
| public void init()
| {
| this.start();
| }
| public void setJbpmConfiguration(JbpmConfiguration configuration)
| {
| jbpmConfiguration = configuration;
| }
| public void setName(String newName)
| {
| name = newName;
| }
| public void setNbrOfThreads(int value) {
| nbrOfThreads = value;
| }
| public void setIdleInterval(int value) {
| idleInterval = value;
| }
| public void setMaxIdleInterval(int value) {
| maxIdleInterval = value;
| }
| public void setHistoryMaxSize(int value) {
| historyMaxSize= value;
| }
|
| public void setMaxLockTime(int value) {
| maxLockTime = value;
| }
| public void setLockMonitorInterval(int value) {
| lockMonitorInterval = value;
| }
| public void setLockBufferTime(int value) {
| lockBufferTime= value;
| }
| }
|
Here's the relevant section from my spring config.
| <!-- jBPM configuration -->
| <bean id="jbpmConfiguration"
| class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
| <property name="sessionFactory" ref="sessionFactory"/>
| <!-- property name="objectFactory" ref="jbpmObjectFactory"/-->
| <property name="configuration" value="classpath:/org/jbpm/default.jbpm.cfg.xml"/>
| <property name="createSchema"><value>false</value></property>
| <!--
| <property name="processDefinitions">
| <list>
| <ref local="simpleWorkflow"/>
| </list>
| </property>
| <property name="createSchema" value="false"/>
| <property name="processDefinitionsResources">
| <list>
| <value>classpath:/org/springmodules/workflow/jbpm31/someOtherWorkflow.xml</value>
| </list>
| </property>
| -->
| </bean>
| <bean id="jbpmObjectFactory" class="org.springmodules.workflow.jbpm31.JbpmObjectFactory">
| </bean>
| <!-- JbpmJobExecutor is a DigitalRiver custom class to allow Spring to create JobExecutor -->
| <bean id="jbpm.job.executor" class="org.jbpm.job.executor.JbpmJobExecutor"
| lazy-init="true" init-method="init" destroy-method="stopAndJoin">
| <property name="jbpmConfiguration" ref="jbpmConfiguration" />
| <property name="name" value="JbpmJobExecutor"/>
| <property name="nbrOfThreads" value="3"/>
| <property name="idleInterval" value="5000"/>
| <property name="maxIdleInterval" value="300000"/>
| <property name="historyMaxSize" value="20"/>
| <property name="maxLockTime" value="2147483646"/> <!-- 10 minutes -->
| <property name="lockMonitorInterval" value="60000"/> <!-- 1 minute -->
| <property name="lockBufferTime" value="5000"/> <!-- 5 seconds -->
| </bean>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088550#4088550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088550
18 years, 7 months
[JBoss Seam] - FullTextEntityManagerImpl
by jatsrt
Hi All,
I am using hibernate search in my app build on Seam 2.0.0CR1
When the session times out I am getting the following exception. It has a tendency to not let the session be recreated unless you close and restart the browser completely. I know this is still "experimental", anyone else experience this behavioe?
| 3:59:22,080 WARN [Component] Exception calling component @Destroy method: categories
| java.lang.RuntimeException: org.jboss.serial.exception.SerializationException: Could not create instance of org.hibernate.search.jpa.impl.FullTextEntityManagerImpl - org.hibernate.search.jpa.impl.FullTextEntityManagerImpl
| at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:809)
| at org.jboss.ejb3.stateful.StatefulBeanContext.getInstance(StatefulBeanContext.java:740)
| at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:62)
| at org.jboss.ejb3.stateful.StatefulContainer.invokePostActivate(StatefulContainer.java:397)
| at org.jboss.ejb3.stateful.StatefulBeanContext.postActivate(StatefulBeanContext.java:381)
| at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:316)
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:387)
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:97)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
| at $Proxy143.destroy(Unknown Source)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
| at org.javassist.tmp.java.lang.Object_$$_javassist_0.destroy(Object_$$_javassist_0.java)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
| at org.jboss.seam.Component.callComponentMethod(Component.java:2083)
| at org.jboss.seam.Component.callDestroyMethod(Component.java:2014)
| at org.jboss.seam.Component.destroy(Component.java:1332)
| at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
| at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:245)
| at org.jboss.seam.contexts.ServletLifecycle.endSession(ServletLifecycle.java:129)
| at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:49)
| at org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
| at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
| at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:682)
| at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667)
| at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1286)
| at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1571)
| at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1580)
| at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1580)
| at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1560)
| at java.lang.Thread.run(Thread.java:619)
| Caused by: org.jboss.serial.exception.SerializationException: Could not create instance of org.hibernate.search.jpa.impl.FullTextEntityManagerImpl - org.hibernate.search.jpa.impl.FullTextEntityManagerImpl
| at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:342)
| at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:239)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
| at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
| at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
| at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
| at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersister.java:196)
| at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.java:172)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
| at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
| at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
| at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:163)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
| at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
| at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:780)
| ... 59 more
| Caused by: java.lang.InstantiationException: org.hibernate.search.jpa.impl.FullTextEntityManagerImpl
| at java.lang.Class.newInstance0(Class.java:340)
| at java.lang.Class.newInstance(Class.java:308)
| at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:334)
| ... 84 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088546#4088546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088546
18 years, 7 months
[JBoss jBPM] - Configure JobExecutor in Spring
by mckanth
Hi,
I have tried to configure JobExecutor in Spring as below:
but I get the exception property jbpmConfiguration,nbrOfThreads,idleInterval etc are not writable in JobExecutor since there are no setter methods for those properties.
Is there any alternative to getting this working. configuring JobExecutor?
Thanks
mck
| <bean id="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor">
| <property name="jbpmConfiguration" ref="x.jbpmConfiguration" />
| <property name="name" value="JbpmJobExector"/>
| <property name="nbrOfThreads" value="1"/>
| <property name="idleInterval" value="5000"/>
| <property name="maxIdleInterval" value="300000"/>
| <property name="historyMaxSize" value="20"/>
| <property name="maxLockTime" value="600000"/>
| <property name="lockMonitorInterval" value="60000"/>
| <property name="lockBufferTime" value="5000"/>
| </bean>
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088538#4088538
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088538
18 years, 7 months