1

Recently I added JavaMelody plugin to my site, but when I try to load in Firefox I got this message:

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression. Please contact the website owners to inform them of this problem.

There is a lot of information about that like clean cookies and cache, change network.http.accept-encoding value to true, etc. but when I run the project in development with Groovy/Grails Tools Suite this error does not appear. Because that I try different solutions and I found that there is not need to change Firefox properties. You need to follow the web.xml file setup but pay attention where you add this lines.

There are three elements: filter, filter-mapping and listener. You need to add each element in the first position in the relevant section, for example:

<web-app xmlns="http://java.sun.com/xml/ns/javaee" metadata-complete="true" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<display-name>/myweb</display-name>
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>myweb</param-value>
</context-param>
<context-param>
    <param-name>sample</param-name>
    <param-value>Sample Value</param-value>
</context-param>
<!-- filter javamelody first -->
<filter>
            <filter-name>monitoring</filter-name>
            <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
    </filter>

<filter>
    <!-- other filters -->
</filter>

<!-- filter-mapping javamelody first -->
    <filter-mapping>
            <filter-name>monitoring</filter-name>
            <url-pattern>/*</url-pattern>
    </filter-mapping>

<filter-mapping>
    <!-- others filter-mappings -->
</filter-mapping>

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

<listener>
 <!-- others listeners here -->
</listener>
<!-- others lines like servlets, etc -->

I have no more information but I think there is an order reading encoding in differents elements in this web.xml.

I hope it help, but feel free to add more information.

Fabricio
  • 11
  • 2

0 Answers0