The configuration is as follows:
1. Download the zip archive from http://code.google.com/p/javamelody/downloads/list
2. Unzip and copy javamelody.war to the Tomcat release directory
3. In the monitored project Add the following code to 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>
4. Copy javamelody.jar and jrobin-1.5.9.1.jar to the LIB directory of the monitored project
5. Start the Tomcat application server and access the javamelody application, such as http://localhost:8080/javamelody
ps: To monitor JDBC related status and action, you need to configure JDBC connection and interceptor separately, which is introduced in the official wiki
http://code.google.com/p/javamelody/wiki/UserGuide?tm=6#12._Struts_2_Actions
Here I choose in the hibernate connection configuration Configuration:
<prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> [b] <prop key="hibernate.connection.driver_class">net.bull.javamelody.JdbcDriver</prop> <prop key="hibernate.connection.driver">com.microsoft.sqlserver.jdbc.SQLServerDriver</prop>[/b] <prop key="hibernate.connection.url">${jdbc.url}</prop> <prop key="hibernate.connection.username">${jdbc.username}</prop> <prop key="hibernate.connection.password">${jdbc.password}</prop>