2

Context

I have a small application with an endpoint which calls some converter library. My Run Configuration is of type Tomcat and deploys an exploded war which is my application.

In the pom.xml's <dependencies> of that application, I have an external library I need to debug. That library is called within my application, obviously.

When I launch the Tomcat Run Configuration in Debug mode, the logs indicate that the Agent seems to have been set up properly and the artefact is deployed successfully (the following is a subset of the logs which I thought were relevant):

C:\Apps\apache-tomcat-8.5.56\bin\catalina.bat run
[2021-02-09 01:32:03,448] Artifact crs-classic-conv-endpoint:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\me\AppData\Local\JetBrains\IntelliJIdea2020.3\tomcat\ac2f062f-8f6d-4769-8de5-120d70232ac9"
Using CATALINA_HOME:   "C:\Apps\apache-tomcat-8.5.56"
Using CATALINA_TMPDIR: "C:\Apps\apache-tomcat-8.5.56\temp"
Using JRE_HOME:        "C:\Apps\jdk-1.8.0_181_pki18"
Using CLASSPATH:       "C:\Apps\apache-tomcat-8.5.56\bin\bootstrap.jar;C:\Apps\apache-tomcat-8.5.56\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:61873', transport: 'socket'
Connected to server
[2021-02-09 01:32:05,611] Artifact crs-classic-conv-endpoint:war exploded: Artifact is being deployed, please wait...
Root WebApplicationContext: initialization started 
09-Feb-2021 13:32:30.964 INFOS [RMI TCP Connection(5)-127.0.0.1] com.sun.xml.ws.server.MonitorBase.createRoot Metro monitoring rootname successfully set to: com.sun.metro:pp=/,type=WSEndpoint,name=-RetrieveCRSClassicContractService-RetrieveCRSClassicContractPort
Registering beans for JMX exposure on startup 
Bean with name 'loggingConfiguration' has been autodetected for JMX exposure 
Bean with name 'mailConfiguration' has been autodetected for JMX exposure 
Bean with name 'performanceConfiguration' has been autodetected for JMX exposure 
Bean with name 'propertiesConfiguration' has been autodetected for JMX exposure 
Located managed bean 'propertiesConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.PropertiesConfiguration] 
Located managed bean 'mailConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.MailConfiguration] 
Located managed bean 'performanceConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.PerformanceConfiguration] 
Located managed bean 'loggingConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.LoggingConfiguration] 
Registering beans for JMX exposure on startup 
Bean with name 'loggingConfiguration' has been autodetected for JMX exposure 
Bean with name 'mailConfiguration' has been autodetected for JMX exposure 
Bean with name 'performanceConfiguration' has been autodetected for JMX exposure 
Bean with name 'propertiesConfiguration' has been autodetected for JMX exposure 
Located managed bean 'propertiesConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.PropertiesConfiguration] 
Located managed bean 'mailConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.MailConfiguration] 
Located managed bean 'performanceConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.PerformanceConfiguration] 
Located managed bean 'loggingConfiguration': registering with JMX server as MBean [Foo.${service.name}.Configuration:name=ws-common-utils.LoggingConfiguration] 
Root WebApplicationContext: initialization completed in 15487 ms 
09-Feb-2021 13:32:32.585 INFOS [RMI TCP Connection(5)-127.0.0.1] com.sun.xml.ws.transport.http.servlet.WSServletDelegate.<init> WSSERVLET14 : initialisation du servlet JAX-WS
Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@167fa5b2: startup date [Tue Feb 09 13:32:32 EST 2021]; root of context hierarchy 
[2021-02-09 01:32:33,359] Artifact crs-classic-conv-endpoint:war exploded: Artifact is deployed successfully
[2021-02-09 01:32:33,359] Artifact crs-classic-conv-endpoint:war exploded: Deploy took 27,748 milliseconds

Then, I can see that my breakpoints are registered due to the white checkmark:

enter image description here

However, that's only the case for the code which is in the module's src/main/java directory. The library I'm trying to debug, which is found in the External Libraries, will not have its breakpoints registered:

enter image description here

