alecalve / c-lightning-http-rpc

JSON RPC HTTP proxy to c-lightning's unix socket based interface.
Apache License 2.0
7 stars 7 forks source link

Could not determine java version from '10.0.1' #5

Open JohnnyBackflip opened 6 years ago

JohnnyBackflip commented 6 years ago

Hey,

I installed Ubuntu 18.04 on my pc and after that Java OpenJDK 11 as it's described here , then I got this Error when trying to build the Project:

sudo ./gradlew build -debug 12:58:12.492 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform is not available. 12:58:12.516 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: /root/.gradle/native 12:58:12.573 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 12:58:12.575 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception. 12:58:12.577 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 12:58:12.578 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] What went wrong: 12:58:12.583 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not determine java version from '10.0.1'. 12:58:12.585 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 12:58:12.586 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Try: 12:58:12.588 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.

alecalve commented 6 years ago

It might be that the wrapper is too old to support JDK 10, you should try using gradle directly:

gradle build
JohnnyBackflip commented 6 years ago

Thanks this worked, it starts now but says

curl: (7) Failed to connect to localhost port 8080: Connection refused

when I'm trying the curl example:

sudo curl -XPOST http://localhost:8080/ -d '{"method": "listpeers", "id": 1, "params": {}, "jsonrpc": "2.0"}'

alecalve commented 6 years ago

Are you running the JAR file?

java -jar build/libs/c-lightning-http-rpc-0.1.0.jar -c ~/.lightning/lightning-rpc

You also need to be sure that ~/.lightning/lightning-rpc actually points to the socket file.

JohnnyBackflip commented 6 years ago

I'm doing this because the jar has a different name:

sudo java -jar build/libs/c-lightning-http-rpc-0.1.1-SNAPSHOT.jar -c ~/.lightning/lightning-rpc

~/.lightning/lightning-rpc seems to be be correct

alecalve commented 6 years ago

What's the output you get from running the JAR and running a query against it?

JohnnyBackflip commented 6 years ago

So it turns out that I just confused 2 terminals... When use the correct one I get this error:

