Git Product home page Git Product logo

spring-jbpm-app's Introduction

jbpm-spring-app

jBPM spring application that shows how to build execution server using jBPM 6 and spring

Installation notes:

JBoss EAP 6.x

Application after successful build works out of the box on JBoss EAP with its in memory data base.

Wildfly

For Wildfly there needs to be one configuraion change apply to ensure that CDI container will only resolve beans from actual bean archives (those that include META-INF/beans.xml)

issue following JBoss CLI command for wildfly service prior deployment

/subsystem=weld:write-attribute(name=require-bean-descriptor,value=true)

Tomcat

  1. Install bitronix transaction manager into your tomcat 7
  • copy following libs into TOMCAT_HOME/lib

    • btm-2.1.4.jar
    • btm-tomcat55-lifecycle-2.1.4.jar
    • h2-1.3.161.jar
    • jta-1.1.jar
    • slf4j-api-1.7.2.jar
    • slf4j-jdk14-1.7.2.jar

    NOTE: versions of the libraries can be different as these are the actual on the time of writing.

  1. Create configuration files inside TOMCAT_HOME/conf

    • btm-config.properties ************************ sample btm-config.properties ************************* bitronix.tm.serverId=tomcat-btm-node0 bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties

    • resources.properties ************************ sample resources.properties ************************** resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource resource.ds1.uniqueName=jdbc/jbpm resource.ds1.minPoolSize=10 resource.ds1.maxPoolSize=20 resource.ds1.driverProperties.driverClassName=org.h2.Driver resource.ds1.driverProperties.url=jdbc:h2:file:~/jbpm resource.ds1.driverProperties.user=sa resource.ds1.driverProperties.password= resource.ds1.allowLocalTransactions=true

    NOTE: jdbc/jbpm is the JNDI name used by tomcat distribution of the application

  2. Define btm.root system property and location where bitronix config file is placed

    create setenv.sh (or setenv.bat) file inside TOMCAT_HOME/bin and add following:

    CATALINA_OPTS="-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=$CATALINA_HOME -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry"

    NOTE: this is an example for unix like systems for Windows $CATALINA_HOME needs to be replaced with windows env variable or absolute path

  3. use proper persistence.xml file - application comes with two persistence.xml files in web module, just use rename the default one to jboss and the other rename from tomcat to jbpm-persistence.xml and build the application and that should be all.

spring-jbpm-app's People

Contributors

mswiderski avatar winklerm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-jbpm-app's Issues

report some error when deploy it into tomcat

Acorrding to you read me file,I contig the war into tomcat 7,but report some error as blow,
Caused by: java.lang.IllegalStateException: No JTA UserTransaction available - specify either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManagerName'
How to fix it

Entitymanager getting closed

@mswiderski ,
I deploy a process and when I try to create a new instance of the process, I get an error as "2017-03-17 17:03:39 WARN SingleSessionCommandService:408 - Could not commit session
java.lang.IllegalStateException: EntityManager is closed".

jbpm version upgrade

hi mr @mswiderski
is it possible to upgrade version of jbpm to 7.28 or higher ,please.
or can i have a guide to make pom and other configs

Exception during tomcat startup

Hello, I deployed the project on tomcat, and on startup, I get the following exception saying

Caused by: org.h2.jdbc.JdbcSQLException: Table "TASK" not found; SQL statement:
select taskimpl0_.id as col_0_0_, deadlineim1_.id as col_1_0_, deadlineim1_.deadline_date as col_2_0_ from Task taskimpl0_ cross join Deadline deadlineim1_ where taskimpl0_.archived=0 and (deadlineim1_.id in (select startdeadl2_.id from Deadline startdeadl2_ where taskimpl0_.id=startdeadl2_.Deadlines_StartDeadLine_Id)) and deadlineim1_.escalated=0 order by deadlineim1_.deadline_date [42102-161]