I've added a few lines of logging, and modified the version in that library's pom.xml and ran mvn clean install in both the library and my application to make sure I was pointing to the right version of the code.


Diagnosis

Now here comes the weird part. When I run the test which calls the endpoint of my application, I see the following logs:

com.my.app.ExecutionServiceException: java.lang.NullPointerException: TheConverter.java, notWithinYearBoundaries line 1110
    at com.my.app.handleTransaction(MyAppEndpointHandler.java:143)

This proves to me that the library code where I had a breakpoint on a logging (L1109) is indeed being ran (and I see the actual logs in the Tomcat logs).

Moreover, when I click on MyAppEndpointHandler.java:143, IntelliJ indeed does open the class in which I had set my breakpoint which was marked as registered (and yes, L61 is within the same function as L143).


Problems

  1. IntelliJ doesn't even interrupt the running application to show me the debugging window when the code reaches the registered breakpoint on L61.
  2. IntelliJ refuses to register my breakpoint in the external library.

Things I tried

This is quite disturbing, and I've tried very many different things (a bunch of stuff I saw in that other SO question, among other things):

  1. clean & rebuild
  2. close all projects, and delete target, .idea/, and *.iml
  3. update my IntelliJ version (from 2020.3 to 2020.3.2)
  4. try another version of Tomcat
  5. Invalidate Caches & Restart
  6. and more...

It might be worth saying that two other developers on my team report that on their machine, they are not having my problem. And we appear to have to same IntelliJ configurations and settings.


Settings and Run Configuration

Here is the Tomcat Run Configuration:

Here is my Debugger Settings:


IntelliJ debug console output

Here is a partial version of the console logs:

...

[JDI: Sending Command(id=16) JDWP.VirtualMachine.TopLevelThreadGroups]
[JDI: Receiving Command(id=16) JDWP.VirtualMachine.TopLevelThreadGroups]
[JDI: Receiving:                groups(ThreadGroupReferenceImpl[]): ]
[JDI: Creating new com.jetbrains.jdi.ThreadGroupReferenceImpl (id = 336)]
[JDI: Receiving:                    groups[i](ThreadGroupReferenceImpl): ref=336]
[JDI: Sending Command(id=18) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 6]
[JDI: Sending:                 suspendPolicy(byte): 0]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Receiving Command(id=18) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 4]
[JDI: Sending Command(id=20) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 7]
[JDI: Sending:                 suspendPolicy(byte): 0]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Receiving Command(id=20) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 5]
[JDI: Sending Command(id=22) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): sun.instrument.InstrumentationImpl]
[JDI: Receiving Command(id=22) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 6]
[JDI: Sending Command(id=24) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): sun.instrument.InstrumentationImpl]
[JDI: Receiving Command(id=24) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 7]
[JDI: Sending Command(id=26) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): com.my.app.RetrieveCRSClassicContractEndpointHandler]
[JDI: Receiving Command(id=26) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 8]
[JDI: Sending Command(id=28) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): com.my.app.RetrieveCRSClassicContractEndpointHandler]
[JDI: Receiving Command(id=28) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 9]
[JDI: Sending Command(id=30) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): com.the.library.TheConverter]
[JDI: Receiving Command(id=30) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 10]
[JDI: Sending Command(id=32) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 8]
[JDI: Sending:                 suspendPolicy(byte): 1]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 5]
[JDI: Sending:                         classPattern(String): com.my.app.SomeException]
[JDI: Receiving Command(id=32) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 11]
[JDI: Sending Command(id=34) JDWP.VirtualMachine.Resume]
[JDI: Clearing VM suspended cache]
[JDI: Clearing temporary cache for ThreadReference 1]
[JDI: Receiving Command(id=1) JDWP.Event.Composite]
[JDI: Clearing temporary cache for ThreadGroupReference 336]
[JDI: Receiving:                suspendPolicy(byte): 0]
[JDI: Receiving Command(id=34) JDWP.VirtualMachine.Resume]
[JDI: Receiving:                events(Events[]): ]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 2]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=337]
[JDI: Receiving:                        signature(String): Ljava/lang/InternalError;]
[JDI: Receiving:                        status(int): 7]
[JDI: EventSet: SUSPEND_NONE]
[JDI: Looking up Class, signature='Ljava/lang/InternalError;', id=337]
[JDI: Caching new ReferenceType, sig=Ljava/lang/InternalError;, id=337]
[JDI: Sending Command(id=39) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving Command(id=39) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): main]
[JDI: Event: ClassPrepareEvent in thread main]
[JDI: Receiving Command(id=2) JDWP.Event.Composite]
[JDI: Receiving:                suspendPolicy(byte): 0]
[JDI: Receiving:                events(Events[]): ]
[JDI: Handled Prepare Event for java.lang.InternalError]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 2]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving:                        refTypeTag(byte): 2]
[JDI: Receiving:                        typeID(long): ref=338]
[JDI: Receiving:                        signature(String): Ljava/lang/instrument/Instrumentation;]
[JDI: Receiving:                        status(int): 3]
[JDI: EventSet: SUSPEND_NONE]
[JDI: Looking up Interface, signature='Ljava/lang/instrument/Instrumentation;', id=338]
[JDI: Caching new ReferenceType, sig=Ljava/lang/instrument/Instrumentation;, id=338]
[JDI: Sending Command(id=41) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving Command(id=41) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): main]
[JDI: Event: ClassPrepareEvent in thread main]
[JDI: Receiving Command(id=3) JDWP.Event.Composite]
[JDI: Receiving:                suspendPolicy(byte): 1]
[JDI: Handled Prepare Event for java.lang.instrument.Instrumentation]
[JDI: Receiving:                events(Events[]): ]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 7]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=339]
[JDI: Receiving:                        signature(String): Lsun/instrument/InstrumentationImpl;]
[JDI: Receiving:                        status(int): 3]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 6]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=339]
[JDI: Receiving:                        signature(String): Lsun/instrument/InstrumentationImpl;]
[JDI: Receiving:                        status(int): 3]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 2]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=1]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=339]
[JDI: Receiving:                        signature(String): Lsun/instrument/InstrumentationImpl;]
[JDI: Receiving:                        status(int): 3]
[JDI: EventSet: SUSPEND_EVENT_THREAD]

