Activiti 6 is here!

cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 6 is here!

Alfresco Employee
6 26 21.8K

Activiti 6 is here and it brings a number of significant updates to its core functionality.

The main highlights are:

  • Pluggable Persistence

Previously, the persistence logic was spread across different parts of the code. This made it hard to maintain and impossible to customise. Now, persistence logic has been centralised and a new set of DataManager interfaces (for low level CRUD operations) has been introduced, in addition to refactoring all entity classes and entity manager interfaces. This provides a high level of abstraction that easily enables customizing the persistence logic and swapping it with a totally different implementation. This enables the possibility for custom implementations to use different ORM libraries, multiple databases, NoSQL, or both relational and nonrelational databases concurrently and more!

  • No PVM, just BPMN

Activiti 5 uses a PVM (Process Virtual Machine) intermediate layer between the core engine and BPMN model. Activiti 6 core engine now directly works with the BPMN model.  All classes in the org.activiti.engine.impl.pvm package (and subpackages) have been removed since they are no longer needed. This results in reduced complexity and an increase in performance.  This also makes it possible to do things that were not previously possible in Activiti 5.

For example:

Running the process on Activiti 5 will result in a StackOverflowError. In Activiti 6 the process will run without any issues. Check it yourself by running this test available on github. The test class also contains other tests like the inclusive gateway and concurrency after a boundary event that were failing in Activiti 5 but are now working fine.

  • Support for dynamic processes & ad­-hoc sub processes

Consider a process definition designed to include a service task that communicates with an external system. After deploying and running some process instances some issues in the external system occurred and modifications were needed to that system. The modifications aren’t backward compatible, as a result, an updated service task implementation that’s aware of those changes is required. The process definition can be updated and redeployed but what happens to in-flight process instances? Isn’t there a way to fix them? It’s possible to update the process definition manually from the databases but that’s not a clean way to fix it. That’s where the DynamicBpmnService is very useful. DynamicBpmnService enables changing properties/attributes (i.e. changing task assignee, task priority, service task class, script task script, etc!) of a process definition without the need to redeploy. Some examples of using DynamicBpmnService can be found on github here.

Ad-hoc sub processes provides the possibility to dynamically add sequences of work on-the-fly. As part of dynamic support introduced in the engine ad-hoc sub process allows defining tasks without a predefined sequence order. The sequence order can be determined at runtime. There could also be some tasks that need to be executed in sequence order and other tasks that are left to runtime to determine their order. The following example shows two sets of tasks, one set (A task, Next Task, and Final Task) that should be executed in a pre-defined order.

The other set is can be determined at runtime. The following code shows how to get and execute those tasks.

Execution execution = runtimeService.createExecutionQuery().activityId("adhocSubProcess").singleResult();
assertNotNull(execution);

List<FlowNode> enabledActivities = runtimeService.getEnabledActivitiesFromAdhocSubProcess(execution.getId());
assertEquals(4, enabledActivities.size());

runtimeService.executeActivityInAdhocSubProcess(execution.getId(), enabledActivities.get(0).getId());
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The DMN Engine and Designer allows you to create decision tables and get an outcome based on the input values and the rules defined in the decision table. These decision tables can be invoked from a decision rule task in a BPMN definition, but also independently of a process instance.

  • Form Designer & Engine

The Form Designer is a web-based visual environment to quickly design web forms without requiring special technical skills. It empowers business users to be part of the design phase. The Form Engine centralizes the form logic that was introduced with the new Form Designer. Forms can be deployed with BPMN process definitions but also deployed separately. Forms can be either referenced in a start event or a user task.

  • Activiti 6 App UI

The activiti-app is a new web-based environment composed of 3 Apps:  Kickstart App, Task App and Identity Management app.

  • The Kickstart App includes a BPMN 2 Editor to design process models, a Form Editor to visually design forms, a decision table editor to create DMN decision tables and an App Editor to create and publish process apps bundling all the models in one single package.
  • The Task App allows you to start new processes and tasks and access tasks assigned to you from any process apps.
  • The Identity Management app gives the admins the capability to create and manage users and groups. 

The Activiti 6 app UI home page.

Activiti 6 Task App showing the process list view.

Activiti 6 Identity management app showing the user list view.

  • Activiti 6 Admin App UI

The activiti-admin app is an administration console for administrators to monitor running tasks, process instances and jobs. Admins can perform various actions such as assign/claim/delegate tasks, terminate/delete process instances, update/add/delete variables, execute/delete jobs...

Activiti 6 Admin console showing a running instance detailed view.

  • Migration guide

Ready to move to Activiti 6? We have created a migration guide that outlines various aspects to consider and what is needed when migrating from Activiti v 5.x to Activiti version 6. Here the download page to get started with Activiti 6!

About the Author
Open Source, Java, BPM and Rule Engine enthusiast and promoter. Writer of 4 books about BPM & Rule Engines, now Principal Software Engineer @ Alfresco.
26 Comments
Senior Member

