Hello How to debug with LOEclipse? not worked for me
My setup
Windows 10
Eclipse 2022-12 (4.26.0)
Installed latest LOEclipse plugin via Eclipse Marketplace
LibreOffice 7.4.0
Firewall and antivirus disabled, it did not help
If I use Debug As->LibreOffice Extension
configuration then LibreOffice starts successfully but only first time. If I close LibreOffice and try to run the configuration again I get Could not start remote debugger.
and Listening for remote VM connection failed
errors. Restarting Eclipse helps but only for a single run (as described above).
Using TCPView
app I noticed that eclipse.exe
process does not close port connection (it uses port 7861) after LibreOffice debug session ends, so maybe it cannot use this port again and fails.
org.eclipse.core.runtime.CoreException: Listening for remote VM connection failed
at org.eclipse.jdt.internal.launching.SocketListenConnector.abort(SocketListenConnector.java:160)
at org.eclipse.jdt.internal.launching.SocketListenConnector.connect(SocketListenConnector.java:119)
at org.libreoffice.ide.eclipse.java.Language.connectDebuggerToOffice(Unknown Source)
at org.libreoffice.ide.eclipse.core.launch.office.OfficeLaunchDelegate.launch(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:806)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:717)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1021)
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1224)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:555)
at java.base/sun.nio.ch.Net.bind(Net.java:544)
at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:629)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:393)
at java.base/java.net.ServerSocket.<init>(ServerSocket.java:275)
at java.base/java.net.ServerSocket.<init>(ServerSocket.java:168)
at org.eclipse.jdi.internal.connect.SocketTransportService.startListening(SocketTransportService.java:303)
at org.eclipse.jdi.internal.connect.SocketTransportImpl.startListening(SocketTransportImpl.java:53)
at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.startListening(SocketListeningConnectorImpl.java:141)
at org.eclipse.jdt.internal.launching.SocketListenConnector.connect(SocketListenConnector.java:115)
... 7 more
java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:555)
at java.base/sun.nio.ch.Net.bind(Net.java:544)
at java.base/sun.nio.ch.NioSocketImpl.bind(NioSocketImpl.java:629)
at java.base/java.net.ServerSocket.bind(ServerSocket.java:393)
at java.base/java.net.ServerSocket.<init>(ServerSocket.java:275)
at java.base/java.net.ServerSocket.<init>(ServerSocket.java:168)
at org.eclipse.jdi.internal.connect.SocketTransportService.startListening(SocketTransportService.java:303)
at org.eclipse.jdi.internal.connect.SocketTransportImpl.startListening(SocketTransportImpl.java:53)
at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.startListening(SocketListeningConnectorImpl.java:141)
at org.eclipse.jdt.internal.launching.SocketListenConnector.connect(SocketListenConnector.java:115)
at org.libreoffice.ide.eclipse.java.Language.connectDebuggerToOffice(Unknown Source)
at org.libreoffice.ide.eclipse.core.launch.office.OfficeLaunchDelegate.launch(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:806)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:717)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1021)
at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1224)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Session Data
eclipse.buildId=4.26.0.20221201-1200
java.version=19.0.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=ru_RU
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
I also tried proposed solution using port 8000, it did not work either giving me error Failed to connect to remote VM. Connection refused.
To do normal debug you should not press “Debug As”->“LibreOffice Extension” instead you should select the project right click and then press “Debug As”->“Debug Configurations”. Hereafter you double click on “Remote Java Application”.
In Libre Office you have -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n for the JRE used.
java.net.ConnectException: Connection refused: connect
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:568)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:576)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:666)
at java.base/java.net.Socket.connect(Socket.java:600)
at java.base/java.net.Socket.<init>(Socket.java:509)
at java.base/java.net.Socket.<init>(Socket.java:289)
at org.eclipse.jdi.internal.connect.SocketTransportService$2.run(SocketTransportService.java:147)
at java.base/java.lang.Thread.run(Thread.java:1589)