cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to initiazlize process engine in memory

afshad
Champ in-the-making
Champ in-the-making
I get the exception shown below when initializing the process engine. Anyone know why? thanks much if you can help.

ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration()
                    .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
                    .setJdbcUrl("jdbc:h2:mem:my-own-db;DB_CLOSE_DELAY=1000")
                    .setJobExecutorActivate(true)
                    .buildProcessEngine();

SEVERE: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.xml
org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.xml
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:528)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:295)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:270)
   at com.lgc.dsem.pres.pm.WorkflowComponent$1.actionPerformed(WorkflowComponent.java:61)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
   at org.pushingpixels.substance.internal.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:124)
   at java.awt.Component.processMouseEvent(Component.java:6288)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6053)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4651)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4481)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4481)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
   at java.awt.EventQueue.access$000(EventQueue.java:84)
   at java.awt.EventQueue$1.run(EventQueue.java:602)
   at java.awt.EventQueue$1.run(EventQueue.java:600)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:616)
   at java.awt.EventQueue$2.run(EventQueue.java:614)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
   at com.lgc.infra.pres.appworks.AWLiteImpl$EventProcessor.dispatchEvent(AWLiteImpl.java:504)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.xml
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:85)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:69)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:523)
   … 41 more
Caused by: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.xml
   at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:89)
   at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:76)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:253)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:83)
6 REPLIES 6

skramer
Champ in-the-making
Champ in-the-making
Hi @all,

I figured out the same issue when I tried to run activiti from an OSGi (Equinox) environment. I browsed the "activiti_engine.jar" and saw that the requested file is available. Can anyone please help me resolving this issue?

Regards,
Stefan

afshad
Champ in-the-making
Champ in-the-making
I finally got activiti to work with OSGI. It wasnt easy but after modifying the activiti manifest to register the ibatis buddy and some other things its working.
Stefan you could try to follow the following post:
http://forums.activiti.org/en/viewtopic.php?t=3317&p=13167

skramer
Champ in-the-making
Champ in-the-making
Hi Afshad,

thanks for your reply. I didn't manage to get activiti to work with OSGi. Can you explain please what you have done to register the ibatis buddy in the activiti manifest?

Regards,
Stefan

afshad
Champ in-the-making
Champ in-the-making
Hi Afshad,

thanks for your reply. I didn't manage to get activiti to work with OSGi. Can you explain please what you have done to register the ibatis buddy in the activiti manifest?

Regards,
Stefan

Hey Stefan
I hope the following steps work for you as they did for us:
1. In your target definition Add a new directory pointing to a location with all the necessary jars for Activiti to work. All these jars (including activiti-engine-5.8.jar) can be found in one of the the folders after you extract activiti.
2. In the MANIFEST.MF of the activity-engine-5.8.jar: (I’ve attached the new modified manifest as actviti-MANIFEST.MF)
add: 
a. Eclipse-RegisterBuddy: org.mybatis.mybatis
b. Look at attached image to define the optional import packages. The one on the left is what we added.
3. Changes to the MANIFEST.MF of the mybatis-3.0.4.jar: (I’ve attached the new modified manifest as mybatis-MANIFEST.MF)
Eclipse-BuddyPolicy: registered
4. In your module where you want to create the Activiti process engine, add the line:
Eclipse-RegisterBuddy: org.activiti.engine

To make changes to your manifest file just rename the jar to zip. Then in the manifest folder open the manifest file, make the changes. Drop the changed manifest to the zip and overwrite whats in there. Rename back to jar.

Installing the Activiti designer plugin is easy you can follow the instructions in the guide for that. We do not need it though.

skramer
Champ in-the-making
Champ in-the-making
Hi Afshad,

thanks for your reply that helped me out Smiley Happy

azam_basha
Champ in-the-making
Champ in-the-making
Hi Afshad,

I am trying to convert book-camel example provided with Manning Activiti book as bundle and deploy inside Servicemix, and I was struck with "Could not find resource org/activiti/db/mapping/entity/Attachment.xml" error.

I have followed all the steps except step 1 suggested by you, but still getting the same error.

I am not clear about point 1…

1. In your target definition Add a new directory pointing to a location with all the necessary jars for Activiti to work. All these jars (including activiti-engine-5.8.jar) can be found in one of the the folders after you extract activiti.


We have integrated activiti with servicemix. and deployed activiti-engine and mybatis.jar into servicemix and they are up and active.
as suggested I modified MANIFEST.MF files for both activity-engine-5.8.jar and mybatis-3.0.4.jar's in side maven repository and re-installed both the jars. but still getting the error.

Where I have to create new directory?

Following is error log, project structure and xml mappings.

Project Structure:

book-camel
–src/main/java
–+src/main/resources
—–+helloWorld
———helloworld.bpmn20.xml
—–+META-INF
——–+spring
————+activiti-application-context.xml
————+application-context.xml
————+camel-application-context.xml
–JRE System lib
–Maven dependencies
–+target
——-book-camel-1.0.jar
–pom.xml



Error Log:

karaf@root> Exception in thread "SpringOsgiExtenderThread-8" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw except
ion on object creation; nested exception is org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.io.IOEx
ception: Could not find resource org/activiti/db/mapping/entity/Attachment.xml
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:245)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:983)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java
:132)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource
org/activiti/db/mapping/entity/Attachment.xml
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:542)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:307)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:282)
        at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:60)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:56)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
        … 21 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.
xml
        at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:85)
        at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:69)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:537)
        … 27 more
Caused by: java.io.IOException: Could not find resource org/activiti/db/mapping/entity/Attachment.xml
        at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:89)
        at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:76)
        at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:253)
        at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:83)

=====================================


I have attached my project for your reference…Please help me in this regards.