Thank you for a great article.

Please let me ask a little.

Are the following use cases impossible with DynamicBpmnService of Activiti 5.22.0?
https://www.activiti.org/javadocs/org/activiti/engine/DynamicBpmnService.html#changeServiceTaskClass...

Please tell me the difference from DynamicBpmnService of Activiti 5.22.0.
Did the setting (method) that can be changed increased?

> Consider a process definition designed to include a service task that communicates with an external system. After deploying and running some processes instances some issues in the external system occurred and modifications were needed to that system. The modifications aren’t backward compatible, as a result, an updated service task implementation that’s aware of those changes is required. The process definition can be updated and redeployed but what happens to in-flight process instances? Isn’t there a way to fix them? It’s possible to update the process definition manually from the databases but that’s not a clean way to fix it. That’s where the DynamicBpmnService is very useful. DynamicBpmnService enables changing properties/attributes (i.e. changing task assignee, task priority, service task class, script task script, etc!) of a process definition without the need to redeploy. Some examples of using DynamicBpmnService can be found on github here.

Alfresco Employee

Thanks for asking.

Yes, it's the same as 5.22 but more dynamic support was introduced in version 6 like the adhoc subprocess support. The whole concept of dynamic support was meant for version 6 but this was introduced earlier to get earlier feedback. 

Member II

Nice article. It's very helpful & exciting to work with activiti6

This has reduced lot of effort from our side..!!

Member II

Thank you for a great article. its  significantly  helpful !

Senior Member

As like in enterprise edition is there data model support? I am checking kindly help me how to create data model.

There are some problems I found like

  • In enum datatype there is no option to add values
  • Remove App doesn’t work after publishing the app
  • Theme doesn’t update after publishing app

Help me to overcome the above problems.

Thanks 

Amruta Wandakar

Alfresco Employee

Hi Amruta,

Data model support is an enterprise only feature. Regarding the issues you found please create JIRA tickets here.

 

Thanks,

Senior Member

Hi Bassam AI-Sarori,

Thank you for your reply.

I need the following information regarding activiti 6

  • Where to write javascript code(for example I want to display certain check boxes based on the radio button chosen).
  • I want to display data from the database in tabular format or any other option is also ok.

Kindly can anyone help me out.

Thanks,

Established Member II

Hi,

   As activit 6 UI is totally changed and translated in to angular 1.x can i get the ADF support for activiti 6 community edition to be able to develop custom application

Member II

Thanks for your sharing, I have migrated follow the guide at Activiti Migraton Guide : Activiti v5 to Activiti v6 , but I meet and issue on old instance, boundary event can not catch BpmnError on service task. Did you meet that issue? 

ref:  

Established Member II

Hi,

    sorry i have not migrated from activiti 5 to 6 but started using activiti 6 directly.

Senior Member

Hey ‌ - If you have a question, can you post a new topic? Sometimes comments on older blogs often get overlooked in the Q&A.

Member II

I have been using version 5 and am potentially looking to upgrade to 6, what i'm after is the ability to specify a hyperlink within a user task, so that if anyone runs the workflow they can follow the link. Is this possible in the newer version?

Thanks

Senior Member

Hi Sean, 

We are working on something like that for Activiti 7, but can you please clarify your expectations? "to specify a hyperlink within a user task, so that if anyone runs the workflow they can follow the link" doesn't mean much to us unless you add more context to it. It sounds like you want to send a link to a user task via email to someone, is that what you are looking for?

Cheers

Member II

Hi,

Currently I have a workflow that processes some data, I have also created a separate web service to collect some user inputs. I then integrated this external service by placing a user process within my workflow that asks them to go to the url stated and enter the required data. At the moment I have to get them to copy and paste the link out of the user task text field rather than clicking an active hyperlink? I was hoping that I could issue a user process with a hyperlink that they then clicked on?

Senior Member

Hi Sean, that's very domain specific and it is quite hard for an open source project to provide quite a generic feature like the one that you are expecting. Imagine that in order to expose a link you will probably need to know the following details:

- where is Activiti hosted? is it hosted as a public service (public IP)?

- what technology are you using to secure the request and the data? (OAuth2, SAML, Kerberos?) 

- how do you register users and check that they are the ones authorised to provide the data (IDM /LDAP/AD)?

- what is the front end technology that will be used to render forms to acquire data?

I believe that we don't provide what you are asking for directly, but we provide all the tools to implement that functionality. You just need to provide the glue for your particular environment and technology stack. 

Does it make sense?

Cheers

Active Member

The new version makes backward compatibility breaks, for example in case of JavaDelegate which is not throwing exception anymore.

If I'm going to migrate to version 6.0.0, I'll need to update all my classes that right now implements JavaDelegate  and throws exception.

Established Member

Yevgeny Lvovski‌, if you are looking at migration to 6 you may want to skip 6 and start looking at going to Activiti 7.

Active Member

I didn't see activiti artifacts for maven in version 7.0.0.

Activiti 7 doesn't have these backward compatibility breaks?

