Fork me on GitHub
#aleph
<
2019-01-11
>
kwladyka12:01:07

((:close foo))

Jan 11, 2019 1:16:20 PM io.netty.util.concurrent.DefaultPromise notifyListener0
WARNING: An exception was thrown by aleph.netty$wrap_future$reify__16507.operationComplete()
java.lang.ExceptionInInitializerError
	at manifold.deferred.Deferred.success(deferred.clj:398)
	at manifold.deferred$success_BANG_.invokeStatic(deferred.clj:243)
	at manifold.deferred$success_BANG_.invoke(deferred.clj:240)
	at aleph.netty$wrap_future$reify__16507.operationComplete(netty.clj:199)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:94)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup$1.operationComplete(MultithreadEventExecutorGroup.java:117)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:33)
	at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:435)
	at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:248)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: clojure/lang/PersistentArrayMap
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at clojure.lang.RT.classForName(RT.java:2207)
	at clojure.lang.RT.classForName(RT.java:2216)
	at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:324)
	at clojure.lang.LispReader$EvalReader.invoke(LispReader.java:1322)
	at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:853)
	at clojure.lang.LispReader.read(LispReader.java:285)
	at clojure.lang.LispReader.read(LispReader.java:220)
	at clojure.lang.LispReader.access$200(LispReader.java:41)
	at clojure.lang.LispReader$MetaReader.invoke(LispReader.java:954)
	at clojure.lang.LispReader.read(LispReader.java:285)
	at clojure.lang.LispReader.readDelimitedList(LispReader.java:1398)
	at clojure.lang.LispReader$ListReader.invoke(LispReader.java:1243)
	at clojure.lang.LispReader.read(LispReader.java:285)
	at clojure.lang.LispReader.read(LispReader.java:220)
	at clojure.lang.LispReader.access$200(LispReader.java:41)
	at clojure.lang.LispReader$EvalReader.invoke(LispReader.java:1301)
	at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:853)
	at clojure.lang.LispReader.read(LispReader.java:285)
	at clojure.lang.LispReader.read(LispReader.java:216)
	at clojure.lang.LispReader.read(LispReader.java:205)
	at clojure.lang.RT.readString(RT.java:1874)
	at clojure.lang.RT.readString(RT.java:1869)
	at manifold.deferred.Deferred$fn__3629.<clinit>(deferred.clj:398)
	... 16 more
Any way to fix it?

kwladyka12:01:39

{org.clojure/clojure {:mvn/version "1.10.0"}
        yada {:mvn/version "1.2.16"}
        aleph {:mvn/version "0.4.6"}
        bidi {:mvn/version "2.1.5"}
        integrant {:mvn/version "0.7.0"}}

kwladyka12:01:26

java --version                                                                                  4.5m  Thu Dec 27 21:59:03 2018
java 11.0.1 2018-10-16 LTS

jeroenvandijk12:01:42

I wanted to ask what is in foo, but i see there is a Caused by: java.lang.ClassNotFoundException: clojure/lang/PersistentArrayMap Not sure what to do about this

kwladyka12:01:12

foo is (yada/listener handler aleph-options) which return fn to close server

jeroenvandijk12:01:38

Ah I see. I don't know sorry

kwladyka12:01:13

But as I understand it is aleph bug and this fn is what aleph return to close the server

kwladyka12:01:30

no problem, thank you for trying

kwladyka12:01:41

it could be something about java version maybe

jeroenvandijk12:01:20

You could try to start a normal aleph server and close it to see if that works? For us this works (on different clojure and java) version. But if that does work it might be yada related?

kwladyka12:01:54

hmm I have to figure out how to start / close aleph without yada 😉

kwladyka12:01:24

give me a sec

jeroenvandijk12:01:27

From the readme

(require '[aleph.http :as http])

(defn handler [req]
  {:status 200
   :headers {"content-type" "text/plain"}
   :body "hello!"})

(http/start-server handler {:port 8080})

jeroenvandijk12:01:38

I think the start-server returns that close fn

jeroenvandijk12:01:30

Oh actually not true

jeroenvandijk12:01:43

We stop it like this

:stop [server-instance (do (log/info "stopping Server on port" port)
                                (.close server-instance)
But older version maybe

kwladyka12:01:34

(defn handler [req]
  {:status 200
   :headers {"content-type" "text/plain"}
   :body "hello!"})

(def foo (http/start-server handler {:port 8080}))

(.close foo)
Jan 11, 2019 1:33:05 PM io.netty.util.concurrent.DefaultPromise notifyListener0
WARNING: An exception was thrown by aleph.netty$wrap_future$reify__16507.operationComplete()
java.lang.NoClassDefFoundError: Could not initialize class manifold.deferred.Deferred$fn__3629
	at manifold.deferred.Deferred.success(deferred.clj:398)
	at manifold.deferred$success_BANG_.invokeStatic(deferred.clj:243)
	at manifold.deferred$success_BANG_.invoke(deferred.clj:240)
	at aleph.netty$wrap_future$reify__16507.operationComplete(netty.clj:199)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
	at io.netty.util.concurrent.DefaultPromise.setSuccess(DefaultPromise.java:94)
	at io.netty.util.concurrent.MultithreadEventExecutorGroup$1.operationComplete(MultithreadEventExecutorGroup.java:117)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
	at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:33)
	at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:435)
	at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:248)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)

kwladyka12:01:13

But not sure why I have this issue and you not 🙂

kwladyka12:01:23

Can you paste your versions?

kwladyka12:01:14

Do you use Java 11?

kwladyka12:01:03

@whoneedszzz Did you have this issue ? ^

jeroenvandijk13:01:31

@kwladyka No for the app it works we are using java 8

jeroenvandijk13:01:56

and an older clojure version 1.8

kachayev13:01:01

The root cause of the issue was described here: https://github.com/ztellman/aleph/pull/425 The fix is not merged yet, updates to manifold thread factories are (but that’s just a part of the puzzle)

kwladyka13:01:36

But the point is how can I live with it today? 😉

kwladyka13:01:44

any workaround?

kwladyka13:01:56

Just It will be great to be able to reload server when developing

kwladyka13:01:08

Instead kill REPL / start REPL

kwladyka13:01:35

branch kachayev:ft-gracefull-shutdown has this bug fixed?

kachayev13:01:19

Not sure about that, I moved the fix to a separate branch on purpose (to make it easier to merge to master). Need to check if it’s still included there. In fact, you can ignore those error messages :) That’s annoying, but it does no harm to the functionality itself: it just fails to deliver notification that the operation is already completed (which means that’s the server is closed)

kwladyka13:01:26

hmm super strange thing happen. I made a break to eat dinner and now I don’t have this error

kwladyka13:01:56

thanks for info it doesn’t affect closing the server. I didn’t realise that.

kwladyka13:01:36

now I have it again wow. I changed nothing

kwladyka14:01:55

ha I found something! I will describe it in issue in +1h

whoneedszzz20:01:50

@kwladyka There's nothing wrong with the method that the yada manual describes. I'm using it right now

kwladyka21:01:00

@whoneedszzz i have this issue https://github.com/ztellman/aleph/pull/425 also when use yada directly as in the doc. But this issue appear only when you didn’t open website even once.