luminus

tobias 2019-04-04T15:37:56.002300Z

Does anyone know if it's possible to connect to remote nREPL when a Luminus app is deployed as a WAR on Tomcat? I haven't been able to get it working.

yogthos 2019-04-04T16:28:27.003Z

the nREPL should get started when the :nrepl-port config variable is present in the environment

tobias 2019-04-04T18:45:00.004700Z

Thanks @yogthos the NREPL_PORT environment variable is set and I know that the app can see it (I made a route that prints the port number just to check) but when I try to connect I get an error

tobias 2019-04-04T18:45:23.005Z

lein repl :connect 7001
Warning: implicit middleware found: ultra.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Connecting to nREPL at 127.0.0.1:7001
SocketException Connection reset
	java.net.SocketInputStream.read (SocketInputStream.java:210)
	java.net.SocketInputStream.read (SocketInputStream.java:141)
	java.io.BufferedInputStream.fill (BufferedInputStream.java:246)
	java.io.BufferedInputStream.read (BufferedInputStream.java:265)
	java.io.FilterInputStream.read (FilterInputStream.java:83)
	java.io.PushbackInputStream.read (PushbackInputStream.java:139)
	bencode.core/read-byte (core.clj:87)
	bencode.core/read-byte (core.clj:-1)
	bencode.core/read-token (core.clj:239)
	bencode.core/read-token (core.clj:237)
	bencode.core/read-bencode (core.clj:257)
	bencode.core/read-bencode (core.clj:254)
Bye for now!

tobias 2019-04-04T18:54:06.006600Z

I think maybe Tomcat doesn't allow servlets to access ports directly, but I don't understand enough about how it works.

tobias 2019-04-04T18:56:34.008400Z

As another alternative, does Drawbridge work with Luminus? I tried setting it up by making a /repl route and wrapping it in the required middleware but couldn't get it working.

tobias 2019-04-04T18:59:08.010400Z

Luminus is amazing by the way. Would have taken me ages to piece all the libraries together. It's brilliant to have something that works right away without a ton of initial decisions to make.

yogthos 2019-04-04T18:59:56.011Z

hmm yeah I haven't used app servers in years myself, so it's possible that tomcat has some additional policy

yogthos 2019-04-04T19:00:48.011400Z

drawbridge should work, but again haven't actually tried it myself

tobias 2019-04-04T19:15:30.013400Z

OK I'll have another go at drawbridge. Will let you know if I get it working.

yogthos 2019-04-04T20:23:23.013600Z

👍