Where can I find the Hawtio server side static resources for embedding in my application?

27 views
Skip to first unread message

David Hoffer

unread,
Sep 19, 2018, 3:51:14 PM9/19/18
to hawtio
How can I include Hawtio in my Vertx application?

http://hawt.io/ says the following...

The only server side dependency (other than the static HTML/CSS/JS/images) is the excellent Jolokia library which is available as a JVM agent...

I already have Jolokia in my Vertx application but now I need the above referenced 'static HTML/CSS/JS/images' where can I get these to include in my application?  

Are these perhaps available as a webjar where I could get the static UI contents?

-Dave

Tadayoshi Sato

unread,
Sep 19, 2018, 8:43:00 PM9/19/18
to dhof...@gmail.com, hawtio
Hi Dave,

Can you try the embedded mode?
You still need to put hawtio.war somewhere but it should work with Vert.x.

Tadayoshi

--
You received this message because you are subscribed to the Google Groups "hawtio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hawtio+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Hoffer

unread,
Sep 19, 2018, 8:49:58 PM9/19/18
to sato.ta...@gmail.com, haw...@googlegroups.com
Vert.x doesn't use any wars (it's not a servlet container).  However it does have an embedded HTTP server so what I'm looking for is the set of static HTML/CSS/JS/images files that I can put in my application.  We do this for other static web apps and works great.  I just need the static HTML/CSS/JS/images folder for hawtio.

-Dave

Tadayoshi Sato

unread,
Sep 19, 2018, 9:25:59 PM9/19/18
to dhof...@gmail.com, hawtio
hawtio.war comes with some backend Java servlets but if you really want only the static resources you can 'git clone' the hawtio/hawtio repos and run 'mvn clean install' to get them under hawtio-console-assembly/dist/

David Hoffer

unread,
Sep 19, 2018, 10:27:49 PM9/19/18
to sato.ta...@gmail.com, haw...@googlegroups.com
Okay I will give that option a try...sounds like that is what I need.

-Dave

Tadayoshi Sato

unread,
Sep 19, 2018, 10:51:40 PM9/19/18
to dhof...@gmail.com, hawtio
Cool. This maven plugin config might give you insight on how to import them into your project:

David Hoffer

unread,
Sep 20, 2018, 1:27:28 PM9/20/18
to sato.ta...@gmail.com, haw...@googlegroups.com
I'm getting the following error doing the Maven build (clean install).  Any idea what is going wrong?  I'm using Maven 3.5.2 with JDK 1.8_152

