You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/10/17 09:19:05 UTC
[PR] chore: camel-jbang - the AI tools see the beans in src/main/resources, catch a route id another file has, and say why a start failed [camel]
davsclaus opened a new pull request, #28001:
URL: https://github.com/apache/camel/pull/28001
## What
Two fixes for the AI tools, from the local-model benchmark (qwen3.6 35B-A3B against camel-jbang-mcp, Oct 16-17). The step that adds a Java class and declares it as a bean (run-order-generator step 2) failed in 8 of 10 runs.
1. **Beans in `src/main/resources`.** `camel run --source-dir` loads the whole directory, and the validator already finds the classes in `src/main/java`. A model that put the class there wrote `beans.yaml` in `src/main/resources` (6 of the 8 failures). Each reference to the bean was then refused as not declared, and `camel_get_files` did not list the file with the route files. Now the bean declarations come from the YAML in `src/main/resources` too, and a file with only beans (or another top-level entry of the YAML DSL, such as `onException`) is listed with the route files.
2. **A route id that another file has, and the cause of a failed start.** In another run the model copied the route into `beans.yaml`. The write went ahead, the restart failed with "Duplicate route ids detected", and the model ran `camel_run` three more times until its calls ran out. The validator now refuses a route id that a route in another YAML or XML file of the project has, and names that file. A failed `camel_run` or restart says its cause first: the error `camel run` prints as it exits, else the first exception logged at ERROR. The `camel_run` answer has it as `cause`.
## Tests
New tests in `SourceValidatorBeanRefsTest`, `AuthoringToolsTest`, `SourceValidatorRoutesTest` and `IntegrationLauncherTest`; the camel-jbang-core suite passes.
๐ค Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] chore: camel-jbang - the AI tools see the beans in src/main/resources, catch a route id another file has, and say why a start failed [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28001:
URL: https://github.com/apache/camel/pull/28001#issuecomment-6232215539
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] chore: camel-jbang - the AI tools see the beans in src/main/resources, catch a route id another file has, and say why a start failed [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #28001:
URL: https://github.com/apache/camel/pull/28001#issuecomment-6232492447
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `dsl/camel-jbang/camel-jbang-core`
---
<details><summary>:microscope: Scalpel shadow comparison โ Scalpel: 5 of 706 tested, 8 compile-only โ current: 5 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **5 affected modules** (current approach: 5).
**Skip-tests mode would test 5 modules** (1 direct + 5 downstream), **skip tests for 8** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (5)</summary>
- `camel-jbang-mcp` โ downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-mcp` โ downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-tui` โ downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-validate` โ downstream of org.apache.camel:camel-jbang-core
- `camel-launcher-container` โ downstream of org.apache.camel:camel-launcher
</details>
<details><summary>Modules with tests skipped (8)</summary>
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-launcher`
- `coverage`
</details>
> :information_source: Shadow mode โ Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
:warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
- `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
:bulb: **Manual integration tests recommended:**
> You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
> ```
> mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
> ```
<details><summary>All tested modules (14 modules, 3m 1s total)</summary>
**Total reactor time:** 3m 1s
| Module | Duration | Status |
| --- | --- | --- |
| Camel :: Launcher | 51.8s | SUCCESS |
| Camel :: JBang :: MCP | 44.8s | SUCCESS |
| Camel :: JBang :: Plugin :: Validate | 37.6s | SUCCESS |
| Camel :: JBang :: Plugin :: Testing | 17.4s | SUCCESS |
| Camel :: JBang :: Plugin :: Kubernetes | 16.3s | SUCCESS |
| Camel :: Coverage | 4.8s | SUCCESS |
| Camel :: JBang :: Plugin :: MCP | 2.5s | SUCCESS |
| Camel :: JBang :: Plugin :: Edit | 1.8s | SUCCESS |
| Camel :: JBang :: Integration tests | 1.4s | SUCCESS |
| Camel :: JBang :: Plugin :: Generate | 1.4s | SUCCESS |
| Camel :: JBang :: Main | 0.9s | SUCCESS |
| Camel :: Launcher :: Container | 0.8s | SUCCESS |
| Camel :: JBang :: Core | n/a | |
| Camel :: JBang :: Plugin :: TUI | n/a | |
**Top 20 slowest modules:**
- `Camel :: Launcher` (51.8s)
- `Camel :: JBang :: MCP` (44.8s)
- `Camel :: JBang :: Plugin :: Validate` (37.6s)
- `Camel :: JBang :: Plugin :: Testing` (17.4s)
- `Camel :: JBang :: Plugin :: Kubernetes` (16.3s)
- `Camel :: Coverage` (4.8s)
- `Camel :: JBang :: Plugin :: MCP` (2.5s)
- `Camel :: JBang :: Plugin :: Edit` (1.8s)
- `Camel :: JBang :: Integration tests` (1.4s)
- `Camel :: JBang :: Plugin :: Generate` (1.4s)
- `Camel :: JBang :: Main` (0.9s)
- `Camel :: Launcher :: Container` (0.8s)
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/39020661112)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] chore: camel-jbang - the AI tools see the beans in src/main/resources, catch a route id another file has, and say why a start failed [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #28001:
URL: https://github.com/apache/camel/pull/28001#discussion_r4303237634
##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/IntegrationLauncherTest.java:
##########
@@ -101,6 +101,50 @@ void failureOutputKeepsTheCauseNotTheFrames(@TempDir Path dir) throws Exception
assertThat(text.indexOf("is starting")).isLessThan(text.indexOf("Failed to create route"));
}
+ @Test
+ void failureCauseIsTheErrorCamelRunPrintsAsItExits(@TempDir Path dir) throws Exception {
+ // the console of camel run with a copy of the route in beans.yaml, next to the route file
+ String duplicate = "Failed to create route because: Duplicate route ids detected: order-generator. Please correct"
+ + " ids to be unique among all your routes.";
+ StringBuilder out = new StringBuilder();
+ out.append("Running integration with the following configuration:\n --kamelets-version=4.22.1\n");
+ out.append("2026-10-17 11:03:43.201 INFO 81710 --- [ main] org.apache.camel.main.MainSupport :"
+ + " Apache Camel (JBang) 4.24.0-SNAPSHOT is starting\n");
+ out.append("2026-10-17 11:03:43.640 WARN 81710 --- [ main] sl.yaml.common.YamlDeserializerBase :"
+ + " YAML DSL compact notation detected in: file:./beans.yaml\n");
+ out.append("2026-10-17 11:03:43.652 ERROR 81710 --- [ main] org.apache.camel.main.MainSupport :"
+ + " Error starting Camel: org.apache.camel.FailedToCreateRouteException: " + duplicate + "\n");
+ out.append("org.apache.camel.FailedToCreateRouteException: ").append(duplicate).append('\n');
+ out.append("\tat org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:385)\n");
+ out.append("\tat main.CamelJBang.main(CamelJBang.java:38)\n");
+ out.append("ERROR: ").append(duplicate).append('\n');
+ out.append("org.apache.camel.FailedToCreateRouteException: ").append(duplicate).append('\n');
+ out.append("\tat org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:385)\n");
+ Path output = dir.resolve("camel-launch.log");
+ Files.writeString(output, out.toString());
+
+ assertThat(IntegrationLauncher.failureCause(output)).isEqualTo(duplicate);
+ }
+
+ @Test
+ void failureCauseWithoutTheErrorLineIsTheFirstLoggedException(@TempDir Path dir) throws Exception {
+ Path output = dir.resolve("camel-launch.log");
+ Files.writeString(output, "2026-10-06 01:12:03.101 INFO 81990 --- [ main] o.a.c.main.MainSupport :"
+ + " Apache Camel (JBang) 4.24.0-SNAPSHOT is starting\n"
+ + "2026-10-06 01:12:04.552 ERROR 81990 --- [ main] o.a.c.main.MainSupport :"
+ + " Failed to create route: order-generator\n"
+ + "org.apache.camel.FailedToCreateRouteException: Failed to create route: order-generator"
+ + " because of No bean could be found in the registry for: orderNumber\n"
+ + "\tat org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:1)\n");
+ assertThat(IntegrationLauncher.failureCause(output))
+ .isEqualTo("Failed to create route: order-generator because of No bean could be found in the registry for:"
+ + " orderNumber");
+
+ // nothing that names an error: no cause, the output says what it says
+ Files.writeString(output, "Downloading dependency org.example:missing:1.0\n");
+ assertThat(IntegrationLauncher.failureCause(output)).isNull();
+ }
Review Comment:
Added in 8a4e9a3173a5: an ERROR record with only a stack frame after it, and the cause is the message after " : ".
_Claude Code on behalf of davsclaus_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] chore: camel-jbang - the AI tools see the beans in src/main/resources, catch a route id another file has, and say why a start failed [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #28001:
URL: https://github.com/apache/camel/pull/28001
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] chore: camel-jbang - the AI tools see the beans in src/main/resources, catch a route id another file has, and say why a start failed [camel]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #28001:
URL: https://github.com/apache/camel/pull/28001#discussion_r4302213987
##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ai/IntegrationLauncherTest.java:
##########
@@ -101,6 +101,50 @@ void failureOutputKeepsTheCauseNotTheFrames(@TempDir Path dir) throws Exception
assertThat(text.indexOf("is starting")).isLessThan(text.indexOf("Failed to create route"));
}
+ @Test
+ void failureCauseIsTheErrorCamelRunPrintsAsItExits(@TempDir Path dir) throws Exception {
+ // the console of camel run with a copy of the route in beans.yaml, next to the route file
+ String duplicate = "Failed to create route because: Duplicate route ids detected: order-generator. Please correct"
+ + " ids to be unique among all your routes.";
+ StringBuilder out = new StringBuilder();
+ out.append("Running integration with the following configuration:\n --kamelets-version=4.22.1\n");
+ out.append("2026-10-17 11:03:43.201 INFO 81710 --- [ main] org.apache.camel.main.MainSupport :"
+ + " Apache Camel (JBang) 4.24.0-SNAPSHOT is starting\n");
+ out.append("2026-10-17 11:03:43.640 WARN 81710 --- [ main] sl.yaml.common.YamlDeserializerBase :"
+ + " YAML DSL compact notation detected in: file:./beans.yaml\n");
+ out.append("2026-10-17 11:03:43.652 ERROR 81710 --- [ main] org.apache.camel.main.MainSupport :"
+ + " Error starting Camel: org.apache.camel.FailedToCreateRouteException: " + duplicate + "\n");
+ out.append("org.apache.camel.FailedToCreateRouteException: ").append(duplicate).append('\n');
+ out.append("\tat org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:385)\n");
+ out.append("\tat main.CamelJBang.main(CamelJBang.java:38)\n");
+ out.append("ERROR: ").append(duplicate).append('\n');
+ out.append("org.apache.camel.FailedToCreateRouteException: ").append(duplicate).append('\n');
+ out.append("\tat org.apache.camel.main.RoutesConfigurer.addDiscoveredRoutes(RoutesConfigurer.java:385)\n");
+ Path output = dir.resolve("camel-launch.log");
+ Files.writeString(output, out.toString());
+
+ assertThat(IntegrationLauncher.failureCause(output)).isEqualTo(duplicate);
+ }
+
+ @Test
+ void failureCauseWithoutTheErrorLineIsTheFirstLoggedException(@TempDir Path dir) throws Exception {
+ Path output = dir.resolve("camel-launch.log");
+ Files.writeString(output, "2026-10-06 01:12:03.101 INFO 81990 --- [ main] o.a.c.main.MainSupport :"
+ + " Apache Camel (JBang) 4.24.0-SNAPSHOT is starting\n"
+ + "2026-10-06 01:12:04.552 ERROR 81990 --- [ main] o.a.c.main.MainSupport :"
+ + " Failed to create route: order-generator\n"
+ + "org.apache.camel.FailedToCreateRouteException: Failed to create route: order-generator"
+ + " because of No bean could be found in the registry for: orderNumber\n"
+ + "\tat org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:1)\n");
+ assertThat(IntegrationLauncher.failureCause(output))
+ .isEqualTo("Failed to create route: order-generator because of No bean could be found in the registry for:"
+ + " orderNumber");
+
+ // nothing that names an error: no cause, the output says what it says
+ Files.writeString(output, "Downloading dependency org.example:missing:1.0\n");
+ assertThat(IntegrationLauncher.failureCause(output)).isNull();
+ }
Review Comment:
๐งช **Missing test: `failureCause` fallback path (ERROR line without a following exception)**
The `failureCauseWithoutTheErrorLineIsTheFirstLoggedException` test only covers the case where an `EXCEPTION_LINE` (e.g. `org.apache.camel.FailedToCreateRouteException: โฆ`) immediately follows the ERROR log line. But `IntegrationLauncher.failureCause` has a second path: if no exception line is found within the next 5 lines, it falls back to extracting the message from the ERROR line itself via `" : "` split.
That fallback is never exercised. Consider adding a case such as:
```java
// ERROR line with no following exception within 5 lines โ fallback to " : " split
Files.writeString(output,
"2026-10-06 01:12:04.552 ERROR 81990 --- [main] o.a.c.main.MainSupport : Route start failed due to missing bean\n"
+ " at some.Frame(Frame.java:1)\n");
assertThat(IntegrationLauncher.failureCause(output))
.isEqualTo("Route start failed due to missing bean");
```
Low severity โ the production logic is correct, just the test doesn't verify this branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org