Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowed an option for setting useNoOpPosixApi #24

Closed
RobAustin opened this issue Mar 29, 2023 · 1 comment
Closed

Allowed an option for setting useNoOpPosixApi #24

RobAustin opened this issue Mar 29, 2023 · 1 comment
Assignees

Comments

@RobAustin
Copy link
Member

RobAustin commented Mar 29, 2023

Allow for POSIX to be set up by the user with NoOpPosixApi, then use that rather than throwing an exception.

Currently; if POSIX can not be loaded; then a warning is logged with an exception, even if the user does not wish to use Posix, they receive the exception below.

Please, provide a mechanism to opt out of using POSIX, if they wish, as this is currently loaded on Jvm .

WARN  n.o.posix.internal.PosixAPIHolder - Unable to load JNRPosixAPI
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
        at jnr.ffi.provider.InvalidRuntime.newLoadError(InvalidRuntime.java:102)
        at jnr.ffi.provider.InvalidRuntime.getMemoryManager(InvalidRuntime.java:53)
        at jnr.ffi.Pointer.wrap(Pointer.java:48)
        at net.openhft.posix.internal.jnr.JNRPosixAPI.<clinit>(JNRPosixAPI.java:27)
        at net.openhft.posix.internal.PosixAPIHolder.<clinit>(PosixAPIHolder.java:16)
        at net.openhft.posix.PosixAPI.posix(PosixAPI.java:18)
        at net.openhft.chronicle.core.Bootstrap.<clinit>(Bootstrap.java:58)
        at net.openhft.chronicle.core.Jvm.<clinit>(Jvm.java:90)
        at com.gs.<...>
Caused by: java.lang.UnsatisfiedLinkError: could not get native definition for type `POINTER`, original error message follows: java.lang.UnsatisfiedLinkError: could not locate stub library in jar file.  Tried [jni/x86_64-Linux/libjffi-1.2.so, /jni/x86_64-Linux/libjffi-1.2.so]
        at com.kenai.jffi.internal.StubLoader.getStubLibraryStream(StubLoader.java:577)
        at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:432)
        at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:326)
        at com.kenai.jffi.internal.StubLoader.<clinit>(StubLoader.java:614)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at com.kenai.jffi.Init.load(Init.java:68)
        at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:50)
        at com.kenai.jffi.Foreign$InstanceHolder.<clinit>(Foreign.java:46)
        at com.kenai.jffi.Foreign.getInstance(Foreign.java:104)
        at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242)
        at com.kenai.jffi.Type$Builtin.getTypeInfo(Type.java:237)
        at com.kenai.jffi.Type.resolveSize(Type.java:155)
        at com.kenai.jffi.Type.size(Type.java:138)
        at jnr.ffi.provider.jffi.NativeRuntime$TypeDelegate.size(NativeRuntime.java:198)
        at jnr.ffi.provider.AbstractRuntime.<init>(AbstractRuntime.java:48)
        at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:77)
        at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:49)
        at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:73)
        at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:60)
        at jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
        at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
        at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
        at net.openhft.posix.internal.jnr.JNRPosixAPI.<clinit>(JNRPosixAPI.java:24)
        at net.openhft.posix.internal.PosixAPIHolder.<clinit>(PosixAPIHolder.java:16)
        at net.openhft.posix.PosixAPI.posix(PosixAPI.java:18)
        at net.openhft.chronicle.core.Bootstrap.<clinit>(Bootstrap.java:58)
        at net.openhft.chronicle.core.Jvm.<clinit>(Jvm.java:90)
        at com.***.<…>
@RobAustin RobAustin self-assigned this Mar 29, 2023
@RobAustin RobAustin changed the title Allow for posix to be set up by the user with NoOpPosixApi, then use that rather than throwing an exception Allowed an option for setting useNoOpPosixApi Mar 29, 2023
RobAustin added a commit that referenced this issue Mar 29, 2023
Co-authored-by: Rob Austin <rob.austin@boundedbuffer.co.uk>
@hft-team-city
Copy link
Collaborator

Released in Posix-2.24ea5, BOM-2.24ea50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants