Search code examples
javatomcatjava-melody

JavaMelody - monitoring path param is ignored after JDK upgrade


After upgrade from Java7 to Java8_u60 JavaMelody's monitoring-path param defined in web.xml is being ignored. In the log does not contain any useful information. I was exploring the JavaMelody guide, but I have not found nothing.

The monitoring section was defined to path www.domain.com/xxx/monitoring but after Java upgrade is in the default location www.domain.com/monitoring. Does anyone have any experiences with this issue? my web.xml conf:

<filter>
    <filter-name>javamelody</filter-name>
    <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
        <param-name>monitoring-path</param-name>
        <param-value>/xxx/monitoring</param-value>
    </init-param>
    <init-param>
        <param-name>url-exclude-pattern</param-name>
        <param-value>/resources/.*</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>javamelody</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ASYNC</dispatcher>
</filter-mapping>

<listener>
    <listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>

Used technologies: JavaMelody 1.57.0, Apache Tomcat 7, Spring


Solution

  • As I mentioned in my comment, the solution is described in issue 459.

    • You can either config JavaMelody using context-param in your web.xml (by default JavaMelody is configured through web-fragment.xml in its jar file, so by using context params you override its settings in web.xml)
    • Or just use any other filter name instead of "monitoring" (in this case filter settings in web-fragment.xml are ignored, but settings from application web.xml are activated)