Established Member

If you are going to need to be making changes I'm just suggesting that you look at going with Activiti 7 which is the future and the future is just about here.  While you may still be able to implement a JavaDelegate the old way in the new architecture you will best served by isolating your custom logic in an Activiti Cloud Connector.

Member II

Hello,

I'm using Activiti 5 and thinking about migration to 6 (or even 7), but one thing bothers me. Why are there no 6.1.0, 6.2.0 or even 6.0.1, 6.0.2, etc. versions? Should I assume that you have created the perfect library which did not require not even a small bug fix since its release in May 2017? Or am I missing something?

Senior Member

Hi Krzysztof,

You are correct, but in order to answer your question we need to differentiate what are you looking in Activiti.

Activiti 6 was conceived as the next major version of Activiti, there were no big changes in architecture of the solution. 

So it really depends on how your solution looks like and if you are upgrading your architecture for the cloud or not. 

Our current focus right now is Cloud and Cloud Native architectures, so we took Activiti 6 core engine and we improve it along side new services focused on Cloud deployments. For that reason now we are trying to release Activiti 7 core Beta2 and improve in short cycles any bug that we found or that comes from Activiti 6 core code. 

I hope that make sense, you can still use Activiti 7 Core and all the improvements for non cloud deployments and it is a great time to get involved in the maturity of these new components. 

If you have further questions please join our gitter channel for more advanced questions: Activiti/Activiti7 - Gitter 

Active Member

I can not start activiti 6 win 7 64 bit
Activiti User Guide 
I download activiti 6 and tomcat 9 and setup i coppy 3 file .War in Activiti 6 to webapps Tomcat and start but only file rest start complete , App and admin fail 
You can support me by video?
I need Use Activiti 6.


Tomcat logs
02-Nov-2018 15:40:37.388 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.activiti.conf.WebConfigurer]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activitiClientService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.activiti.service.activiti.ServerConfigService com.activiti.service.activiti.ActivitiClientService.serverConfigService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.activiti.repository.ServerConfigRepository com.activiti.service.activiti.ServerConfigService.serverConfigRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigRepository': Cannot create inner bean '(inner bean)#44114b9f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44114b9f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at com.activiti.conf.WebConfigurer.contextInitialized(WebConfigurer.java:46)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5109)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.activiti.service.activiti.ServerConfigService com.activiti.service.activiti.ActivitiClientService.serverConfigService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.activiti.repository.ServerConfigRepository com.activiti.service.activiti.ServerConfigService.serverConfigRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigRepository': Cannot create inner bean '(inner bean)#44114b9f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44114b9f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 52 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.activiti.repository.ServerConfigRepository com.activiti.service.activiti.ServerConfigService.serverConfigRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigRepository': Cannot create inner bean '(inner bean)#44114b9f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44114b9f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 54 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.activiti.repository.ServerConfigRepository com.activiti.service.activiti.ServerConfigService.serverConfigRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigRepository': Cannot create inner bean '(inner bean)#44114b9f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44114b9f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 65 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverConfigRepository': Cannot create inner bean '(inner bean)#44114b9f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44114b9f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 67 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#44114b9f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:634)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:444)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
... 80 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class com.activiti.conf.DatabaseConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 88 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.persistence.EntityManagerFactory]: Factory method 'entityManagerFactory' threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 97 more
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:925)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
at com.activiti.conf.DatabaseConfiguration.entityManagerFactory(DatabaseConfiguration.java:163)
at com.activiti.conf.DatabaseConfiguration$$EnhancerBySpringCGLIB$$edb13ae1.CGLIB$entityManagerFactory$0(<generated>)
at com.activiti.conf.DatabaseConfiguration$$EnhancerBySpringCGLIB$$edb13ae1$$FastClassBySpringCGLIB$$fa8f89ce.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
at com.activiti.conf.DatabaseConfiguration$$EnhancerBySpringCGLIB$$edb13ae1.entityManagerFactory(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 98 more
Caused by: org.hibernate.cfg.beanvalidation.IntegrationException: Error activating Bean Validation integration
at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:154)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:307)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1799)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
... 113 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2248)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2214)
at org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:29)
at org.hibernate.validator.internal.util.Version.<clinit>(Version.java:27)
at org.hibernate.validator.internal.engine.ConfigurationImpl.<clinit>(ConfigurationImpl.java:65)
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:276)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:110)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:445)
at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:96)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:148)
... 117 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138)
... 134 more

Senior Member

Hi Dang, 

You probably need to switch to JDK 8 to get it working. Activiti 6 was released more than a year ago, and it wasn't updated to JDK 11 yet. 

Active Member

I using C:\Program Files\Java\jdk-9.0.1
I have to JDK 8 for activiti 6 woking?
But I down activiti 5.22 it woking but activiti 6 error!

Active Member

Hi Mauricio.
JDK 8 it woking thaks you so much!

Active Member

Hi everybody.
I want Add Rest call task same alfresco How to add this?