cancel
Showing results for 
Search instead for 
Did you mean: 

HELP: Activiti on Apache Karaf

deepyou
Champ in-the-making
Champ in-the-making
Hi all, We're following the example showed in the "Activiti in Action" Book ( 9.3.2 Using Apache Karaf as an OSGi container) to upload activiti-egine as Bundle in OSGi containter (apache Karaf). We already know that there is a project "Activiti-Karaf" that is a bundle with activiti engine and karaf.
But we need to learn how to deploy activiti-engine as bundle in our OSGi container so we need to upload Activiti as Bundle.
We tried to follow the example in the Book written by Tijs Rademakers but we have a lot of problems. It seem that the karaf container cannot connect to the activiti H2 DataBase (we suppose).

Can someone indicate a step by step tutorial to deploy activiti-engine in OSGi containter? I think that Activiti-doc in this case is not so rich.

I post the exception that we have after we try to deploy the activiti-engine bundle and try to start it on Apache Karaf.

Can someone help Us?

Best Regards
Gaetano.

g.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='.component-1']
   … 63 more
2012-10-29 16:53:04,964 | ERROR | rint Extender: 2 | ServiceRecipe                    | lueprint.container.ServiceRecipe  323 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Error retrieving service from ServiceRecipe[name='.component-1']
org.osgi.service.blueprint.container.ComponentDefinitionException: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean processEngineFactory
   at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:295)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:247)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:349)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:502)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:310)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.Felix.getService(Felix.java:3420)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)[org.apache.felix.framework-4.0.3.jar:]
   at org.activiti.osgi.Extender.addingService(Extender.java:89)[76:org.activiti.osgi:5.10.0]
   at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf.jar:2.3.0]
   at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)[karaf.jar:2.3.0]
   at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf.jar:2.3.0]
   at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[karaf.jar:2.3.0]
   at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)[karaf.jar:2.3.0]
   at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4260)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.Felix.registerService(Felix.java:3275)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)[org.apache.felix.framework-4.0.3.jar:]
   at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:421)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:191)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:668)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:352)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:252)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[7:org.apache.aries.blueprint.core:1.0.1]
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_35]
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_35]
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_35]
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_35]
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)[:1.6.0_35]
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_35]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_35]
   at java.lang.Thread.run(Thread.java:662)[:1.6.0_35]
Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean processEngineFactory
   at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.0.1]
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_35]
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_35]
   at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:280)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.0.1]
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_35]
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_35]
   at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:280)[7:org.apache.aries.blueprint.core:1.0.1]
   … 34 more
Caused by: org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:575)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:325)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:300)
   at org.activiti.osgi.blueprint.ProcessEngineFactory.init(ProcessEngineFactory.java:46)
   at org.activiti.osgi.blueprint.ProcessEngineFactoryWithELResolver.init(ProcessEngineFactoryWithELResolver.java:39)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_35]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_35]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_35]
   at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_35]
   at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[7:org.apache.aries.blueprint.core:1.0.1]
   at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[7:org.apache.aries.blueprint.core:1.0.1]
   … 52 more
Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
   at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)[:2.1.0]
   at org.apache.ibatis.parsing.XPathParser.commonConstructor(XPathParser.java:261)
   at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:116)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:59)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:566)
   … 63 more
10 REPLIES 10

frederikherema1
Star Contributor
Star Contributor
MyBatis tries to parse SQL-statements and mappings from XML-files. Seems that there is NO dom-parser available in the jvm/classpath:


javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom

deepyou
Champ in-the-making
Champ in-the-making
Ok, we suppose that it was some like you describe, but can you explain where we have to add a dom-parser in jvm/classpath. I mean that we just follow the "Activiti in Action" book, with the book source-code and it doesn't work. We need a start point to deploy activiti engine in OSGi but it seem that is not so easy as describe in the book.
Can you help us?

MyBatis tries to parse SQL-statements and mappings from XML-files. Seems that there is NO dom-parser available in the jvm/classpath:


javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom

frederikherema1
Star Contributor
Star Contributor
Does this help? http://fusesource.com/forums/message.jspa?messageID=10929

What JDK are you using? Try adding Xerces or another JAXP XPath provider to your class path.

