You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "smongiar (via GitHub)" <gi...@apache.org> on 2026/04/29 13:25:46 UTC
[PR] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
smongiar opened a new pull request, #22835:
URL: https://github.com/apache/camel/pull/22835
## Summary
- Add explicit `setHost("127.0.0.1")` call when launching hawtio-embedded, instead of relying on its default `"localhost"`
- Add `--host` CLI option to `camel hawtio` command for user-configurable binding
- Update browser URL to use the configured host instead of hardcoded `localhost`
## Problem
On s390x and ppc64le architectures, `camel hawtio` fails with a `ConnectException` caused by `ClosedChannelException`. The root cause is that hawtio-embedded's default host `"localhost"` is resolved via `InetAddress.getByName("localhost")`, which may return `::1` (IPv6 loopback) on these systems. If IPv6 is disabled or NIO sockets behave differently, Jetty binds to an unreachable address.
The `camel jolokia` command (JVM agent, no Jetty) works fine on the same systems.
## Error trace (s390x)
```
java.net.ConnectException
Caused by: java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureOpen(...)
at sun.nio.ch.SocketChannelImpl.beginConnect(...)
```
## Fix
Use explicit `127.0.0.1` (IPv4 loopback) as the default host to avoid ambiguous `localhost` resolution across architectures.
## Test plan
- [ ] Run `camel hawtio --port=8888` on x86_64 — verify console is accessible
- [ ] Run `camel hawtio --host=0.0.0.0 --port=8888` — verify binding to all interfaces
- [ ] Test on s390x/ppc64le (jbang-e2e pipeline)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #22835:
URL: https://github.com/apache/camel/pull/22835
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161530765
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
That's ok, it's related to CSB-8964 issue
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22835:
URL: https://github.com/apache/camel/pull/22835#issuecomment-4344221102
: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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161508616
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
It should be the default value, yet. It's at line [46](https://github.com/apache/camel/pull/22835/changes#diff-58a14a72becb5f8554757084eb407003122e4d8539705f493f8739c07f6cec39R46). Am I wrong?
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161530765
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
That's ok, it's related to check CSB-8964 issue
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #22835:
URL: https://github.com/apache/camel/pull/22835#issuecomment-4345554412
more modified files
modified: docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-hawtio.adoc
modified: dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161516756
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
yes, but it was "http://localhost:" previously, now the default will be "http://127.0.0.1:"
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161530765
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
That's ok, it's related to IPv6 resolution issue
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161399525
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
is it ok to change from localhost, to the default 127.0.0.1?
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3161508616
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
It should be the default value, yet. It's at line [46](https://github.com/apache/camel/pull/22835/changes#diff-58a14a72becb5f8554757084eb407003122e4d8539705f493f8739c07f6cec39R46). Am I wrong? `127.0.0.1` is intentional to avoid IPv6 resolution issues on s390x/ppc64le
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22835:
URL: https://github.com/apache/camel/pull/22835#issuecomment-4351192737
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `docs`
- `dsl/camel-jbang/camel-jbang-core`
:warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
- `dsl/camel-jbang/camel-jbang-core`: 1 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 (6 modules)</summary>
- Camel :: JBang :: Core
- Camel :: JBang :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Validate
- Camel :: Launcher :: Container
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/25156509110)
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #22835:
URL: https://github.com/apache/camel/pull/22835#issuecomment-4350572365
@smongiar there are still a few modified files, its often just easier to do a full rebuild from root
mvn clean install -P fastinstall
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #22835:
URL: https://github.com/apache/camel/pull/22835#issuecomment-4344890117
modified: dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
--
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] Fix camel hawtio to explicitly set host address for Jetty binding [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #22835:
URL: https://github.com/apache/camel/pull/22835#discussion_r3162549863
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/process/Hawtio.java:
##########
@@ -116,14 +120,16 @@ protected Integer callHawtio() throws Exception {
Object hawt = clazz.getDeclaredConstructor().newInstance();
Method m = clazz.getMethod("setWar", String.class);
ObjectHelper.invokeMethod(m, hawt, war);
+ m = clazz.getMethod("setHost", String.class);
+ ObjectHelper.invokeMethod(m, hawt, host);
m = clazz.getMethod("setPort", Integer.class);
ObjectHelper.invokeMethod(m, hawt, port);
m = clazz.getMethod("run");
ObjectHelper.invokeMethod(m, hawt);
if (openUrl) {
// open web browser
- String url = "http://localhost:" + port + "/hawtio";
+ String url = "http://" + host + ":" + port + "/hawtio";
Review Comment:
yeah 127.0.0.1 is better to use than localhost
--
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