I'm trying to do a remote debug on IntelliJ. I have my remote debug setup using this command in IntelliJ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=40779 Currently when I hit local server with port 40779 and I check the logs I see that logging works so the code does execute. I set the breakpoint at the log just for sanity check to make sure that it would suspend at the point however it doesn't. I'm currently using Intellij 2020.2. I tried upgrading to Intellij 2020.3 and also the latest version 2021.1. I also tried invalidating the cache/restarting and also removing/adding all my breakpoints again.
The files I'm setting the breakpoints are Kotlin files and my Kotlin plugin version 203-1.5.0-release-759-IJ7717.8. I can also successfully run debug and connect to remote server Connected to the target VM, address: 'localhost:40779', transport: 'socket' but when I make a request to that server, the breakpoints don't stop.
Related
I have a custom mule 4 SDK connector, I want to debug runtime and design time.
Just connect a Java debugger to the JVM. The connector is Java code.
To debug runtime:
Go to your Anypoint Studio, open "Run Configurations", select your Mule project from "Mule Applications" on the left (you need to run it at least once for it to appear here). Then in the "Arguments" tab add to the VM arguments: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 - this will enable to attach to your debugger from the IDE you use for SDK development.
In your IDE add a debug config with connection type "Socket Attach", provide host (localhost) and port (1044).
Now you can set breakpoints in your IDE then start the Mule project in Anypoint Studio. When it is at the point of launching the runtime JVM (watch the Console) it will stop and wait for you to start the debug config set above and execution shall hit your breakpoints.
To debug design-time:
Go to where you installed Anypoint Studio, find AnypointStudio.ini
Add following contents after the -vm plugins line:
-vmargs
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8888
also uncomment following two lines near the end, so they look like this:
#To_debug_the_mule_instance_uncomment_the_following_line
-Dmule.tooling.debug=true
#To_specify_the_debug_port_for_the_design_time_mule._E.g._To_debug_connectors_code_at_design_time.
-Dmule.toolingInstance.debugPort=8000
In your IDE create two "Socket Attach" type debug config, for localhost and ports 8888 and 8000.
Start Anypoint Studio. It will wait for you to start the debug config for port 8888, then it will come up. A minute later start the debug config for port 8000 - this is the one attaching to the design-time JVM. You can watch the threads starting in the Debug perspective of your IDE.
Just select Connect Java Debugger checkbox in Window -> Preferences -> Anypoint Studio -> Debugger
I'm trying to set up a remote debug properly. I have already set a remote debug and it works, but it not working on an application initialization stage, which means I can not see how a cache fills and so on.
My environment: Payara 4 (it is Glassfish) and IntelliJ IDEA Community Edition.
How to make a correct setup?
You can suspend the JVM on remote debugging by using suspend=y which make the JVM to wait until the remote debugger is attached.
So the debugger's JVM options will be as below
Java 5-8
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
Java 9 and later
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
Note: Adjust the port based on your settings.
I followed pretty much everything in this blog to debug my annotation processor. However, I'm not able to attach the debugger I'm getting the below error.
Unable to open debugger port (localhost:5005): java.net.ConnectException "Connection refused (Connection refused)"
Is it really possible to debug annotation processer using community edition or does it requires licenced version?
Remote Debug configuration
Here is my configuration
I have debug Build process set to on.
I'm learning java webdevelopment and I'm using tomcat 7. I set everything up so that I can remotely debug (breakspoints seem to work) my deployment on a remote tomcat server using IntelliJ.
My book on webdevelopment states that I can use System.out.println() in most IDE's to print to the console.
But in IntelliJ nothing shows up in the console...
Does IntelliJ support printing to the console from a remote server?
And if it does, hoe do I set it up?
Or are there any alternatives to do this?
I found 2 solutions for my problem:
1) Use the intellij local run configuration
2) Instead of System.out.println() use log() to write to the catalina log file.
I am trying to configure a Selenium testing through Bamboo. I am able to run Selenium scripts directly from command line, however it always fails if I run it through Bamboo remote agent. The error is:
: Could not start Selenium session: Failed to start new browser session: Error while launching browser
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:107)
I took some advice from the web, and checked "Allow service to interact with desktop" for Bamboo remote agent service. However, it does not work.
Anyone have other suggestions?
You must run Bamboo in Console Mode for this to work. Also, the build machine desktop must be active - and not covered or minimized if you want mouse simulations to work. I know right!