Allowed an option for setting useNoOpPosixApi
RobAustin opened this issue · 1 comments
RobAustin commented
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.***.<…>
hft-team-city commented
Released in Posix-2.24ea5, BOM-2.24ea50