Adam Bien's Weblog

Wednesday Mar 14, 2012

LightFish--An OpenSource GlassFish Monitoring Tool And Screencast

LighFish is an opensource Java EE 6 application without any external dependencies which gathers and persists periodically GlassFish's monitoring data. LightFish is deployed on a Java EE 6 application server and usually remotely accesses a "GlassFish Under Stress" instance. The probes (snapshots) are gathered via REST, persisted into a relational DB for post-mortem analysis and pushed to Java FX 2 UI in real time via HTTP.

Features / Monitoring:

    Threads And Memory:
    Heap Size, Thread Count, Peak Thread Count
    Transactions:
    Commits and Rollbacks
    "Paranormal Activity" :-)
    Queued Connections, Errors and Busy Thread Count
    HTTP Sessions
    Active and Expired Sessions
    JDBC Pools
    Free and used connections, potential connection leaks, and the Length of the wait queue

Watch a walk-through LightFish screencast:

Enjoy monitoring!


NEW: Java EE 7 Testing and Quality Workshop

A book about rethinking Java EE Patterns

Comments:

Thanks Adam. It's a very helpful framework. Funnily, when I tried to deploy under Tomcat, I get an exception. Is that explicitly for GlassFish?
Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/lightfish]

Posted by Walid Aly on March 14, 2012 at 11:38 PM CET #

Sweet! I'm importing the git sources into NetBeans now!

Posted by Jeff on March 15, 2012 at 08:16 AM CET #

Just say the video from Javaone 2011 on parleys. Great presentation! I hope you will visit Javaone in 2012!

Posted by FF on March 15, 2012 at 03:40 PM CET #

Don't get it to run. In the logs following message appears when I try to activate monitoring:

Cannot fetch static server information Exception: java.lang.IllegalStateException: Cannot fetch static monitoring data because of: com.sun.jersey.api.client.UniformInterfaceException: GET http://172.27.11.13:4848/management/domain/version returned a response status of 302 Found

I suppose the basic authentication could be a problem, because usually you have to authenticate to access the REST interface of glassfish?

Posted by Jerome on March 15, 2012 at 06:50 PM CET #

Looks great! A small question: why are you using glassfish-embedded-all instead of the standard javaee-api?

Posted by shinzey on March 16, 2012 at 06:20 AM CET #

@Walid Aly,

LightFish won't run on Tomcat. WebContainers have nothing interesting to expose :-)

thanks for trying!,

adam

Posted by Adam Bien on March 16, 2012 at 09:07 AM CET #

@Jeff,

there is nothing to import. Just git clone and open the project :-)

adam

Posted by Adam Bien on March 16, 2012 at 09:09 AM CET #

@Jerome,

authentication is not implemented yet. I use LightFish for stress testing where the GlassFish under stress instance is destroyed and created before each test.

I hoped to avoid implementation of the authentication--it is relatively boring to the new features coming in the pipeline :-),

thanks!,

adam

Posted by Adam Bien on March 16, 2012 at 09:13 AM CET #

@Shinzey,

the reason is: http://www.adam-bien.com/roller/abien/entry/trouble_with_crippled_java_ee

thanks for the review!,

adam

Posted by Adam Bien on March 16, 2012 at 09:14 AM CET #

@FF,

I would really like to attend JavaOne 2012 - hopefully my submissions get approved.

see you in S.F.!

adam

Posted by Adam Bien on March 16, 2012 at 09:18 AM CET #

Also many thanks for this great tip with @DataSourceDefinition
... did not yet recognized that this is possible!

Regards,
Robert

Posted by Robert on March 16, 2012 at 12:01 PM CET #

The word Paranormal in the UI should be replaced by the word Abnormal.

Posted by skanga on March 16, 2012 at 09:01 PM CET #

@Skanga,

you are right, but there is no Abnormal Activity movie :-)

thanks!,

adam

Posted by Adam Bien on March 16, 2012 at 10:27 PM CET #

Really nice example of Java EE application! Just one "stupid" question:

In MonitoringController, is injected EntityManager supposed to be thread safe? I thought EntityManagerFactory was, but EntityManager not.

Posted by npen on March 18, 2012 at 12:53 AM CET #

@Npen,

thanks! Without EJBs EntityManager handling may become complicated: http://www.adam-bien.com/roller/abien/entry/jsf_jpa_ejb_bloat

thanks!,

adam

Posted by Adam Bien on March 22, 2012 at 09:34 PM CET #

I hat a problem with authorization too:

Cannot fetch static server information Exception: java.lang.IllegalStateException: Cannot fetch static monitoring data because of: com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:4848/management/domain/version returned a response status of 401 Unauthorized|#]

Would be nice to have ...

PS: With a trivial change it compiles with Java 1.6.

Posted by Juergen Schmied on March 23, 2012 at 11:25 AM CET #

I get following error using Glassfish 3.1 /java7

Invalid resource : java:global/jdbc/lightfish__pm

Posted by Anthos on July 23, 2012 at 11:17 AM CEST #

Unfortunately, the number of errors (Paranormal Activity tab) constantly increases. I have onlty lightfish deployed. There are no errors in the logs. I have no idea what happens.

Posted by Mark on December 30, 2012 at 01:17 AM CET #

I am getting the same problems as Mark the number of errors (Paranormal Activity tab) constantly increases.

I have installed Glaffish 3.1.2 Java on Ubuntu jdk is 1.7.

Is there something we are missing simply dropped lightfish in out of the box glassfish no other apps running

Thanks

Posted by Dimitri on January 31, 2013 at 08:00 PM CET #

Sound sliek a great tool,

but unfortunately I couldn't get it running.

Even after I removed all Java 7 stuff (I think I did a good job) I could compile it.

After that I got a exception like : Request is within the scope of a filter or servlet that does not support asynchronous operations

Even when I added <async-supported>true</async-supported> to my servlet in web.xml.

Posted by rvt on February 05, 2013 at 04:06 AM CET #

I put the lightfish.war in autodeploy dir but I get

Exception while loading the app : WELD-001202 Error parsing file:/usr/src/glassfish/glassfish/domains/domain1/applications/lightfish/WEB-INF/beans.xml
org.jboss.weld.exceptions.IllegalStateException: WELD-001202 Error parsing file:/usr/src/glassfish/glassfish/domains/domain1/applications/lightfish/WEB-INF/beans.xml

the autodeploy fail and continuosly I get this messages in server.log

EJB5070: Exception creating stateless session bean : [DomainInformation]

EJB5070: Exception creating stateless session bean : [ServerInformation]

etc.

Please help!

Posted by Giuseppe on April 09, 2013 at 09:09 PM CEST #

What about Apache TomEE? is possible to use lightfish with tomee?

Posted by JL Cetina on September 19, 2013 at 08:37 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
realworldpatterns.com
...the last 150 posts
...the last 10 comments
Links
License