Hi all,
I am seeing a significant amount of following stacktraces reported by our
users. they seem to go away with restarting, so it looks like a leak or
race condition to me:
java.lang.NullPointerException
at java.io.FileOutputStream.<init>(FileOutputStream.java:203)[:1.8.0_72]
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)[:1.8.0_72]
at
org.apache.karaf.features.internal.osgi.Activator$1.getOutputStream(Activator.java:197)[7:org.apache.karaf.features.core:4.0.4]
at
org.apache.karaf.features.internal.service.StateStorage.save(StateStorage.java:56)[7:org.apache.karaf.features.core:4.0.4]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.saveState(FeaturesServiceImpl.java:297)[7:org.apache.karaf.features.core:4.0.4]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.saveState(FeaturesServiceImpl.java:1154)[7:org.apache.karaf.features.core:4.0.4]
at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:764)[7:org.apache.karaf.features.core:4.0.4]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1089)[7:org.apache.karaf.features.core:4.0.4]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:985)[7:org.apache.karaf.features.core:4.0.4]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_72]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_72]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_72]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_72]
the NPE is caused by bundleContex.getDataFile(state.json) returning null.
The javadoc says that this could be possible, but because it works most of
the time I speculate this might be actally a race condition, or maybe
leaked filehandles somewhere.
Anybody got pointers or ideas?
I am willing to make a fix, but I need to understand this more
Fabian