[INFO] --- frontend-maven-plugin:1.6:yarn (yarn run build) @ hawtio-console-assembly ---
[INFO] Running 'yarn run build' in C:\git\ODIN\hawtio\hawtio-console-assembly
[INFO] yarn run v1.9.4
[INFO] $ gulp build
[INFO] [hawtio-backend] Adding startup task
[INFO] [hawtio-backend] Adding startup task
[INFO] [hawtio-backend] Adding startup task
[INFO] [11:22:20] Using gulpfile C:\git\ODIN\hawtio\hawtio-console-assembly\gulpfile.js
[INFO] [11:22:20] Starting 'build'...
[INFO] [11:22:20] Starting 'clean'...
[INFO] [11:22:20] Finished 'clean' after 65 ms
[INFO] [11:22:20] Starting 'tsc'...
[INFO] [11:22:20] tsc app\src\app.ts
[INFO] [11:22:20] tsc app\src\login\keycloak-login.ts
[INFO] [11:22:20] tsc app\src\login\login.component.ts
[INFO] [11:22:20] tsc app\src\login\login.module.ts
[INFO] [11:22:20] tsc app\node_modules\jolokia.js\index.d.ts
[INFO] [11:22:20] tsc 5 items
[INFO] [11:22:23] tsc js compiled.js
[INFO] [11:22:23] tsc js 1 item
[INFO] [11:22:23] Finished 'tsc' after 3.24 s
[INFO] [11:22:23] Starting 'template'...
[INFO] [11:22:23] template app\src\login\login.component.html
[INFO] [11:22:23] template 1 item
[INFO] [11:22:23] Finished 'template' after 145 ms
[INFO] [11:22:23] Starting 'template-docs'...
[INFO] [11:22:23] Finished 'template-docs' after 20 ms
[INFO] [11:22:23] Starting 'concat'...
[INFO] [11:22:23] hawtio-console-assembly.js 28.93 kB
[INFO] [11:22:23] hawtio-console-assembly.js 9.54 kB (gzipped)
[INFO] [11:22:23] Finished 'concat' after 27 ms
[INFO] [11:22:23] Starting 'less'...
[INFO] [11:22:23] Finished 'less' after 127 ms
[INFO] [11:22:23] Starting 'usemin'...
[INFO] [11:22:24] usemin index.html
[INFO] [11:22:24] usemin login.html
[INFO] [11:22:24] usemin 2 items
[INFO] [11:22:24] Finished 'usemin' after 279 ms
[INFO] [11:22:24] Starting 'install-dependencies'...
[INFO]
[INFO] The syntax of the command is incorrect.
[INFO]
[INFO] [11:22:24] 'install-dependencies' errored after 42 ms
[INFO] [11:22:24] Error: Command failed: cd app/ &&
[INFO]         yarn install --prod --flat --frozen-lockfile &&
[INFO]         cd .. &&
[INFO]         cp -R app//node_modules dist/libs
[INFO] The syntax of the command is incorrect.
[INFO]
[INFO]     at ChildProcess.exithandler (child_process.js:275:12)
[INFO]     at emitTwo (events.js:126:13)
[INFO]     at ChildProcess.emit (events.js:214:7)
[INFO]     at maybeClose (internal/child_process.js:925:16)
[INFO]     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
[INFO] [11:22:24] 'build' errored after 3.95 s
[INFO] [11:22:24] Error in plugin 'run-sequence(install-dependencies)'
[INFO] Message:
[INFO]     Command failed: cd app/ &&
[INFO]         yarn install --prod --flat --frozen-lockfile &&
[INFO]         cd .. &&
[INFO]         cp -R app//node_modules dist/libs
[INFO] The syntax of the command is incorrect.
[INFO]
[INFO] Details:
[INFO]     killed: false
[INFO]     code: 1
[ERROR] error Command failed with exit code 1.
[INFO]     signal: null
[INFO]     cmd: cd app/ &&
[INFO]         yarn install --prod --flat --frozen-lockfile &&
[INFO]         cd .. &&
[INFO]         cp -R app//node_modules dist/libs
[INFO] Stack:
[INFO] Error: Command failed: cd app/ &&
[INFO]         yarn install --prod --flat --frozen-lockfile &&
[INFO]         cd .. &&
[INFO]         cp -R app//node_modules dist/libs
[INFO] The syntax of the command is incorrect.
[INFO]
[INFO]     at ChildProcess.exithandler (child_process.js:275:12)
[INFO]     at emitTwo (events.js:126:13)
[INFO]     at ChildProcess.emit (events.js:214:7)
[INFO]     at maybeClose (internal/child_process.js:925:16)
[INFO]     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] hawtio-java-project ................................ SUCCESS [  7.319 s]
[INFO] hawtio-bom ......................................... SUCCESS [  0.085 s]
[INFO] hawtio-util ........................................ SUCCESS [  5.318 s]
[INFO] hawtio-core ........................................ SUCCESS [  2.470 s]
[INFO] hawtio-system ...................................... SUCCESS [ 28.279 s]
[INFO] hawtio-console-assembly ............................ FAILURE [03:52 min]
[INFO] hawtio-local-jvm-mbean ............................. SKIPPED
[INFO] hawtio-war ......................................... SKIPPED
[INFO] hawtio-springboot .................................. SKIPPED
[INFO] hawtio-example-springboot-authentication ........... SKIPPED
[INFO] hawtio-ide ......................................... SKIPPED
[INFO] hawtio-junit ....................................... SKIPPED
[INFO] hawtio-base ........................................ SKIPPED
[INFO] hawtio-log ......................................... SKIPPED
[INFO] hawtio-default ..................................... SKIPPED
[INFO] hawtio-embedded .................................... SKIPPED
[INFO] hawtio-app ......................................... SKIPPED
[INFO] hawtio-maven-plugin ................................ SKIPPED
[INFO] hawtio-example-springboot .......................... SKIPPED
[INFO] hawtio-log-osgi .................................... SKIPPED
[INFO] hawtio-osgi-jmx .................................... SKIPPED
[INFO] hawtio-karaf ....................................... SKIPPED
[INFO] hawtio-wildfly ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:07 min
[INFO] Finished at: 2018-09-20T11:22:24-06:00
[INFO] Final Memory: 43M/691M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (yarn run build) on project hawtio-con
sole-assembly: Failed to run task: 'yarn run build' failed. org.apache.commons.exec.ExecuteException: Process exited wit
h an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :hawtio-console-assembly

-Dave

Tadayoshi Sato

unread,
Sep 20, 2018, 9:35:34 PM9/20/18
to David Hoffer, Alexandre Briani Kieling, hawtio
We've never built Hawtio on Windows. This time I tried and see the same error, so it looks like yarn or the yarn maven plugin doesn't work well on Windows.

Alex, do you have any ideas?

David Hoffer

