Bug 463467 - Immediate session timeout when running in Tomcat (3.0 M6)
Summary: Immediate session timeout when running in Tomcat (3.0 M6)
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2015-03-30 10:18 EDT by Thomas Scheller CLA
Modified: 2015-05-06 06:49 EDT (History)
2 users (show)

See Also:


Attachments
example war file causing the timeout dialog. Deploy to tomcat. http://localhost:8080/M6-test/rap (4.04 MB, application/octet-stream)
2015-03-31 17:09 EDT, Thomas Scheller CLA
no flags Details
source code of example (4.04 MB, application/x-bzip)
2015-03-31 17:10 EDT, Thomas Scheller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Scheller CLA 2015-03-30 10:18:11 EDT
In Milestone release 6 released on 27.03.2015 the application immediately shows a timeout message when running in tomcat after loading first shell. It does not matter which operationsmode (JEE_COMPATIBILITY without display.sleep() loop or SWT_COMPATIBILITY with display.sleep() loop) is used.
In Milestone 5 this is working fine. I can repoduce this behaviour by exchanging bundles:
org.eclipse.rap.rwt_3.0.0.20150324-0943.jar (M6 does not work)
and
org.eclipse.rap.rwt_3.0.0.20150203-0901.jar (M5 works fine)

Running as RWT application inside eclipse works fine.
Comment 1 Ivan Furnadjiev CLA 2015-03-30 11:29:24 EDT
Interesting! In RAP 3.0M6 we finalized some planned changes related to application startup and request processing. I've just built and deployed our Examples Demo in Tomcat 8.0.3 and it's working as expected. Could you provide some additional information, simple test project and WAR arhive to reproduce the issue. How do you start your application - with GET or POST request? Any special environment - servlet filters, proxies??!! Without your additional input, I can't help much. Once it's reproducible, I'll address it with a higher priority.
Comment 2 Ivan Furnadjiev CLA 2015-03-30 11:53:24 EDT
... please try to clear the browser cache. The Web client (client.js) from M5 is not compatible with M6. If browser uses cached client.js, this could explain the problem.
Comment 3 Thomas Scheller CLA 2015-03-30 16:36:59 EDT
Clearing the browser does not solve the issue. I did also try with a new firefox profile.
When trying to create a stripped down example application I found the cause of this:
In META-INF I had a context.xml because I was playing with session failover with the following content:
==== SNIP ====
<Context cookies="false">
</Context>
==== SNAP ====
After removing this file everything works fine.

Does that mean that cookies are now required?
Comment 4 Ivan Furnadjiev CLA 2015-03-30 17:19:16 EDT
Thomas, I'm really interesting in the cause. Please create a test project (with WAR archive) in order to reproduce and investigate it.
Comment 5 Ivan Furnadjiev CLA 2015-03-30 17:30:01 EDT
... just tested with Tomcat 8.0.3 and RAP Examples Demo in Firefox with disabled cookies and everything (with URL rewriting) is working as expected. 

No... Cookies are not required.
Comment 6 Thomas Scheller CLA 2015-03-31 01:10:08 EDT
I will upload it tonight at about 21:00 UTC
Comment 7 Thomas Scheller CLA 2015-03-31 17:09:07 EDT
Created attachment 252058 [details]
example war file causing the timeout dialog. Deploy to tomcat. http://localhost:8080/M6-test/rap
Comment 8 Thomas Scheller CLA 2015-03-31 17:10:14 EDT
Created attachment 252059 [details]
source code of example
Comment 9 Thomas Scheller CLA 2015-03-31 17:11:53 EDT
If you remove META-INF/context.xml it works fine. With the context.xml it does not work. With M5 it works with and without context.xml
Comment 10 Ivan Furnadjiev CLA 2015-04-01 03:51:07 EDT
Since 3.0M6 we don't create the HTTP session (call request.getSession( true ) in RWTServlet) in the *startup GET* request, but in the first *initial POST* request. In case of disabled cookies (*Note:* Disabled by setting cookies="false" in META-INF\context.xml, but not by the browser), Tomcat creates two different HTTP session for two sequential POST requests. This leads to two different UI sessions. The result is correct "session timeout" response, as the second POST request, which is not initial POST request (with requestCounter=1), is running in a new UI session. If cookies are disabled in the browser everything is working fine. Calling request.getSession( true ) in the startup GET request fixes the issue, but I'm not sure if this is the proper way to fix it.
Comment 11 Ivan Furnadjiev CLA 2015-04-20 08:40:54 EDT
Fixed with change https://git.eclipse.org/r/#/c/45992/
Comment 12 Gunnar Wagenknecht CLA 2015-05-06 06:49:00 EDT
FYI, I observed the same issue on 3.0 M6. However, my environment is different. I'm using Jetty 9.2.9 embedded in Equinox OSGi. Updating to M7 fixed the issue for me.