OSGi - InputStream cannot be null

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

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)

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]

Hey @bselack,

I think that we fixed this. Have you seen this thread as well?

Cheers,
Filip

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.

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.