unread,
Sep 20, 2018, 11:39:23 PM9/20/18
to sato.ta...@gmail.com, abri...@redhat.com, haw...@googlegroups.com
I wondered if it was a Linux build issue.  I can try to find a Linux box to build on...but I only have Windows.

-Dave

Stan Lewis

unread,
Sep 21, 2018, 6:31:02 AM9/21/18
to David Hoffer, sato.ta...@gmail.com, abri...@redhat.com, haw...@googlegroups.com
The main problem is the commands strung together with &&, that only works for bash.  When I used windows I'd use a cygwin bash shell to deal with this.  Or if you've windows 10 handy the Linux subsystem works really well.

Otherwise we could stand to make the build more windows friendly and replace the && with another approach in the package.json scripts, the goal is to just sequentially execute commands if they succeed and stop if one fails.

David Hoffer

unread,
Sep 21, 2018, 2:05:59 PM9/21/18
to abri...@redhat.com, gash...@gmail.com, Tadayoshi Sato, haw...@googlegroups.com
I got the latest code and yes this part is building on Windows now...got a failure in hawtio-karaf but that doesn't concern me to much as the module I need built correctly.

However I was told the static resources would be in hawtio-console-assembly/dist/ and that doesn't look to be correct.  There is an index.html, login.html, etc but these just reference scripts in the lib and js folder in the head section, the body section just has an empty element so there is no displayable content here.

So I still don't know where to find the static resources that I would put in my vertx application.

-Dave 

On Fri, Sep 21, 2018 at 4:49 AM Alexandre Briani Kieling <abri...@redhat.com> wrote:
The 'install-dependencies' in hawtio/hawtio-console-assembly/gulpfile.js was using the linux 'cp' command. I've replaced it with a gulp command, which is platform independent.
See if it solves the issue.
--
Alexandre Kieling
Sr. Software Engineer
Red Hat Fuse

David Hoffer

unread,
Sep 23, 2018, 10:53:30 AM9/23/18
to abri...@redhat.com, Stan Lewis, Tadayoshi Sato, haw...@googlegroups.com
Fundamentally what we are trying to do is use Hawtio in a clustered Vertx server application.  Vertx is a reactive micro-service framework for the JVM.

We are using Hawtio for its metrics feature https://vertx.io/docs/vertx-dropwizard-metrics/java/

That link discusses using Hawtio in this section 'Using Jolokia and Hawtio' but it doesn't say how to host Hawtio so that is our problem.

For all of our other web apps in our vertx app we just use the builtin HTTP server for which Vertx uses Netty.  It's just a folder structure in a jar where the top level is referred to as the 'webroot', it loads the web app from that location.  Ideally we would like the same thing here, no wars, no embedded http server (we already have that), nothing but the web html, js, css, etc. (If there are additional jars for server side that is fine, we would just add to the classpath of the vertx module.)

The link you provided above doesn't seem to be what we are looking for as that requires including a war in our app which isn't really what we are looking for.

-Dave

-Dave

On Sun, Sep 23, 2018 at 5:16 AM Alexandre Briani Kieling <abri...@redhat.com> wrote:
Are you trying to embed the Web app in a Java application?

David Hoffer

unread,
Sep 24, 2018, 10:39:44 AM9/24/18
to abri...@redhat.com, Stan Lewis, Tadayoshi Sato, haw...@googlegroups.com
Hum...there doesn't seem to be a clean way to add this to a vert.x application.  If I use the  http://hawt.io/docs/get-started/#using-hawtio-embedded-in-a-java-application approach what port does the web UI run on?  Can I customize that?

-Dave

On Mon, Sep 24, 2018 at 6:40 AM Alexandre Briani Kieling <abri...@redhat.com> wrote:
OK, got it.

Hawtio is composed of a client-side and a server-side. The server-side includes some Java servlets and filters and works as a proxy to the Jolokia endpoint. You might be able to use just the client side but not without changes to your app.
The client app is in hawtio-console-assembly/dist/. After you run "yarn run build", you should have everything there.

This gulp task serves the client app for development:


abri...@redhat.com

unread,
Sep 24, 2018, 4:20:59 PM9/24/18
to hawtio
It might be simpler to expose a Jolokia endpoint in your vert.x application and remotely connect to it using the Hawtio standalone app.

Tadayoshi Sato

unread,
Sep 24, 2018, 9:25:52 PM9/24/18
to David Hoffer, Alexandre Briani Kieling, gash...@gmail.com, hawtio
What kinds of static resources are you looking for?  Hawtio is essentially an anguarjs app so it's just composed of <body><hawtio-app></hawtio-app></body> and js/css libs.
Reply all
Reply to author
Forward
0 new messages