snippetjournal

– notes, snippet codes, and my journal

Install Java Melody

leave a comment »

Maven : pom.xml  tambahkan code berikut

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

Pada web.xml tambahkan mapping dan listener untuk java melody


<!--javamelody-->
 <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>

jika ingin memberikan hak akses pada java melody tambahkan konfigurasi di bawah ini :


<!--config login java melody-->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Monitoring</realm-name>
</login-config>
<security-role>
<role-name>monitoring</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>Monitoring</web-resource-name>
<url-pattern>/monitoring</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>monitoring</role-name>
</auth-constraint>
</security-constraint>
<!-- if SSL enabled (SSL and certificate must then be configured in the server)
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
-->
<!--javamelodyend-->

Pada konfigurasi tomcat di tambahkan user yang berhak mengakses java melody.

path : “C:\Users\xxAppData\Roaming\NetBeans\7.3\apache-tomcat-7.0.34.0_base\conf”

file : tomcat-users.xml


<role rolename="monitoring"/>
<user username="monitoring" password="monitoring" roles="monitoring"/>

Written by snippetjournal

August 19, 2013 at 7:57 am

Posted in Programming

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: