Deploying hawt.io to spring-boot-web's jetty

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying hawt.io to spring-boot-web's jetty

Wolfram Huesken
Hello together,

I want to deploy my Camel application together with an embedded hawt.io
for monitoring, but I cannot find anything on how to do that.

I want to use jetty as container and added the following dependencies to
my build.gradle:
compile 'org.springframework.boot:spring-boot-starter:1.3.3.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-web:1.3.3.RELEASE'
compile
'org.springframework.boot:spring-boot-starter-jetty:1.3.3.RELEASE'
compile
'org.springframework.boot:spring-boot-starter-data-jpa:1.3.3.RELEASE'
compile
'org.springframework.boot:spring-boot-starter-actuator:1.3.3.RELEASE'

Jetty is starting up and registering some endpoints like /trace and
/info, /beans, /health etc. so the container itself would be already
running.

How can I add the hawt.io endpoints to this embedded jetty?

Thanks
Wolfram
Reply | Threaded
Open this post in threaded view
|

Re: Deploying hawt.io to spring-boot-web's jetty

jgoggins
The easiest way I found was to download jolokia-jvm-1.3.3-agent.jar from https://jolokia.org/download.html

Download hawtio jar from https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-app/1.4.61/hawtio-app-1.4.61.jar 

Run the following command to start hawtio
java -jar hawtio-app-1.4.61.jar -port 8090

## IntelliJ params
##
## VM Option -javaagent:C:/hawtio/jolokia-jvm-1.3.3-agent.jar
## Program Args -javaagent:agent.jar=port=7777,host=localhost

Run the app..

Reply | Threaded
Open this post in threaded view
|

Re: Deploying hawt.io to spring-boot-web's jetty

Wolfram Huesken
I know that I can run it standalone, my goal is to run it embedded in a
camel application. Maybe have a Spring bean for configuration or
something like this. This should be pretty common to do this...

On Mon, Feb 29, 2016, at 05:48 PM, jgoggins wrote:

> The easiest way I found was to download jolokia-jvm-1.3.3-agent.jar from
> https://jolokia.org/download.html
>
> Download hawtio jar from
> https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-app/1.4.61/hawtio-app-1.4.61.jar 
>
> Run the following command to start hawtio
> java -jar hawtio-app-1.4.61.jar -port 8090
>
> ## IntelliJ params
> ##
> ##      VM Option       -javaagent:C:/hawtio/jolokia-jvm-1.3.3-agent.jar
> ##      Program Args    -javaagent:agent.jar=port=7777,host=localhost
>
> Run the app..
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Deploying-hawt-io-to-spring-boot-web-s-jetty-tp5778435p5778447.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Deploying hawt.io to spring-boot-web's jetty

sashikaxp
This is all I wanted to run Hawt.io embedded
org.apache.camel.Main main = new org.apache.camel.Main(); main.enableHangupSupport(); main.addRouteBuilder(new MyRouteBuilder()); main.start(); System.out.println(“Camel starting”); Main hawtMain = new Main(); hawtMain.setWarLocation(“C:\\Users\\******\\hawtio-283166409961293896.war”); hawtMain.run();
Once you run this hawtio will be available through the default port(8080)


On Tue, Mar 1, 2016 at 7:56 AM, Wolfram Huesken < [hidden email] > wrote:
I know that I can run it standalone, my goal is to run it embedded in a
camel application. Maybe have a Spring bean for configuration or
something like this. This should be pretty common to do this...

On Mon, Feb 29, 2016, at 05:48 PM, jgoggins wrote:
> The easiest way I found was to download jolokia-jvm-1.3.3-agent.jar from
> https://jolokia.org/download. html
>
> Download hawtio jar from
> https://oss.sonatype.org/ content/repositories/public/
io/hawt/hawtio-app/1.4.61/ hawtio-app-1.4.61.jar

>
> Run the following command to start hawtio
> java -jar hawtio-app-1.4.61.jar -port 8090
>
> ## IntelliJ params
> ##
> ## VM Option -javaagent:C:/hawtio/jolokia- jvm-1.3.3-agent.jar
> ## Program Args -javaagent:agent.jar=port= 7777,host=localhost
>
> Run the app..
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble. com/Deploying-hawt-io-to-
spring-boot-web-s-jetty- tp5778435p5778447.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Deploying hawt.io to spring-boot-web's jetty

Wolfram Huesken-2
Hello Sashika,

thanks for the hint! I added hawtio-embedded to my dependencies
('io.hawt:hawtio-embedded:2.0.0') and tried to start it, but now I have
two new problems :D

1. To not clutter my main method, I wanted to bootstrap hawt.io in
"beforeApplicationStart":
    @Bean
    CamelContextConfiguration contextConfiguration() {
        return camelContext -> {
            Main main = new Main();
            main.setWar(System.getProperty("user.home") +
            "/.scruffy/hawtio/hawtio.war");

            try {
                main.run();
            } catch (Exception ex) {
                logger.error("hawt.io startup failed", ex);
            }
        };
    }

This bean is never called. Neither System.out.println nor debug
breakpoints work. So just to make some progress I added it to the main
method, which brought me the 2nd problem

2. Hawt.io has slf4j-simple as dependency, which collides with the
logback dependency from spring. I tried to exclude it in my gradle build
file, so my program starts up again, but hawt.io doesn't work, because
it really depends on some code in slf4j-simple, not only on the API.

