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.
Related
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.
This has been happening ever since I have updated Intellij (IDEA CE 2020.3) to a newer version (today). I am getting this exception from the plugin when running the Develop on Kubernetes Run Configuration that I usually use with my local Minikube instance to get all of the services in the cluster up and running, and able to Debug in debug mode.
My local Minikube instance is fine shown by the following:
(Dev) $ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
I've tried checking for updates, restarting Intellij, and I am still getting the same thing. It must be something in relation to my Intellij Update but we'll have to see...
The full stack trace is:
java.util.ServiceConfigurationError: io.grpc.ManagedChannelProvider: io.grpc.netty.shaded.io.grpc.netty.NettyChannelProvider not a subtype
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
at io.grpc.ServiceProviders.loadAll(ServiceProviders.java:67)
at io.grpc.ServiceProviders.load(ServiceProviders.java:42)
at io.grpc.ManagedChannelProvider.<clinit>(ManagedChannelProvider.java:37)
at io.grpc.ManagedChannelBuilder.forAddress(ManagedChannelBuilder.java:37)
at com.google.cloud.tools.intellij.kubernetes.skaffold.events.SkaffoldEventHandler.newManagedChannel(SkaffoldEventHandler.kt:319)
at com.google.cloud.tools.intellij.kubernetes.skaffold.events.SkaffoldEventHandler.listenEvents(SkaffoldEventHandler.kt:75)
at com.google.cloud.tools.intellij.kubernetes.skaffold.run.SkaffoldCommandLineState$startProcess$1.invokeSuspend(SkaffoldCommandLineState.kt:189)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:241)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:740)
I am getting the same behaviour in both DEBUG mode and RUN mode.
Environment Info
IDE type: IntelliJ
IDE version: Community Edition 2020.3
Cloud Code version: 20.10.1-202
Skaffold version: v1.14.0
Operating System: Windows 10 Pro 64-bit
Any help, suggestions or resolutions would be really appreciated so thank you in advance! Thanks
This issue was fixed with patch release 20.12.1 that was put out shortly after the EAP release. Please try it out and if you run into any other issues feel free to post on our GitHub. – eshaul
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.
So, I am learning stm32 mcus, using a nucleo f4 board.
Everything was working fine and now debug launch fails.
Actually, I was doing one debug, closed it and next debug session won't launch.
It starts debug on Linux or on Windows with OpenOCD, but ST-Link GDB debug fails (gdb does work on linux).
This is the error message:
Already did allow the stlink server in the windows firewall.
Avast antivirus was deleting the STLINK server exe file, added an exception and it works.
Also the problem is the mass storage option (that allows use the explorer to grab directly the hex files) and makes conflicts with the ide. I solved the problem using explorer and ejecting the board, then debugger goes fine.