# OSGi - InputStream cannot be null

**URL:** <https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438>\
**Category:** Flowable Engine\
**Created:** [February 13, 2019, 4:07pm UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438 "2019-02-13T16:07:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bselack](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@bselack](https://forum.flowable.org/u/bselack)\
**Post date:** [February 13, 2019, 4:07pm UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438/1 "2019-02-13T16:07:12Z")

</div>

I am using this in a Felix container (Liferay Portal) I’ve got all the modules deployed (including the flowable osgi) when I deploy my code to make the database connection. I get this error. I’ve seen it in the forum older posts. I am on 6.4.1, so those post solutions should already be in the 6.4.1 release.

Any thoughts?

The code where it happens:

ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()  
.setJdbcUrl(“jdbc:postgresql://localhost:5432/flowable”)  
.setJdbcUsername(“name”)  
.setJdbcPassword(“password”)  
.setJdbcDriver(“org.postgresql.Driver”)  
.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB\_SCHEMA\_UPDATE\_TRUE);

processEngine = cfg.buildProcessEngine(); (error is here)

```
org.osgi.framework.BundleException: Exception in com.xxx.FlowableEngineActivator.start() of bundle flowable.engine.activate.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:795)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:951)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:328)
	at org.eclipse.osgi.container.Module.doStart(Module.java:566)
	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
	at org.apache.felix.gogo.command.Basic.start(Basic.java:729)
	at sun.reflect.GeneratedMethodAccessor518.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
	at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
	at org.apache.felix.gogo.shell.Console.run(Console.java:62)
	at org.apache.felix.gogo.shell.Shell.console(Shell.java:203)
	at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:128)
	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 org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
	at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
	at org.eclipse.equinox.console.telnet.TelnetConnection.run(TelnetConnection.java:94)
Caused by: java.lang.IllegalArgumentException: InputStream cannot be null
	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:117)
	at org.flowable.common.engine.impl.AbstractEngineConfigurator.registerCustomMybatisMappings(AbstractEngineConfigurator.java:106)
	at org.flowable.common.engine.impl.AbstractEngineConfigurator.beforeInit(AbstractEngineConfigurator.java:50)
	at org.flowable.common.engine.impl.AbstractEngineConfiguration.configuratorsBeforeInit(AbstractEngineConfiguration.java:880)
	at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:928)
	at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:903)
	at com.xxx.FlowableUtil.startFlowable(FlowableUtil.java:30)
	at com.xxx.FlowableEngineActivator.start(FlowableEngineActivator.java:18)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)
	... 34 more
java.lang.IllegalArgumentException: InputStream cannot be null
```

---

<div class="post-metadata">

**Author:** ![bselack](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@bselack](https://forum.flowable.org/u/bselack)\
**Post date:** [February 14, 2019, 3:43pm UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438/2 "2019-02-14T15:43:39Z")

</div>

It seems the issue here is also a classloader issue:

in AbstractEngineConfigurator.registerCustomMybatisMappings

ClassLoader classLoader = engineConfiguration.getClassLoader();

returns null, so the current classloader is used (AbstractEngineConfigurator)

---

<div class="post-metadata">

**Author:** ![bselack](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@bselack](https://forum.flowable.org/u/bselack)\
**Post date:** [May 2, 2019, 7:27pm UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438/3 "2019-05-02T19:27:24Z")

</div>

Issue still remains with 6.4.2.7. Making it unusable for me in the osgi container.

when executing:

ProcessEngineConfiguration cfg = new StandaloneProcessEngineConfiguration();  
processEngine = cfg.buildProcessEngine(); (error here)

StandaloneProcessEngineConfiguration:886] Found 1 Engine Configurators in total:  
[StandaloneProcessEngineConfiguration:888] class org.flowable.idm.engine.configurator.IdmEngineConfigurator (priority:100000)  
[StandaloneProcessEngineConfiguration:914] Executing beforeInit() of class org.flowable.idm.engine.configurator.IdmEngineConfigurator (priority:100000)  
[BundleStartStopLogger:38] STOPPED flowable.engine.activate\_1.0.0 [567]

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [May 7, 2019, 3:32pm UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438/4 "2019-05-07T15:32:57Z")

</div>

Hey @bselack,

I think that we fixed this. Have you seen [this](https://forum.flowable.org/t/classloading-issues-running-flowable-6-4-0-on-karaf/2964/21) thread as well?

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![bselack](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@bselack](https://forum.flowable.org/u/bselack)\
**Post date:** [May 7, 2019, 7:50pm UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438/5 "2019-05-07T19:50:57Z")

</div>

I saw that thread some time back. But as I stated, I checked out and built 6.4.2.7 and the issue still persists.

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [May 8, 2019, 6:20am UTC](https://forum.flowable.org/t/osgi-inputstream-cannot-be-null/3438/6 "2019-05-08T06:20:32Z")

</div>

Have you tried with building master and checking there? If that doesn’t work, perhaps you can create an example repo that demonstrates the problem so we can play around with it and have a look.
