0

I am not able to monitor spring application through java-melody. Can some one help me on java-melody with spring configuration? when I pass the URL of spring application in java-melody then I should be able to see the monitoring window.

Bhushan Kawadkar
  • 28,279
  • 5
  • 35
  • 57
KP_JavaDev
  • 222
  • 2
  • 4
  • 11

2 Answers2

1

If your application is maven managed then just add javamelody dependency to you pom

  <dependency>
    <groupId>net.bull.javamelody</groupId>
    <artifactId>javamelody-core</artifactId>
    <version>1.55.0</version>
  </dependency>

If its not maven managed, then you can simply download and copy javamelody.jar and jrobin-x.jar to your WEB-INF/lib directory.

Once you have this, make sure you've defined java meleody filters in your web.xml

<filter>
    <filter-name>monitoring</filter-name>
    <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>monitoring</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
    <listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>

Above should give you basic monitoring at http://<host>:<port>/<context_root>/monitoring

For batch and business facaded you can follow the links as posted by @Pantelis. If you want to monitor SQLs executed, you can follow this link on the User guide - https://code.google.com/p/javamelody/wiki/UserGuide#7._JDBC

Hope this helps

Jay
  • 1,539
  • 1
  • 16
  • 27
0

JavaMelody user guide: https://code.google.com/p/javamelody/wiki/UserGuide

Basic configuration steps that you need:

  1. Add javamelody.jar and jrobin-x.jar in your classpath
  2. Add in your web.xml the monitoring filter and session listener as defined there: https://code.google.com/p/javamelody/wiki/UserGuide#2._web.xml_file
  3. You can define the business facades (eg service layer) in the Spring application context: https://code.google.com/p/javamelody/wiki/UserGuide#9._Business_facades_(if_Spring)
  4. You can also configure any batch jobs in the Spring application context: https://code.google.com/p/javamelody/wiki/UserGuide#13._Batch_jobs_(if_Quartz)

With steps 1 and 2 you will have a very basic performance report. I suggest that you read the user guide first.