Jetty Request Missing ServletContext

Marvin Addison marvin.addison at gmail.com
Thu Mar 17 16:53:44 EDT 2016


On Wed, Mar 16, 2016 at 10:57 AM Marvin Addison <marvin.addison at gmail.com>
wrote:

>  I'll continue to investigate and follow up as I have more information.
>

After a lot of tedious debugging sessions, I have a smoking gun. I have no
idea why the gun is smoking, but it looks like a case of stale Request data
getting into the Velocity template.

This is the Jetty Request when things work:
-------------------------------------------
This is the request passed to FrameworkServlet.
Request(GET
https://eiger.middleware.vt.edu:8443/profile/Logout?execution=e2s1)@19569171
"qtp1239759990-99 at 13622" prio=5 tid=0x63 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
    at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
    ...
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)

The request passed to the velocity template is the same and everything
works as expected.

Later, when it breaks....
-------------------------
The request that gets passed to FrameworkServlet is different from what
gets into the Velocity template. Following is what goes into
FrameworkServlet.
Request(GET
https://eiger.middleware.vt.edu:8443/profile/Logout?execution=e2s1)@4be33ee9
"qtp1239759990-107 at 13784" prio=5 tid=0x6b nid=NA runnable
  java.lang.Thread.State: RUNNABLE
    at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
    ...
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)

Following is the original Request object from when things worked, but is
clearly not the current request object, suggesting it's hanging around
incorrectly.
Request(null null)@19569171
"qtp1239759990-107 at 13784" prio=5 tid=0x6b nid=NA runnable
  java.lang.Thread.State: RUNNABLE
    at org.eclipse.jetty.server.Request.getServletContext(Request.java:1456)
    at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source:-1)
    ...
    at
org.springframework.web.servlet.view.velocity.VelocityView.mergeTemplate(VelocityView.java:517)
    ...
    at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
    ...
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)

As I said, I have no idea how or why this is happening, but at least it
explains the behavior and we can hopefully investigate further.

M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160317/098fb75d/attachment.html>


More information about the dev mailing list