Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orbit-dev] Problem with com.github.jnr.posix provided through Orbit

On 6/29/21 6:35 PM, Roland Grunberg wrote:
> I ran into this a while ago when first creating the stack in OSGi. I
> opted to do a Require-Bundle on those used through reflection :
> 
> https://git.eclipse.org/c/orbit/orbit-recipes.git/tree/github/jnr/com.github.jnr.unixsocket_0.28.0/osgi.bnd
> 
> I suspect the same approach is probably needed for jnr.posix. If adding
> those lines for Require-Bundle fixes things, we can probably update the
> package. If you can create a patch for this on 
> https://git.eclipse.org/r/q/project:orbit%252Forbit-recipes+status:open
> that would be great. Otherwise, I can probably quickly make one but I'd
> just need to know if the result fixes things.
> 
> 
> Cheers,
> 

Hey Roland, thank you for your quick reply!

Your suggestion sadly doesn't fix the issue.

I explicitly added the dependencies to the target platform:

		<location includeAllPlatforms="false" includeConfigurePhase="true"
includeMode="planner" includeSource="true" type="InstallableUnit">
			<repository
location="https://download.eclipse.org/tools/orbit/downloads/drops/R20210602031627/repository"/>
			<unit id="com.github.jnr.ffi" version="2.1.12.v20200513-1859"/>
			<unit id="com.github.jnr.jffi" version="1.2.23.v20200501-1917"/>
			<unit id="com.github.jnr.posix" version="3.0.54.v20200501-1917"/>
			<unit id="com.github.jnr.jffi.native" version="1.2.23.v20200501-1917"/>
		</location>

MANIFEST.MF:

	Require-Bundle:
	com.github.jnr.ffi,com.github.jnr.jffi,
	com.github.jnr.posix

Could it be possible that I also would need to require
com.github.jnr.jffi.native?
While I can add com.github.jnr.jffi.native to my target platform,
an explicit require in the MANIFEST.MF fails (Unsatisfied version
constraint: 'com.github.jnr.jffi.native: 0.0.0').

So the exception still is:

	Caused by: java.lang.ClassNotFoundException:
jnr.ffi.provider.jffi.NativeClosureProxy
			at java.base/java.lang.ClassLoader.findClass(ClassLoader.java:719)
			at jnr.ffi.provider.jffi.AsmClassLoader.findClass(AsmClassLoader.java:51)
			at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
			at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
			... 73 more

Greetings, Fabian


Back to the top