I consider this a problem of hawt.io, so I will ask in their forum.

Thanks for bringing me a step ahead, Sashika. The first problem is not
really serious, but I'd like to know why it doesn't work anymore, I'm
pretty sure it worked last time I used it. I'm using spring-boot 1.33
Release.

Best Regards
Wolfram


On Tue, Mar 1, 2016, at 03:55 AM, Sashika wrote:

> This is all I wanted to run Hawt.io embedded
> org.apache.camel.Main main = new org.apache.camel.Main();
> main.enableHangupSupport(); main.addRouteBuilder(new MyRouteBuilder());
> main.start(); System.out.println(“Camel starting”); Main hawtMain = new
> Main();
> hawtMain.setWarLocation(“C:\\Users\\******\\hawtio-283166409961293896.war”);
> hawtMain.run();
> Once you run this hawtio will be available through the default port(8080)
>
>
> On Tue, Mar 1, 2016 at 7:56 AM, Wolfram Huesken < [hidden email] >
> wrote:
> I know that I can run it standalone, my goal is to run it embedded in a
> camel application. Maybe have a Spring bean for configuration or
> something like this. This should be pretty common to do this...
>
> On Mon, Feb 29, 2016, at 05:48 PM, jgoggins wrote:
> > The easiest way I found was to download jolokia-jvm-1.3.3-agent.jar from
> > https://jolokia.org/download. html
> >
> > Download hawtio jar from
> > https://oss.sonatype.org/ content/repositories/public/
> io/hawt/hawtio-app/1.4.61/ hawtio-app-1.4.61.jar
> >
> > Run the following command to start hawtio
> > java -jar hawtio-app-1.4.61.jar -port 8090
> >
> > ## IntelliJ params
> > ##
> > ## VM Option -javaagent:C:/hawtio/jolokia- jvm-1.3.3-agent.jar
> > ## Program Args -javaagent:agent.jar=port= 7777,host=localhost
> >
> > Run the app..
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble. com/Deploying-hawt-io-to-
> spring-boot-web-s-jetty- tp5778435p5778447.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Deploying hawt.io to spring-boot-web's jetty

Wolfram Huesken
Hello Sashika,

thanks for the hint! I added hawtio-embedded to my dependencies
('io.hawt:hawtio-embedded:1.4.61') and tried to start it, but now I have
two new problems :D

1. To not clutter my main method, I wanted to bootstrap hawt.io in
"beforeApplicationStart":
    @Bean
    CamelContextConfiguration contextConfiguration() {
        return camelContext -> {
            Main main = new Main();
            main.setWar(System.getProperty("user.home") +
            "/.scruffy/hawtio/hawtio.war");

            try {
                main.run();
            } catch (Exception ex) {
                logger.error("hawt.io startup failed", ex);
            }
        };
    }

This bean is never called. Neither System.out.println nor debug
breakpoints work. So just to make some progress I added it to the main
method, which brought me the 2nd problem

2. Hawt.io has slf4j-simple as dependency, which collides with the
logback dependency from spring. I tried to exclude it in my gradle build
file, so my program starts up again, but hawt.io doesn't work, because
it really depends on some code in slf4j-simple, not only on the API.

I consider this a problem of hawt.io, so I will ask in their forum.

Thanks for bringing me a step ahead, Sashika. The first problem is not
really serious, but I'd like to know why it doesn't work anymore, I'm
pretty sure it worked last time I used it. I'm using spring-boot 1.33
Release.

Best Regards
Wolfram

>
> On Tue, Mar 1, 2016, at 03:55 AM, Sashika wrote:
> > This is all I wanted to run Hawt.io embedded
> > org.apache.camel.Main main = new org.apache.camel.Main();
> > main.enableHangupSupport(); main.addRouteBuilder(new MyRouteBuilder());
> > main.start(); System.out.println(“Camel starting”); Main hawtMain = new
> > Main();
> > hawtMain.setWarLocation(“C:\\Users\\******\\hawtio-283166409961293896.war”);
> > hawtMain.run();
> > Once you run this hawtio will be available through the default port(8080)
> >
> >
> > On Tue, Mar 1, 2016 at 7:56 AM, Wolfram Huesken < [hidden email] >
> > wrote:
> > I know that I can run it standalone, my goal is to run it embedded in a
> > camel application. Maybe have a Spring bean for configuration or
> > something like this. This should be pretty common to do this...
> >
> > On Mon, Feb 29, 2016, at 05:48 PM, jgoggins wrote:
> > > The easiest way I found was to download jolokia-jvm-1.3.3-agent.jar from
> > > https://jolokia.org/download. html
> > >
> > > Download hawtio jar from
> > > https://oss.sonatype.org/ content/repositories/public/
> > io/hawt/hawtio-app/1.4.61/ hawtio-app-1.4.61.jar
> > >
> > > Run the following command to start hawtio
> > > java -jar hawtio-app-1.4.61.jar -port 8090
> > >
> > > ## IntelliJ params
> > > ##
> > > ## VM Option -javaagent:C:/hawtio/jolokia- jvm-1.3.3-agent.jar
> > > ## Program Args -javaagent:agent.jar=port= 7777,host=localhost
> > >
> > > Run the app..
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://camel.465427.n5.nabble. com/Deploying-hawt-io-to-
> > spring-boot-web-s-jetty- tp5778435p5778447.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.