# Classloading issues running flowable 6.4.0 on Karaf

**URL:** <https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964>\
**Category:** Flowable Engine\
**Created:** [November 29, 2018, 8:43am UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964 "2018-11-29T08:43:23Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![donkon](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@donkon](https://forum.flowable.org/u/donkon)\
**Post date:** [January 28, 2019, 12:08pm UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/21 "2019-01-28T12:08:06Z")

</div>

@tijs I updated my example to flowable 6.4.1 but the problem is stell present

---

<div class="post-metadata">

**Author:** ![donkon](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@donkon](https://forum.flowable.org/u/donkon)\
**Post date:** [February 14, 2019, 7:40am UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/22 "2019-02-14T07:40:14Z")

</div>

@tijs When I change the classloading behaviour in org.flowable.common.engine.impl.javax.el.ExpressionFactory (line 112) from

`classLoader = Thread.currentThread().getContextClassLoader();`

to

`classLoader = ExpressionFactory.class.getClassLoader();`

everthing works as expected. Is there any chance to get rid of the ContextClassLoader?

---

<div class="post-metadata">

**Author:** ![donkon](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@donkon](https://forum.flowable.org/u/donkon)\
**Post date:** [March 11, 2019, 8:59am UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/23 "2019-03-11T08:59:44Z")

</div>

I came around this issue by setting the ContextClassloader in a CommandInterceptor:

> **[setting contextClassLoader (a37c2bc0) · Commits · Björn Konrad /...](https://gitlab.com/donkon/flowable-karaf-demo/commit/a37c2bc0bff4e3caad2d246891c9ef24a8a69626)**
>
> Running Flowable BPMN with Apache Karaf

Ideally, the org.flowable.osgi.blueprint.ProcessEngineFactory.init() Method would do this, so this issue would be solved for everybody using OSGi

---

<div class="post-metadata">

**Author:** ![donkon](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@donkon](https://forum.flowable.org/u/donkon)\
**Post date:** [February 3, 2020, 11:47am UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/24 "2020-02-03T11:47:38Z")

</div>

As I encountered classloading problems again when using flowable 6.5.0 with Karaf, I tried a different approach and [got it running by embedding the flowable libraries](https://gitlab.com/donkon/flowable-karaf-demo/commit/9627c20437ee9d5f858483d510899e8a2383a784) in one fat jar.

Otherwise, flowable is complaining, that resources (ibatis xml config files) can not be loaded.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [February 4, 2020, 8:21pm UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/25 "2020-02-04T20:21:06Z")

</div>

Interesting. Is there any change in 6.5.0 that caused the classloading problems? Maybe we can amend them.

---

<div class="post-metadata">

**Author:** ![donkon](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@donkon](https://forum.flowable.org/u/donkon)\
**Post date:** [February 6, 2020, 1:51pm UTC](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/26 "2020-02-06T13:51:20Z")

</div>

Yes, it’s very likely, that a change in 6.5.0 causes this error (bundle import statements, so that resources from bundle B can be seen by bundle A).

So, if you say, that flowable should support an OSGi environment like Apache Karaf, it would be helpful, that flowable maintains a “karaf-feature” module and ensures, that a processEngine can be bootstrapped with the flowable bundles provided by this feature.

I know, that spring boot is very popular and fits perfect for most people, but I think, Apache Karaf is also a great runtime environment, espacially if workflows rely on many different modules in one runtime.

[Previous page](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964.md?page=1)