...

[JDI: EventSet: SUSPEND_NONE]
[JDI: Looking up Class, signature='Lcom/another/library/AbstractServiceRequestHandler;', id=7241]
[JDI: Caching new ReferenceType, sig=Lcom/another/library/AbstractServiceRequestHandler;, id=7241]
[JDI: Sending Command(id=20792) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving Command(id=20792) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(4)-127.0.0.1]
[JDI: Event: ClassPrepareEvent in thread RMI TCP Connection(4)-127.0.0.1]
[JDI: Receiving Command(id=6914) JDWP.Event.Composite]
[JDI: Receiving:                suspendPolicy(byte): 1]
[JDI: Receiving:                events(Events[]): ]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 9]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=7242]
[JDI: Receiving:                        signature(String): Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;]
[JDI: Receiving:                        status(int): 3]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 8]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=7242]
[JDI: Receiving:                        signature(String): Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;]
[JDI: Receiving:                        status(int): 3]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 2]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving:                        refTypeTag(byte): 1]
[JDI: Receiving:                        typeID(long): ref=7242]
[JDI: Receiving:                        signature(String): Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;]
[JDI: Receiving:                        status(int): 3]
[JDI: Handled Prepare Event for com.another.library.AbstractServiceRequestHandler]
[JDI: EventSet: SUSPEND_EVENT_THREAD]
[JDI: Looking up Class, signature='Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;', id=7242]
[JDI: Caching new ReferenceType, sig=Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;, id=7242]
[JDI: Sending Command(id=20794) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving Command(id=20794) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(4)-127.0.0.1]
[JDI: Event: ClassPrepareEvent in thread RMI TCP Connection(4)-127.0.0.1]
[JDI: Looking up Class, signature='Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;', id=7242]
[JDI: Sending Command(id=20796) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving Command(id=20796) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(4)-127.0.0.1]
[JDI: Event: ClassPrepareEvent in thread RMI TCP Connection(4)-127.0.0.1]
[JDI: Looking up Class, signature='Lcom/my/app/RetrieveCRSClassicContractEndpointHandler;', id=7242]
[JDI: Sending Command(id=20798) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving Command(id=20798) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(4)-127.0.0.1]
[JDI: Event: ClassPrepareEvent in thread RMI TCP Connection(4)-127.0.0.1]
[JDI: Handled Prepare Event for com.my.app.RetrieveCRSClassicContractEndpointHandler]
[JDI: Sending Command(id=20800) JDWP.ReferenceType.MethodsWithGeneric]
[JDI: Sending:                 refType(ReferenceTypeImpl): ref=7242]
[JDI: Receiving Command(id=20800) JDWP.ReferenceType.MethodsWithGeneric]
[JDI: Receiving:                declared(MethodInfo[]): ]
[JDI: Receiving:                    declared[i](MethodInfo): ]
[JDI: Receiving:                    methodID(long): 748485344]
[JDI: Receiving:                    name(String): <init>]
[JDI: Receiving:                    signature(String): ()V]
[JDI: Receiving:                    genericSignature(String): ]
[JDI: Receiving:                    modBits(int): 1]
[JDI: Receiving:                    declared[i](MethodInfo): ]
[JDI: Receiving:                    methodID(long): 748485368]
[JDI: Receiving:                    name(String): validateRequest]
[JDI: Receiving:                    signature(String): (Lcom/my/app/IRetrieveCRSClassicContractRequest;Lcom/my/app/IRetrieveCRSClassicContractResponse;)Z]
[JDI: Receiving:                    genericSignature(String): ]
[JDI: Receiving:                    modBits(int): 1]
[JDI: Receiving:                    declared[i](MethodInfo): ]
[JDI: Receiving:                    methodID(long): 748485384]
[JDI: Receiving:                    name(String): handleTransaction]
[JDI: Receiving:                    signature(String): (Lcom/my/app/IRetrieveCRSClassicContractRequest;Lcom/my/app/IRetrieveCRSClassicContractResponse;)V]

