Using javamelody with JBoss and Glassfish 3

738 views
Skip to first unread message

Ilja.s

unread,
Feb 4, 2010, 9:17:17 AM2/4/10
to javamelody
Hello,

Thanks for a very nice tool.

I have a question about using the javamelody with glassfish3.
I't is easy to use javamelody with JBoss. Only adding lib to the
Root.war and to configure web.xml and it's working! Does putting
javamelody to ROOT.war helps you to monitor JBoss completely or you
must do it for evrey application you deploy?

Using glassfish 3 it's also possible to use javamelody with every
single deployed application. Is it possible to use javamelody with
glassfish similar to that of JBoss in ROOT.war?

Thanks a lot,

Ilja.s

Emeric Vernat

unread,
Feb 4, 2010, 4:48:27 PM2/4/10
to javam...@googlegroups.com
Hello,

You are welcome.
And Antonio will possibly correct me if I'm wrong on Glassfish/JBoss.

First, you have probably found a new use case for JavaMelody without
knowing it: I think you have used JavaMelody only to monitor JBoss and
to do charts (I would be interested to know if it is just that).
JavaMelody is more than that: it is made to monitor each of your webapps
(including the JBoss or Glassfish servers of your webapps). For example,
it will give you statistics of your http requests, of your sql requests,
of your logs and if needed statistics of your ejb3/spring services and
monitoring of your database, http sessions...

I'm back now to your use case of monitoring only JBoss/Glassfish servers
(which is a good one and which I should make easier).
I think you made a simple ROOT.war and you deployed it to JBoss. JBoss
made it the default root context, because JBoss specifically considers a
file named ROOT.war as said in
http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e22086

I do not think that other servers like Glassfish3 have the same handling
of ROOT.war files.
But you can easily make a simple war file with JavaMelody and named
"me.war" for example and usable at http://localhost:8080/me/monitoring
To deploy it as the root context in Glassfih, you just need to add in
the directory WEB-INF of this "me.war" file, a "sun-web.xml" file with
content :
<sun-web-app>
<context-root>/</context-root>
</sun-web-app>

It will be usable at http://localhost:8080/monitoring

bye, Emeric

Le 04/02/2010 15:17, Ilja.s a �crit :

Darren Hartford

unread,
Feb 5, 2010, 8:44:36 AM2/5/10
to javam...@googlegroups.com
Hi Ilja,
As Emeric mentioned, javamelody is usually used on a per-application deploy -- however, I could see this scenario, let me know if this might be your intent:

*You have a lot of RMI, Webservices, REST interfaces, JMS, or similar middleware running on jboss, and that is what you want to monitor. In this scenario, I think what you are doing is correct.

If you have other WAR deployment/applications, and you are interested in monitoring those HTTP/Servlet requests, I think you need to adjust the approach (again as Emeric was talking about) so that, yes, each WAR needs to have javamelody setup. In your ROOT.war approach, are you able to see HTTP requests for other WAR's deployed?

HTH,
-D

--- On Thu, 2/4/10, Ilja.s <Ilj...@web.de> wrote:

Ilja.s

unread,
Feb 8, 2010, 3:43:45 AM2/8/10
to javamelody

Hi Emeric, hi Darren,

My intention was to monitor all the resources that a jboss or a
glassfish server can be applied to. It means both the servers and all
the possible application activities running on those servers. For some
use cases it might be possible to monitor a single application. I'm
trying to test different use cases for jboss and glassfish and try to
post the results later.

With best regards,

Ilja

Ilja.s

unread,
Feb 9, 2010, 8:02:10 AM2/9/10
to javamelody

Hello,

I've made some tests and found some problems within them.

1) First i tried to test a web application with database on glassfish
3. The database is located on a remote server. Javamelody didn't show
any results about mysql or jdbc activities.

2) When I put javamelody to ROOT.war of JBoss and trying to do the
same with glassfish so that you can call for glassfish http://your-host:port/monitoring
(both running on the same server with solaris os), both Jboss and
glassfish write there data to the same files.

3) Tested on glassfish like in 1) using javamelody only for the peer
web application. The generated data wasn't rendered at
http://your-host:port/monitoring.

It would be great to hear your comments.

With best regards,

ilja

evernat

unread,
Feb 9, 2010, 4:44:20 PM2/9/10
to javamelody
Hi ilja,

1) You deployed javamelody.jar in your webapp and not in ROOT.war did
you ?
Did you use a JNDI datasource ? (JNDI datasources are supposed to be
automatically detected and monitored, glassfish and jboss included)
If yes, can you say how and when this jndi datasource is looked up ?
Did you use an ear or resource injection ?

Sql requests via jdbc could definitively be monitored, with all
application servers, but sometimes your setup makes it more
difficult : I, and perhaps others, could help if you have the time for
that.

2) Yes, if you use javamelody with the same physical server, and with
the same webapp context, in glassfish then in jboss, and if glassfish
and jboss share the same directory for java.io.tmpdir, effectively
data will be written to the same files.
Because it is not a real use case, I do not think that it is a bug
(but perhaps it is a feature ;-).

3) I did not understand what was the setup this time and what was the
difference with 1).
Could you help me this time ?

bye, Emeric


On Feb 9, 2:02 pm, "Ilja.s" <Ilj...@web.de> wrote:
> Hello,
>
> I've made some tests and found some problems within them.
>
> 1) First i tried to test a web application with database on glassfish
> 3. The database is located on a remote server. Javamelody didn't show
> any results about mysql or jdbc activities.
>
> 2) When I put javamelody to ROOT.war of JBoss and trying to do the

> same with glassfish so that you can call for glassfishhttp://your-host:port/monitoring


> (both running on the same server with solaris os), both Jboss and
> glassfish write there data to the same files.
>
> 3) Tested on glassfish like in 1) using javamelody only for the peer

> web application. The generated data wasn't rendered athttp://your-host:port/monitoring.

Reply all
Reply to author
Forward
0 new messages