#Java Remote Debugging? (Done)

1 messages · Page 1 of 1 (latest)

nimble fulcrum
#

I learned more about the debugger today for example the option to hot swap code with the "Compile and Reload File" feature aka hotswap code or other very useful debugging tools. However i am running my code on a remote linux server and my original try of using intelijs remote Debugging isnt working pretty much. I can pause and read out but not modify it pretty much. I am currently using a script to make an jar file and push it over. Looking for someones suggestion how to add full debug functionality like you would have while running on client.

Script:
variable setters left out.

Copy the JAR file to the remote server using rsync

rsync -avz --delete --progress -e "ssh" /home/myusername/IdeaProjects/BBsentials_Server_and_Bot/out/artifacts/dc_bot_jar/dc-bot.jar $server:/home/dummy/bbonline.jar

SSH into the remote server and start the JAR file with remote debugging enabled

ssh -L $debugPort:localhost:$debugPort $server << EOF

Kill any existing Java processes

killall java

Start the JAR file with remote debugging enabled

su -c "java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=localhost:$debugPort -jar /home/dummy/bbonline.jar $dbPasswd" dummy
EOF

graceful meadowBOT
#

This post has been reserved for your question.

Hey @nimble fulcrum! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

upper wave
#

modifying over remote attaching is a bit wonky

#

it only works if the overall structure of the class stays the same, you can only change the method contents

#

you cant add, remove or change methods or fields

#

best option would be to make an auto reload script that just restarts java when a new version of your jar has been found, that way you can just run the script on the server in the background, and when you upload a new version of your jar, the server automatically deploys it

nimble fulcrum
#

i am using a socket and that would close the socket and i need to reonnect and reauth

upper wave
#

you’re just gonna have to do that then

#

the other solution would be convoluted at best

graceful meadowBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

nimble fulcrum
#

Java Remote Debugging? (Done)

nimble fulcrum