You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running in the Equinox OSGi environment (in our case as an Eclipse Plugin), attempting to using any of the POSIX functions results in only the JavaPOSIX being presented via the POSIXFactory.getPOSIX() method.
The following exception is noted on attempting to load one of the native POSIX implementations:
BundleLoader[com.github.jnr.posix_3.0.49].findClassInternal(jnr.ffi.provider.jffi.NativeClosureProxy)
BundleLoader[com.github.jnr.posix_3.0.49].findLocalClass(jnr.ffi.provider.jffi.NativeClosureProxy)
ModuleClassLoader[com.github.jnr.posix_3.0.49 - /opt/plugins/com.github.jnr.posix_3.0.49.jar].findClassImpl(jnr.ffi.provider.jffi.NativeClosureProxy)
ModuleClassLoader[com.github.jnr.posix_3.0.49].loadClass(jnr.ffi.provider.jffi.NativeClosureProxy) failed.
java.lang.ClassNotFoundException: jnr.ffi.provider.jffi.NativeClosureProxy cannot be found by com.github.jnr.posix_3.0.49
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
The root cause is missing required import packages in the manifest.
Which is missing a number of packages that jnr-posix relies on. I suspect this is due to bnd (which the maven bundle plugin uses to create the bundle entries) is failing to recognise their usage due to the amount of reflection that jnr in general uses. (Something that is common with libraries that use lots of reflection or direct class loading).
One solution we've come up with is to replace the notation in the POM, with < Require-Bundle >{all dependencies} < /Require-Bundle > as a workaround. However, since Require-Bundle is discouraged in OSGi, I'm hesitant to share this.
The other solution is to define DynamicImport-Package: * in the manifest which with limited testing worked as well...
Another possible solution mentioned by another team member (in the office) was to create a jnr-osgi bundle that includes all JNR projects in a single bundle, that exports all packages?
The text was updated successfully, but these errors were encountered:
When running in the Equinox OSGi environment (in our case as an Eclipse Plugin), attempting to using any of the POSIX functions results in only the JavaPOSIX being presented via the POSIXFactory.getPOSIX() method.
The following exception is noted on attempting to load one of the native POSIX implementations:
The root cause is missing required import packages in the manifest.
The manifest with jnr-posix 3.0.49 notes:
Which is missing a number of packages that jnr-posix relies on. I suspect this is due to bnd (which the maven bundle plugin uses to create the bundle entries) is failing to recognise their usage due to the amount of reflection that jnr in general uses. (Something that is common with libraries that use lots of reflection or direct class loading).
One solution we've come up with is to replace the notation in the POM, with < Require-Bundle >{all dependencies} < /Require-Bundle > as a workaround. However, since Require-Bundle is discouraged in OSGi, I'm hesitant to share this.
The other solution is to define
DynamicImport-Package: *
in the manifest which with limited testing worked as well...Another possible solution mentioned by another team member (in the office) was to create a jnr-osgi bundle that includes all JNR projects in a single bundle, that exports all packages?
The text was updated successfully, but these errors were encountered: