Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Use hawtio v2 instead of old v1 for jube #275

Open
davsclaus opened this issue Apr 25, 2015 · 14 comments
Open

Use hawtio v2 instead of old v1 for jube #275

davsclaus opened this issue Apr 25, 2015 · 14 comments
Assignees

Comments

@davsclaus
Copy link
Member

No description provided.

@davsclaus davsclaus self-assigned this Apr 25, 2015
@davsclaus
Copy link
Member Author

We are removing kubernetes and docker and whatnot from v1 as its no longer maintained there, and just add noise: hawtio/hawtio#1932

@davsclaus
Copy link
Member Author

This requires we make a little WAR app or something of v2, and/or install it by downloading it from github, which we can do like

https://github.com/apache/camel/blob/master/examples/camel-example-servlet-rest-tomcat/pom.xml#L103

@davsclaus
Copy link
Member Author

Using hawtio-kubernetes v2 and pointing the kube master to jube running local we get a bunch of errors. That is expected since jube hasn't been kept up to date with the development on the docker side.

2015-04-29 14:58:44,924 [qtp636336240-16] WARN  JAXRSUtils                     - No operation matching request path "/api/v1beta2/proxy/services/app-library-jolokia/jolokia/" is found, Relative Path: /proxy/services/app-library-jolokia/jolokia/, HTTP Method: POST, ContentType: text/json, Accept: application/json,text/javascript,*/*;q=0.01,. Please enable FINE/TRACE log level for more details.
2015-04-29 14:58:44,925 [qtp636336240-16] WARN  WebApplicationExceptionMapper  - javax.ws.rs.ClientErrorException: HTTP 404 Not Found
    at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117)
    at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:166)
    at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:529)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:177)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:744)

2015-04-29 14:58:45,144 [qtp636336240-16] WARN  JAXRSUtils                     - No operation matching request path "/api/v1beta2/proxy/services/app-library/apps" is found, Relative Path: /proxy/services/app-library/apps, HTTP Method: GET, ContentType: */*, Accept: application/json,text/plain,*/*,. Please enable FINE/TRACE log level for more details.
2015-04-29 14:58:45,146 [qtp636336240-16] WARN  WebApplicationExceptionMapper  - javax.ws.rs.ClientErrorException: HTTP 404 Not Found
    at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117)
    at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:166)
    at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:529)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:177)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:744)

@jstrachan
Copy link
Contributor

yeah that url: /api/v1beta2/proxy/services/app-library-jolokia/jolokia is trying to talk to the app library (for the Library tab) so this should proxy to the Services in kube/jube to find the service called "app-library-jolokia" then proxy the request "/jolokia" to that IP and port

@davsclaus
Copy link
Member Author

Oh this is new.

So there is an app called app-library from the quickstarts repo at
https://github.com/fabric8io/quickstarts/tree/master/apps/app-library

Is that the guy that needs to be running, and offer the REST services which hawtio v2 expects?

@jstrachan
Copy link
Contributor

Its not mandatory; if it doesn't run you shouldn't have a Library tab and there's no icons found on the Apps / Services / Controllers / Pods pages; and the Run... menu is empty.

At least to get a basic jube working we shouldn't require it. There might be places in hawtio v2 where we access the service via the proxy URL without first checking that there is a service of that name in the service registry first. i.e. to avoid errors in the log ;)

@davsclaus
Copy link
Member Author

Ah thanks all that level of indirection ;)

At first glance it seems v2 uses context path /kubernetes/api
Where as they are exposed as just /api in jube

@jstrachan
Copy link
Contributor

yeah; we probably wanna just get jube to forward /kubernetes/api/* to /api or something (ditto for osapi) (We've similar stuff to try expose /api/v1beta1 and /api/v1beta2 etc).

@davsclaus
Copy link
Member Author

Okay got a bit further but there is more steps to do

  • app library should likely be installed out of the box somehow - today its a manual step
  • it seems that some services uses /api/v1beta2 and others /kubernetes/api/v1beta2
  • hawtio v2 does not yet work on jube
  • osapi is not ported - exposed in jube
  • and then hawtio v2 requests favicon when something fails - I can't remember the exact why it does that by @gashcrumb would know
  • security, we may need keycloak or something to fit the role of the security - I think @gashcrumb added some OS3 script in the hawtio v2 console to delegate to its login page.

@davsclaus
Copy link
Member Author

If replacing hawtio v1 with v2 and using / as context-path (and not /hawtio) we can at least see the console, but it wont show data as the ws is not implemented etc, but its a start

screen shot 2015-05-19 at 10 32 08 am

davsclaus added a commit to davsclaus/jube that referenced this issue May 21, 2015
@davsclaus
Copy link
Member Author

There is a few old hawtio v1 modules that jube still uses, which we either need to port or remove the need for

  • hawtio-aether
  • hawtio-kubernetes
  • hawtio-swagger-ui
  • hawtio-maven-indexer

@davsclaus
Copy link
Member Author

  • hawtio-aether is now ported

@davsclaus
Copy link
Member Author

  • hawtio-kubernetes is now ported

@davsclaus
Copy link
Member Author

The jube code can now build and compile with hawtio-java v2.

The console does not yet work, there is some web socket and some other rest apis not yet working, but at least the console is shown.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants