camel-idea-plugin icon indicating copy to clipboard operation
camel-idea-plugin copied to clipboard

Breakpoint disabled: Camel EIP ID Not Found

Open jhoeflaken opened this issue 1 year ago • 20 comments

Hi,

I cannot get the debugging to work. As soon as the application starts my breakpoint is disabled with Camel EIP ID not found. Attached my simple application. I use Camel Spring Boot Application configuration. I see the .camel.debugger.pom.xml being created and I get the popup that the Camel debugger was successfully connected.

Camel plugin version: 1.2.5 Spring Boot 3.2.3, Camel 4.4.0, IntelliJ 2023.3.5, Java 21 on WSL2. Same on Windows with Spring Boot 3.2.3/Camel 4.4.0/Java 21 and Spring Boot 3.2.2/Camel 4.3.0/Java 21

image debug-test.zip

jhoeflaken avatar Mar 17 '24 20:03 jhoeflaken

Is there any way I can debug the debugger plugin?

jhoeflaken avatar Mar 22 '24 12:03 jhoeflaken

Yes, you can launch in debug mode the runIde task, for more details refer to https://github.com/camel-tooling/camel-idea-plugin?tab=readme-ov-file#running-and-debugging-the-plugin-from-source

essobedo avatar Mar 22 '24 12:03 essobedo

@essobedo Thnx.

I will take a look.

Kind regards.

Jacob.

jhoeflaken avatar Mar 22 '24 12:03 jhoeflaken

Hi @essobedo ,

I have found that the problem is within CamelDebugerSession#getBreakpointId.

The identified source locations are:

image

And therefore the XPath to locate the proper line in the route:

image

But the routes document against the XPath is evaluated doesn't contain those attributes:

image

Do I need to set a specific setting to add these sourceLocation to a route?

Kind regards,

Jacob

jhoeflaken avatar Mar 22 '24 18:03 jhoeflaken

@essobedo

Seems to work now. Needed to add the following in application.yaml:

camel:
  springboot:
    main-run-controller: true
    source-location-enabled: true

spring:
  jmx:
    enabled: true

The source-location-enabled is false by default.

jhoeflaken avatar Mar 22 '24 18:03 jhoeflaken

The goal of .camel.debugger.pom.xml is to configure everything for you. So I will try to have a look asap, thx for the investigation and reporting the issue

essobedo avatar Mar 22 '24 19:03 essobedo

Thanks for finding the problem. @essobedo see if you can find out if camel-debug JAR does not automatic enable this in both camel-main / camel-spring-boot and camel-quarkus

davsclaus avatar Apr 01 '24 09:04 davsclaus

@essobedo if you need a reproducer for camel-quarkus: I updated the reproducer from https://github.com/camel-tooling/camel-idea-plugin/issues/930 to quarkus 3.9.1; it shows the same behaviour.

turing85 avatar Apr 02 '24 13:04 turing85

Thx for the reproducer, I will try to do it this week as soon as I will have some spare time

essobedo avatar Apr 03 '24 09:04 essobedo

Any progress on this?

turing85 avatar Apr 30 '24 17:04 turing85

I started to investigate but unfortunately I could not find an easy fix for it and could not find enough time to investigate more. I will try to investigate more this week or next week

essobedo avatar Apr 30 '24 18:04 essobedo

Did you find time to investigate more - In IDEA 2024.1.1 it seems that setting a breakpoint, cannot set it as a Camel breakpoint (only regular).

davsclaus avatar May 11 '24 08:05 davsclaus

This will help for XML routes (as they do not have source loc:line) https://issues.apache.org/jira/browse/CAMEL-20757

davsclaus avatar May 11 '24 09:05 davsclaus

And this https://issues.apache.org/jira/browse/CAMEL-20758

davsclaus avatar May 12 '24 18:05 davsclaus

@davsclaus did you plan to backport those changes into Camel 4.4?

essobedo avatar May 13 '24 06:05 essobedo

Only if we get this to work first with main branch (ie 4.7.0) then we can look at what changes was done and what can be backported.

However the debugger is wonky and does not seem to work so well in IDEA. Not sure if you or anyone else have time to look into this.

I am afraid that this IDEA plugin is community only

davsclaus avatar May 13 '24 07:05 davsclaus

okay so it seems that the debugger rely on message history being enabled to have some details

davsclaus avatar May 13 '24 08:05 davsclaus

https://issues.apache.org/jira/browse/CAMEL-20761

davsclaus avatar May 13 '24 08:05 davsclaus

Okay I can get the example to debug OOTB with some more changes

Screenshot 2024-05-13 at 13 02 59

davsclaus avatar May 13 '24 11:05 davsclaus

This requires too many code changes and will not make it back to 4.4.x.

davsclaus avatar May 13 '24 14:05 davsclaus

So this requires Camel 4.7 onwards to work OOTB. For older releases you can manually enable message history.

davsclaus avatar Aug 08 '24 16:08 davsclaus