3

I am developing a Java application to run it on a raspberry pi. My development environment is IntelliJ with Embedded Linux JVM Debugger plugin installed on a Windows 10 Pro laptop. I can debug the application on my machine. I added a configuration to deploy the application to a "local" raspberry via Ethernet connection on a private network. I can deploy and debug the application correctly.

Now I need to do the same on a remote raspberry in the customer's facilities. I added a configuration with remote raspberry's IP address, username, password and run as sudo checked. Clicking Validate Connection button, the response is Connection Success. But if I want to debug with this configuration, I get this error in console window:

Cannot connect to the Embedded System Target java.io.IOException: inputstream is closed

Process finished with exit code -1

I can connect to the remote raspberry using SSH. This raspberry is working with Raspbian GNU/Linux 9 (Kernel: Linux 4.9.41-v7+). I tried rebooting, and it does not resolve the problem.

Do you know why I can not debug the application?

Jon
  • 891
  • 13
  • 32
  • 2
    did you put the jvm args for remote debugging? like ``-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y``? – spi May 23 '19 at 07:39
  • 1
    Port / Proxy issue maybe? – Lino May 23 '19 at 07:40
  • @Lino, the remote raspberry is using USB modem, so I don't think that it is a proxy problem. – Jon May 23 '19 at 08:00
  • @sip, no, I didn't put any arguments. Do I have to write your line in **Program Arguments** field? What does `address=8000` mean? – Jon May 23 '19 at 08:03
  • @Jon no, you have to put it on the raspberry, in the jvm arguments (don't know if you are doing standard java, tomcat, or anything else), to activate remote debugging in the jvm running on the raspberry - I neither know if your intellij plugin can do such thing. 8000 is the TCP port for the remote debugger to connect to the raspberry. – spi May 23 '19 at 08:08
  • More infos about how the remote debugging feature works in java: https://stackoverflow.com/questions/975271/remote-debugging-a-java-application – spi May 23 '19 at 08:12
  • @spi, I'm developing standard java (console?) application. I ran the `java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y` and the command line showed me `Listening for transport dt_socket at address: 8000`, but the problem persists. I have to press Control+C to exit. The strange thing is that I can run the app on my "local" raspberry without doing anything. – Jon May 23 '19 at 08:49
  • @Jon ``suspend=y`` makes the JVM wait for the debugger before going ahead. That allows you to have time to connect a debugger, to debug the very beginning of the startup (else you would have no chance to connect prior the execution of the first statement). ``Listening for transport dt_socket at address: 8000`` is the way the JVM tell you "_I'm ready, waiting for you._" – spi May 23 '19 at 09:07
  • @spi thank you for your time, but I couldn't solve the problem :( – Jon May 23 '19 at 09:46
  • @Jon keep explaining what you are facing... it should be quite trivial to make it work. I do it a few dozen time each week... – spi May 23 '19 at 09:49
  • @spi I don't know what more can I explain. As you say, "local" raspberry debugging is very easy, but I don't know why "remote" debugging doesn't work. – Jon May 23 '19 at 10:18
  • 1. add the arguments to the jvm on the raspberry and start the app 2. use the debug feature on Intellij with raspberry's correct ip address and port 3. enjoy. If it doesn't work, maybe the port on the raspberry is locked (look at ``iptables -L`` to see if some rules are enabled and act accordingly) – spi May 23 '19 at 11:00

0 Answers0