sudo java -jar build/libs/c-lightning-http-rpc-0.1.1-SNAPSHOT.jar -c ~/.lightning/lightning-rpc Jun 26, 2018 2:02:58 PM org.xnio.Xnio INFO: XNIO version 3.3.8.Final Jun 26, 2018 2:02:59 PM org.xnio.nio.NioXnio INFO: XNIO NIO Implementation Version 3.3.8.Final WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/root/c-lightning-http-rpc/build/libs/c-lightning-http-rpc-0.1.1-SNAPSHOT.jar) to constructor sun.nio.ch.EPollSelectorProvider() WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Jun 26, 2018 2:03:01 PM io.undertow.server.Connectors executeRootHandler ERROR: UT005071: Undertow request failed HttpServerExchange{ POST / request {Accept=[/], Content-Length=[64], Content-Type=[application/x-www-form-urlencoded], User-Agent=[curl/7.58.0], Host=[localhost:8080]} response {}} java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider at jnr.ffi.provider.InvalidRuntime.newLoadError(InvalidRuntime.java:101) at jnr.ffi.provider.InvalidRuntime.findType(InvalidRuntime.java:42) at jnr.ffi.Struct$NumberField.(Struct.java:872) at jnr.ffi.Struct$Unsigned16.(Struct.java:1240) at jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:209) at jnr.unixsocket.SockAddrUnix.create(SockAddrUnix.java:174) at jnr.unixsocket.UnixSocketAddress.(UnixSocketAddress.java:47) at info.p2sh.clightning.rpc.RpcClient.sendRequest(RpcClient.kt:37) at info.p2sh.clightning.http.JsonRpcHandler.handleRequest(JsonRpcHandler.kt:58) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844) Caused by: java.lang.ExceptionInInitializerError at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58) at jnr.ffi.provider.jffi.Provider.(Provider.java:29) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) at java.base/java.lang.Class.newInstance(Class.java:560) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57) at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35) at jnr.ffi.Runtime$SingletonHolder.(Runtime.java:82) at jnr.ffi.Runtime.getSystemRuntime(Runtime.java:67) at jnr.unixsocket.SockAddrUnix.(SockAddrUnix.java:46) at jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:208) ... 9 more Caused by: java.lang.IllegalStateException: Can't overwrite cause with java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi11759138478464691086.so: /tmp/jffi11759138478464691086.so: cannot open shared object file: No such file or directory at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2424) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2481) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2678) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2611) at java.base/java.lang.Runtime.load0(Runtime.java:814) at java.base/java.lang.System.load(System.java:1838) at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371) at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258) at com.kenai.jffi.internal.StubLoader.(StubLoader.java:444) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:374) at com.kenai.jffi.Init.load(Init.java:68) at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) 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:187) at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:66) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41) at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:62) at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58) at jnr.ffi.provider.jffi.Provider.(Provider.java:29) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) at java.base/java.lang.Class.newInstance(Class.java:560) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57) at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35) at jnr.ffi.Runtime$SingletonHolder.(Runtime.java:82) at jnr.ffi.Runtime.getSystemRuntime(Runtime.java:67) at jnr.unixsocket.SockAddrUnix.(SockAddrUnix.java:46) at jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:208) at jnr.unixsocket.SockAddrUnix.create(SockAddrUnix.java:174) at jnr.unixsocket.UnixSocketAddress.(UnixSocketAddress.java:47) at info.p2sh.clightning.rpc.RpcClient.sendRequest(RpcClient.kt:37) at info.p2sh.clightning.http.JsonRpcHandler.handleRequest(JsonRpcHandler.kt:58) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844) at java.base/java.lang.Throwable.initCause(Throwable.java:462) at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:252) 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:187) at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:66) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41) at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:62) ... 23 more Caused by: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi11759138478464691086.so: /tmp/jffi11759138478464691086.so: cannot open shared object file: No such file or directory at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2424) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2481) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2678) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2611) at java.base/java.lang.Runtime.load0(Runtime.java:814) at java.base/java.lang.System.load(System.java:1838) at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371) at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258) at com.kenai.jffi.internal.StubLoader.(StubLoader.java:444) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:374) at com.kenai.jffi.Init.load(Init.java:68) at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) 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:187) at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:66) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41) at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:62) at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58) at jnr.ffi.provider.jffi.Provider.(Provider.java:29) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) at java.base/java.lang.Class.newInstance(Class.java:560) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57) at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35) at jnr.ffi.Runtime$SingletonHolder.(Runtime.java:82) at jnr.ffi.Runtime.getSystemRuntime(Runtime.java:67) at jnr.unixsocket.SockAddrUnix.(SockAddrUnix.java:46) at jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:208) at jnr.unixsocket.SockAddrUnix.create(SockAddrUnix.java:174) at jnr.unixsocket.UnixSocketAddress.(UnixSocketAddress.java:47) at info.p2sh.clightning.rpc.RpcClient.sendRequest(RpcClient.kt:37) at info.p2sh.clightning.http.JsonRpcHandler.handleRequest(JsonRpcHandler.kt:58) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844) at com.kenai.jffi.Foreign.newLoadError(Foreign.java:72) at com.kenai.jffi.Foreign.access$300(Foreign.java:42) at com.kenai.jffi.Foreign$InValidInstanceHolder.getForeign(Foreign.java:98) at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) at com.kenai.jffi.Type$Builtin.lookupTypeInfo(Type.java:242) ... 31 more Caused by: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi11759138478464691086.so: /tmp/jffi11759138478464691086.so: cannot open shared object file: No such file or directory at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2424) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2481) at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2678) at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2611) at java.base/java.lang.Runtime.load0(Runtime.java:814) at java.base/java.lang.System.load(System.java:1838) at com.kenai.jffi.internal.StubLoader.loadFromJar(StubLoader.java:371) at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:258) at com.kenai.jffi.internal.StubLoader.(StubLoader.java:444) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:374) at com.kenai.jffi.Init.load(Init.java:68) at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) at com.kenai.jffi.Foreign.getInstance(Foreign.java:103) 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:187) at jnr.ffi.provider.AbstractRuntime.(AbstractRuntime.java:48) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:66) at jnr.ffi.provider.jffi.NativeRuntime.(NativeRuntime.java:41) at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.(NativeRuntime.java:62) at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:58) at jnr.ffi.provider.jffi.Provider.(Provider.java:29) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) at java.base/java.lang.Class.newInstance(Class.java:560) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68) at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.(FFIProvider.java:57) at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35) at jnr.ffi.Runtime$SingletonHolder.(Runtime.java:82) at jnr.ffi.Runtime.getSystemRuntime(Runtime.java:67) at jnr.unixsocket.SockAddrUnix.(SockAddrUnix.java:46) at jnr.unixsocket.SockAddrUnix$DefaultSockAddrUnix.(SockAddrUnix.java:208) at jnr.unixsocket.SockAddrUnix.create(SockAddrUnix.java:174) at jnr.unixsocket.UnixSocketAddress.(UnixSocketAddress.java:47) at info.p2sh.clightning.rpc.RpcClient.sendRequest(RpcClient.kt:37) at info.p2sh.clightning.http.JsonRpcHandler.handleRequest(JsonRpcHandler.kt:58) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:336) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:844) at com.kenai.jffi.internal.StubLoader.load(StubLoader.java:270) at com.kenai.jffi.internal.StubLoader.(StubLoader.java:444) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:374) at com.kenai.jffi.Init.load(Init.java:68) at com.kenai.jffi.Foreign$InstanceHolder.getInstanceHolder(Foreign.java:49) at com.kenai.jffi.Foreign$InstanceHolder.(Foreign.java:45) ... 33 more

alecalve commented 6 years ago

Hum, this seems to be quite a hairy one:

Caused by: java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi11759138478464691086.so: /tmp/jffi11759138478464691086.so: cannot open shared object file: No such file or directory

I've run it on a Ubuntu variant with no issues, I don't really know what's wrong here.