Fork me on GitHub
#luminus
<
2019-04-04
>
tobias15:04:56

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.

yogthos16:04:27

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

tobias18:04:00

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

tobias18:04:23

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!

tobias18:04:06

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

tobias18:04:34

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.

tobias18:04:08

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.

yogthos18:04:56

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

yogthos19:04:48

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

tobias19:04:30

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