AdamBien / lightfish

Payara / GlassFish Monitoring Utility
121 stars 41 forks source link

REST URL 404 not found #34

Open bernard01 opened 8 years ago

bernard01 commented 8 years ago

I cloned the GIT repo and ran the JavaFX app against a NetBeans registered GlassFish 4.1.1. Then I started the JavaFX app and clicked the Start button which caused the error.

In the GlassFish log:

Info: Retrieved JsonObject: null for InboundJaxrsResponse{context=ClientResponse{method=GET, uri=http://localhost:4848/monitoring/domain/server/jvm/thread-system/deadlockedthreads, status=404, reason=Not Found}} deadlockedthreads Warning: A system exception occurred during an invocation on EJB MonitoringController, method: public void org.lightfish.business.servermonitoring.boundary.MonitoringController.gatherAndPersist()

The problem clearly is the 404 error for the REST URL.

BTW earlier catching of the 404 could be:

RestDataCollector

public Response getResponse(String serverInstance, String uri) {
    String fullUri = getBaseURI(serverInstance) + uri;
    final Response response = getResponse(fullUri);
    if(response.getStatusInfo().getFamily() != Response.Status.Family.SUCCESSFUL){
        throw new RuntimeException("Invalid response: " + response);
    }
    return response;
}

Now it works after I activated monitoring. It appears that GlassFish has an initial state after installation where deadlockedthreads does not work. I could not reproduce the error later.