...

[JDI: Sending Command(id=20820) JDWP.ReferenceType.SourceFile]
[JDI: Sending:                 refType(ReferenceTypeImpl): ref=7242]
[JDI: Receiving Command(id=20820) JDWP.ReferenceType.SourceFile]
[JDI: Receiving:                sourceFile(String): RetrieveCRSClassicContractEndpointHandler.java]
[JDI: Sending Command(id=20822) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 2]
[JDI: Sending:                 suspendPolicy(byte): 2]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 7]
[JDI: Sending:                         loc(Location): com.my.app.RetrieveCRSClassicContractEndpointHandler:35]
[JDI: Receiving Command(id=20822) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 14]
[JDI: Sending Command(id=20824) JDWP.EventRequest.Set]
[JDI: Sending:                 eventKind(byte): 2]
[JDI: Sending:                 suspendPolicy(byte): 2]
[JDI: Sending:                 modifiers(Modifier[]): ]
[JDI: Sending:                     modifiers[i](Modifier): ]
[JDI: Sending:                     modKind(byte): 7]
[JDI: Sending:                         loc(Location): com.my.app.RetrieveCRSClassicContractEndpointHandler:61]
[JDI: Receiving Command(id=20824) JDWP.EventRequest.Set]
[JDI: Receiving:                requestID(int): 15]
[JDI: Sending Command(id=20826) JDWP.ThreadReference.Resume]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving Command(id=20826) JDWP.ThreadReference.Resume]
[JDI: Receiving Command(id=6915) JDWP.Event.Composite]
[JDI: Receiving:                suspendPolicy(byte): 0]
[JDI: Receiving:                events(Events[]): ]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 8]
[JDI: Receiving:                        requestID(int): 2]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving:                        refTypeTag(byte): 2]
[JDI: Receiving:                        typeID(long): ref=7243]
[JDI: Receiving:                        signature(String): Lcom/my/app/core/repository/IRepository;]
[JDI: Receiving:                        status(int): 3]
[JDI: EventSet: SUSPEND_NONE]

...

