Reputation: 110
I am developing an OSGi plugin to be used on our Domino 9.0.1 FP8 server. Since the server has support for Java 8 and I have some Java 8 code, I added:
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
in the MANIFEST.MF
.
However, when I try to load the plugin, it remains stuck in the INSTALLED
state:
tell http osgi ss com.test.api.plugin
Framework is launched.
id State Bundle
19 INSTALLED com.test.api.plugin_0.1.0.201706241509
Running diagnostics reveals that the execution environment is not available:
tell http osgi diag com.test.api.plugin
initial@osginsf:apps.nsf/0D3C92BFD9106A9DC125814900535ABD/com.test.api.plugin_0.1.0.201706241509.jar [19]
Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Just to be sure, I double-checked the Java version:
show jvm
JVM: Java Virtual Machine initialized.
Java runtime version: pwa6480sr3fp22-20161213_02 (SR3 FP22)
JVM version: JRE 1.8.0 Windows 8 amd64-64 Compressed References 20161209_329148 (JIT enabled, AOT enabled) J9VM - R28_20161209_1345_B329148 JIT - tr.r14.java.green_20161207_128946 GC - R28_20161209_1345_B329148_CMPRSS J9CL - 20161209_329148
So, everything seems to be in order, but the plugin won't load.
If I change the required execution environment to JavaSE-1.6 or if I remove the line from MANIFEST.MF
, the plugin loads and works just fine.
My temporary solution is to remove the line completely from the MANIFEST.MF
since Java 8 code won't compile if I change execution environment to JavaSE-1.6.
So I have a working solution, but I would like to know what the problem is and if there is a better way to solve it.
Another thing I noticed: I usually use Maven for building plugins, but if I try to export the plugin from Eclipse using Export > Deployable plug-ins and fragments
, I get the following error:
Missing Constraint: Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Host plug-in JavaSE_0.0.0 has not been found.
Switching to JavaSE-1.6 helps even here and the plugin gets exported correctly.
Could this be an OSGi version issue instead of a Java issue?
I seem to remember that there should be an OSGi update in FP9. Is there a chance that this will be solved then?
Upvotes: 0
Views: 330
Reputation: 4471
To my knowledge, the reason for this is indeed what you mentioned towards the end: it's the OSGi stack. Though the underlying runtime is Java 8, IBM didn't update the OSGi stack at all (barring anything that would have been required, I guess), and that includes it not knowing that it's on a Java 8 runtime. Assuming that FP9 does indeed arrive with the OSGi update, that should presumably clean it up.
In the mean time, I've been doing the same thing you did: remove the line from the manifest and just deal with the warning (and I use a Maven build to generate the update site all the time out of habit, so didn't hit the second error).
Upvotes: 1