5608057 / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Javamelody swallows response if Spring WebAsyncTask/Callable is used #338

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. unzip test.zip
2. build maven test project
3. run without javamelody, http://localhost:8080/test/test -> all working
4. uncomment javamelody in pom.xml and rebuild
5. run with javamelody, http://localhost:8080/test/test -> async tests failing 
with empty response except @ResponseBody or redirect:/ is used

What is the expected output? What do you see instead?
All should work

What version of the product are you using? On what application server, JDK,
operating system?
   Java 6 or 7
   Tomcat 7.0.42

Please provide any additional information below.

Original issue reported on code.google.com by mfrey0@gmail.com on 10 Sep 2013 at 1:24

Attachments:

GoogleCodeExporter commented 8 years ago
I have reproduced the issue (using tomcat7-maven-plugin).

It seems to be caused by CounterServletResponseWrapper in doFilter at:
https://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/mai
n/java/net/bull/javamelody/MonitoringFilter.java#184

I do not know at the moment what needs to be changed in MonitoringFilter, 
CounterServletResponseWrapper or FilterServletResponseWrapper

Original comment by evernat@free.fr on 14 Sep 2013 at 12:54

GoogleCodeExporter commented 8 years ago
I have added the javamelody dependency in pom.xml and I have added the 
following plugins in pom.xml:
            <plugin>
                <!-- Use "mvn tomcat7:run" -->
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <port>8080</port>
                    <path>/</path>
                </configuration>
            </plugin>

            <plugin>
                <!-- Use "mvn jetty:run" -->
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.1.0.RC1</version>
                <configuration>
                    <contextPath>/</contextPath>
                </configuration>
            </plugin>

And I have tested all (11) tests in http://localhost:8080/test.html

When using "mvn tomcat7:run" (tomcat v7.0.37), 4 tests do not working and 7 
tests do work (4 results become blank after a click).
Tomcat 8.0 RC5 seems to give the same as tomcat 7.0.37.
When using "mvn jetty:run" (jetty 9.1.0.RC1), all 11 tests do work.

So I think that this may be an issue in tomcat 7 and 8.

What do you think?

Original comment by evernat@free.fr on 11 Nov 2013 at 12:14

GoogleCodeExporter commented 8 years ago
Here is attached a simplified version (test-V2.zip) of the sources of the 
project to make easier the reproduction of the issue.
I will post a message in the users' group about this issue:
https://groups.google.com/forum/#!forum/javamelody

Do you know if this is a Tomcat issue, or a javamelody issue, or a Spring issue?

Original comment by evernat@free.fr on 1 Dec 2013 at 7:09

Attachments:

GoogleCodeExporter commented 8 years ago
I'm not sure if I need to report a new bug, or attach to this one, but I'm 
having async issues in Tomcat 8. I put JavaMelody in web.xml file on Tomcat, so 
it monitored every webapp. I then ran the async examples that came with Tomcat 
(http://localhost:8080/examples/async/async1). With JavaMelody in place, the 
examples never return. If I remove JavaMelody, then the async returns 
immediately. I don't really care about the examples, my app which is a Vaadin 
app that depends on the Atmosphere frame work, also doesn't work with the same 
symptoms.

Original comment by andrew.s...@ipacc.com on 14 Feb 2014 at 3:16

GoogleCodeExporter commented 8 years ago
@andrew
Here was good.

Original comment by evernat@free.fr on 1 Mar 2014 at 10:02

GoogleCodeExporter commented 8 years ago
Attached an update of the test project (test-V3.zip) to include javamelody-core 
1.56.0 in pom.xml.

Test steps:
1. unzip test-V3.zip
2. mvn tomcat7:run
3. open http://localhost:8080/ -> some buttons do not work, with javamelody
4. mvn jetty:run
5. open http://localhost:8080/ -> all buttons work, with javamelody
6. comment javamelody in pom.xml
7. mvn tomcat7:run
8. open http://localhost:8080/ -> all buttons work, without javamelody

Original comment by evernat@free.fr on 13 Jun 2015 at 5:06

Attachments:

GoogleCodeExporter commented 8 years ago
@andrew
By the way, I do not reproduce your issue with Tomcat examples, using Tomcat 
8.0.14.

Original comment by evernat@free.fr on 14 Jun 2015 at 12:34

GoogleCodeExporter commented 8 years ago
After a discussion with Mark from Tomcat an issue was created there:
https://bz.apache.org/bugzilla/show_bug.cgi?id=58063

And Violeta has written an answer:
In Javamelody web fragment, the filter MonitoringFilter must specify dispatcher 
type ASYNC.

Regards,
Violeta

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

This answer closes this quite old defect and Violeta Georgieva can be thanked 
for that.

This is committed in trunk (revision 4094) and ready for the next release 
(1.57).
The web.xml example in UserGuide is also fixed:
https://code.google.com/p/javamelody/wiki/UserGuide#2._web.xml_file

Original comment by evernat@free.fr on 2 Jul 2015 at 7:20