[JDI: Sending Command(id=24396) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=3191]
[JDI: Receiving Command(id=24396) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(idle)]
[JDI: Event: ThreadDeathEvent in thread RMI TCP Connection(idle)]
[JDI: Receiving Command(id=8105) JDWP.Event.Composite]
[JDI: Receiving:                suspendPolicy(byte): 0]
[JDI: Receiving:                events(Events[]): ]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 7]
[JDI: Receiving:                        requestID(int): 5]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=1805]
[JDI: EventSet: SUSPEND_NONE]
[JDI: Sending Command(id=24399) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=1805]
[JDI: Receiving Command(id=24399) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(idle)]
[JDI: Event: ThreadDeathEvent in thread RMI TCP Connection(idle)]
2021-02-10 11:08:47,714 [ 204386]   WARN - n.process.BaseOSProcessHandler - Process hasn't generated any output for a long time.
If it's a long-running mostly idle daemon process, consider overriding OSProcessHandler#readerOptions with 'BaseOutputReader.Options.forMostlySilentProcess()' to reduce CPU usage.
Command line: C:\Apps\apache-tomcat-8.5.56\bin\catalina.bat run 
java.lang.Throwable: Process creation:
    at com.intellij.execution.process.BaseOSProcessHandler.<init>(BaseOSProcessHandler.java:32)
    at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:91)
    at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:84)
    at com.intellij.javaee.appServers.run.execution.LocalJavaeeServerProcessHandler.<init>(LocalJavaeeServerProcessHandler.java:40)
    at com.intellij.javaee.appServers.run.execution.PatchedLocalState$ScriptBasedLocalJavaeeServerProcessHandler.<init>(PatchedLocalState.java:190)
    at com.intellij.javaee.appServers.run.execution.PatchedLocalState.startJ2EEProcess(PatchedLocalState.java:98)
    at com.intellij.javaee.appServers.run.execution.J2EEProcessHandlerWrapper.lambda$new$0(J2EEProcessHandlerWrapper.java:97)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:216)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:27)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:195)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:208)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:184)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:834)
[JDI: Receiving Command(id=8106) JDWP.Event.Composite]
[JDI: Receiving:                suspendPolicy(byte): 0]
[JDI: Receiving:                events(Events[]): ]
[JDI: Receiving:                    events[i](Events): ]
[JDI: Receiving:                    eventKind(byte): 7]
[JDI: Receiving:                        requestID(int): 5]
[JDI: Receiving:                        thread(ThreadReferenceImpl): ref=2559]
[JDI: EventSet: SUSPEND_NONE]
[JDI: Sending Command(id=24402) JDWP.ThreadReference.Name]
[JDI: Sending:                 thread(ThreadReferenceImpl): ref=2559]
[JDI: Receiving Command(id=24402) JDWP.ThreadReference.Name]
[JDI: Receiving:                threadName(String): RMI TCP Connection(idle)]
[JDI: Event: ThreadDeathEvent in thread RMI TCP Connection(idle)]
[JDI: Sending Command(id=24404) JDWP.VirtualMachine.Resume]
[JDI: Receiving Command(id=24404) JDWP.VirtualMachine.Resume]
[JDI: Sending Command(id=24406) JDWP.VirtualMachine.Dispose]
[JDI: Receiving Command(id=24406) JDWP.VirtualMachine.Dispose]
[JDI: Target VM i/f closing event queues]
[JDI: Internal event handler exiting]
[JDI: Target VM interface thread exiting]
[JDI: Sending Command(id=24408) JDWP.VirtualMachine.Dispose]
shutdown on Thread[AWT-EventQueue-0,6,Idea Thread Group]

The breakpoint properties