trademak
Star Contributor
Star Contributor
Hi Gaetano,

Are you using the latest source code from the Google code repository of the book? I made some changes there a couple of months ago for the Karaf example.
Did you follow these steps:

1. Build the book-osgi project with Maven
2. Start Karaf and run the following commands there
3. Start the standalone H2 database
4. features:addurl mvnSmiley Surprisedrg.bpmnwithactiviti/book-osgi-features/1.0.0/xml/features
5. features:install book-osgi

Which Java version are you running?

Best regards,

deepyou
Champ in-the-making
Champ in-the-making
Hi Tijs,
Today I'm going to follow your advice and I hope to resolve it.
If I'll find some problem can I ask you?
Thanks for the advice and compliment for your book, and all Activiti project sound so great.

I hope we can make our technologies on the Activiti Engine.

You'll soon hear from me on the outcome
Best Regards.

Gaetano Fabiano

trademak
Star Contributor
Star Contributor
Hi Gaetano,

Thanks.
Sure, when you run into an issue just let me know.

Best regards,

deepyou
Champ in-the-making
Champ in-the-making
Hi Tijs, sorry but It still doesn't work 😞

these are my steps:

1) I download the code from http://code.google.com/p/activitiinaction/
2) I Import the project as Maven Project in Eclipse
3) Syncronize all project with SVN repository
4) Run Maven Clean and Install for the poject "book-osgi" and all child project
5) Starts the h2 database with ant a2.start in the activiti directory
6) Download apache karaf from here http://www.apache.org/dyn/closer.cgi/karaf/2.3.0/apache-karaf-2.3.0.zip
7) Start Apache Karar in the apache directory with karaf.bat
😎 Run the follow command in the Karaf konsole :
    -features:addurl mvnSmiley Surprisedrg.bpmnwithactiviti/book-osgi-features/1.0.0/xml/features
    -features:install book-osgi
After tha in the karaf log I've the follow exception:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to intialize bean processEngineFactory
at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)[7Smiley Surprisedrg.apache.aries.blueprint.core:1.0.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[7Smiley Surprisedrg.apache.aries.blueprint.core:1.0.1]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7Smiley Surprisedrg.apache.aries.blueprint.core:1.0.1]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7Smiley Surprisedrg.apache.aries.blueprint.core:1.0.1]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_35]
at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_35]







My java version is the 1.6.0_32 (32Bit) I tryed also with the 64 Bit version but it still doesn't work.

What could it be my problem?
Can you help me? I've no idea where is my problem.
If the book's example is complicated can you send me just an Hello Word project with activiti osgi? Or can you explain me where is my ploblem.
Thanks for all.
best regards.
Gaetano.
Hi Gaetano,

Thanks.
Sure, when you run into an issue just let me know.

Best regards,

trademak
Star Contributor
Star Contributor
Hi Gaetano,

I also downloaded the latest Karaf version and I get the same error message.
There seems to be an issue with the XPathFactory resolving and I also found an issue in the Karaf JIRA related to that (KARAF-1334).
But I can also confirm that the example works on the previous version of Karaf (version 2.2.8).
Maybe you can use the 2.2.8 release for now? I'll see if we can resolve the issue with the 2.3.0 release.

Best regards,

deepyou
Champ in-the-making
Champ in-the-making
Ok, I'll try with the version that you suggest.
Thanks very much for the support, I'm reading now about the issue, if is the problem showed in the issue I hope the community will resolve it.
Thanks very much, now I'm going to try with the 2.2.8 version, for my company is not important the versione of Karaf because our Goal is deploy Activiti Engine in our osgi container (Felix, I suppose) but for now we need to test the powerfull of Activiti in Osgi so we choose to try it in karaf as in your book described.

You'll soon hear from me on the outcome.
Thank you very much for the support.
Best Regards.
Gaetano
Hi Gaetano,

I also downloaded the latest Karaf version and I get the same error message.
There seems to be an issue with the XPathFactory resolving and I also found an issue in the Karaf JIRA related to that (KARAF-1334).
But I can also confirm that the example works on the previous version of Karaf (version 2.2.8).
Maybe you can use the 2.2.8 release for now? I'll see if we can resolve the issue with the 2.3.0 release.

Best regards,