Search code examples
spring-bootembedded-jettyhawtio

how to use hawt.io with spring boot and an embedded Jetty


I have an Apache camel application which starts as an 'fat-jar' including an Jetty server. Is it possible to add hawt.io to the jar in order to use hawt.io for this application?

I tried to add hawt.io with

<dependency>
    <groupId>io.hawt</groupId>
    <artifactId>hawtio-core</artifactId>
    <version>1.4.47</version>
</dependency>
<dependency>
    <groupId>io.hawt</groupId>
    <artifactId>hawtio-plugin-mbean</artifactId>
    <version>1.4.47</version>
</dependency>
<dependency>
    <groupId>io.hawt</groupId>
    <artifactId>hawtio-springboot</artifactId>
    <version>1.4.47</version>
</dependency>
<dependency>
    <groupId>io.hawt</groupId>
    <artifactId>hawtio-web</artifactId>
    <version>1.4.47</version>
    <type>war</type>
</dependency>

but "/localhost:[my port]/hawtio" does not respond.


Solution

  • You would need to add some code to tell Jetty to add the hawtio-web WAR file as a context-path to jetty itself.

    See how we do this from hawtio embedded