payne
  • 4,691
  • 8
  • 37
  • 85
  • [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) would be great to be able to reproduce and investigate this problem. Was the library built with the debug info enabled? You can also enable logging for the Java debugger to see why the breakpoint doesn't get the checkmark: https://intellij-support.jetbrains.com/hc/en-us/articles/207241125 . – CrazyCoder Feb 09 '21 at 19:24
  • @CrazyCoder 1) How do I know if the library was built with the debug info enabled? 2) I see `[JDI: EventSet: SUSPEND_NONE]` all over the logging `output.txt` of IntelliJ. Could that be it? 3) You might want to update the linked blog post: I had to use this trick to actually redirect the output https://stackoverflow.com/a/1420981/9768291 – payne Feb 10 '21 at 16:31
  • @CrazyCoder I updated the OP with a shortened version of the debug console logs. – payne Feb 10 '21 at 16:52
  • Can you show the breakpoint properties? What suspend policy is set for it? – CrazyCoder Feb 10 '21 at 16:53
  • @CrazyCoder updated OP with screenshot (after logs) – payne Feb 10 '21 at 17:01
  • Please unpack the class file where you set the breakpoint and use `javap` to verify that it was compiled with debug info, please see https://stackoverflow.com/a/1508403/104891. – CrazyCoder Feb 10 '21 at 17:14
  • @CrazyCoder Running `javap -classpath bin -l RetrieveCRSClassicC ontractEndpointHandler.class` did output a whole bunch of `LineNumberTable:` and `LocalVariableTable:`, including one row for the method I'm setting a breakpoint int (`handleTransaction`). Aside from that, I don't really know what I'm looking for: ` LineNumberTable: line 25: 0 LocalVariableTable: Start Length Slot Name Signature 0 13 0 this Lcom.my.app....` – payne Feb 10 '21 at 17:37
  • Can you step into the code of this library via debugger if you stop on some other breakpoint in your code and then step into the library calls? – CrazyCoder Feb 10 '21 at 17:50
  • @CrazyCoder No because the debugger never stops, even when I pass on lines for which breakpoints were registered. See the point #1 in the `Problems` section of the OP. The Debugger just *never* stops on anything related to my Tomcat Run Configuration. – payne Feb 10 '21 at 17:54
  • Can you reproduce it with the default IDE settings? File | Manage IDE Settings | Restore Default Settings...: https://i.imgur.com/kbrkC7w.png. – CrazyCoder Feb 10 '21 at 17:58
  • @CrazyCoder is there a way for me to try this out without losing all my settings? I have quite a lot of customization in there. It might also be useful to be able to visualize a `diff` between the `defaults` and my current settings. – payne Feb 10 '21 at 18:04
  • IDE will create a backup of your settings, so you can test it and then return back to your settings if it doesn't help. – CrazyCoder Feb 10 '21 at 18:05
  • @CrazyCoder I just tried it with the default settings: it still doesn't work. – payne Feb 10 '21 at 18:14
  • I would also try it with the vanilla Tomcat installation. Modifications to the Tomcat startup scripts and configs may affect debugging. – CrazyCoder Feb 10 '21 at 18:17
  • Also, what is the purpose of the Ant target `artifact-build`? If you build artifact with IntelliJ IDEA and deploy this artifact on the server, why do you need this Ant build and what does it change in the artifact? – CrazyCoder Feb 10 '21 at 18:41
  • And since StackOverflow site is not the best place to debug such problems, please feel free to continue in the support ticket that you can submit at https://intellij-support.jetbrains.com/hc/requests/new. – CrazyCoder Feb 10 '21 at 18:43
  • @CrazyCoder I solved my problem... https://stackoverflow.com/a/66144144/9768291 ! Thank you so much for your help and your time ! Restoring my IntelliJ settings wasn't hard, although I somehow lost all my installed plugins and their respective configurations. – payne Feb 10 '21 at 20:03

1 Answers1

3

Turns out there was a misunderstanding. I thought the Test class was making a network call to the localhost Tomcat instance, when in fact it called the source code directly.

That's why when I was launching the Tomcat Run Configuration in Debug mode I would get a registered breakpoint in my source code, but it would never suspend the application, despite me seeing the logs.

And since the application was configured to output logs in a file in target, I thought the logs were coming from Tomcat.

Stepping in from the Test class launched in Debug mode brought me to the application code, and eventually also reached the library code. That is also why I was seeing logs coming from the library, but without seeing the registered breakpoint when I was running the Test class normally after launching the Tomcat Run Configuration in Debug mode.

Ugh. That was an embarrassing and time-consuming journey.

payne
  • 4,691
  • 8
  • 37
  • 85