The entire stacktrace
INFO: Using org.drools.persistence.jta.JtaTransactionManagerFactory@3f330c80 Hibernate: select taskimpl0_.id as col_0_0_, deadlineim1_.id as col_1_0_, deadlineim1_.deadline_date as col_2_0_ from Task taskimpl0_ cross join Deadline deadlineim1_ where taskimpl0_.archived=0 and (deadlineim1_.id in (select startdeadl2_.id from Deadline startdeadl2_ where taskimpl0_.id=startdeadl2_.Deadlines_StartDeadLine_Id)) and deadlineim1_.escalated=0 order by deadlineim1_.deadline_date Apr 23, 2020 7:16:55 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions WARN: SQL Error: 42102, SQLState: 42S02 Apr 23, 2020 7:16:55 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: Table "TASK" not found; SQL statement: select taskimpl0_.id as col_0_0_, deadlineim1_.id as col_1_0_, deadlineim1_.deadline_date as col_2_0_ from Task taskimpl0_ cross join Deadline deadlineim1_ where taskimpl0_.archived=0 and (deadlineim1_.id in (select startdeadl2_.id from Deadline startdeadl2_ where taskimpl0_.id=startdeadl2_.Deadlines_StartDeadLine_Id)) and deadlineim1_.escalated=0 order by deadlineim1_.deadline_date [42102-161] Apr 23, 2020 7:16:55 PM org.jbpm.services.task.commands.InitDeadlinesCommand execute SEVERE: Error when executing deadlines javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not prepare statement at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:273) at org.jbpm.services.task.persistence.JPATaskPersistenceContext.queryInTransaction(JPATaskPersistenceContext.java:421) at org.jbpm.services.task.commands.InitDeadlinesCommand.execute(InitDeadlinesCommand.java:52) at org.jbpm.services.task.commands.InitDeadlinesCommand.execute(InitDeadlinesCommand.java:33) at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65) at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) at org.jbpm.services.task.persistence.TaskTransactionInterceptor.execute(TaskTransactionInterceptor.java:69) at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) at org.drools.persistence.jta.TransactionLockInterceptor.execute(TransactionLockInterceptor.java:73) at org.drools.core.command.impl.AbstractInterceptor.executeNext(AbstractInterceptor.java:41) at org.drools.persistence.jpa.OptimisticLockRetryInterceptor.execute(OptimisticLockRetryInterceptor.java:82) at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40) at org.jbpm.services.task.impl.TaskDeadlinesServiceImpl.initialize(TaskDeadlinesServiceImpl.java:367) at org.jbpm.services.task.HumanTaskConfigurator.getTaskService(HumanTaskConfigurator.java:157) at org.kie.spring.factorybeans.TaskServiceFactoryBean.getObject(TaskServiceFactoryBean.java:96) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:166) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1465) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1419) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283) at org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean(AbstractBeanFactory.java:1371) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:751) at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:526) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:359) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335) at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:187) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:906) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:864) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:779) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:490) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:602) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:521) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:462) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1240) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1184) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1078) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5389) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5689) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1007) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:983) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:639) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1127) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:2020) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.hibernate.exception.SQLGrammarException: could not prepare statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:188) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1854) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1831) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1811) at org.hibernate.loader.Loader.doQuery(Loader.java:899) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341) at org.hibernate.loader.Loader.doList(Loader.java:2516) at org.hibernate.loader.Loader.doList(Loader.java:2502) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332) at org.hibernate.loader.Loader.list(Loader.java:2327) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:264) ... 85 more Caused by: org.h2.jdbc.JdbcSQLException: Table "TASK" not found; SQL statement: select taskimpl0_.id as col_0_0_, deadlineim1_.id as col_1_0_, deadlineim1_.deadline_date as col_2_0_ from Task taskimpl0_ cross join Deadline deadlineim1_ where taskimpl0_.archived=0 and (deadlineim1_.id in (select startdeadl2_.id from Deadline startdeadl2_ where taskimpl0_.id=startdeadl2_.Deadlines_StartDeadLine_Id)) and deadlineim1_.escalated=0 order by deadlineim1_.deadline_date [42102-161] at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) at org.h2.message.DbException.get(DbException.java:169) at org.h2.message.DbException.get(DbException.java:146) at org.h2.command.Parser.readTableOrView(Parser.java:4749) at org.h2.command.Parser.readTableFilter(Parser.java:1075) at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1681) at org.h2.command.Parser.parseSelectSimple(Parser.java:1788) at org.h2.command.Parser.parseSelectSub(Parser.java:1675) at org.h2.command.Parser.parseSelectUnion(Parser.java:1518) at org.h2.command.Parser.parseSelect(Parser.java:1506) at org.h2.command.Parser.parsePrepared(Parser.java:405) at org.h2.command.Parser.parse(Parser.java:279) at org.h2.command.Parser.parse(Parser.java:251) at org.h2.command.Parser.prepareCommand(Parser.java:217) at org.h2.engine.Session.prepareLocal(Session.java:415) at org.h2.engine.Session.prepareCommand(Session.java:364) at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1119) at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:71) at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64) at com.sun.proxy.$Proxy3.prepareStatement(Unknown Source) at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:257) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:64) at com.sun.proxy.$Proxy42.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:161) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182) ... 101 more

Can you please help me out ?

Thanks,
Sandesh

How to get bpmn2nodeid in TaskSummary instance?

I'm using taskService.getTasksAssignedAsBusinessAdministrator("admin","") to get a list of TaskSummary instance. But in this Task a want get the associate bpmn2nodeid in the bpmn2 file. Is there a method to solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.