我的web应用环境:Struts 1.3.8 + Java JDK 1.6 + Tomcat 5.0.28 + WAFFLE认证
流程描述如下:
1. access /test_project/testAction.do to execute business logic in Struts Action handler, then save some attributes in session
2. forward to /test_project/test.jsp
3. open an applet in test.jsp, pass data to it from /test_project/TestSerlvet Servlet response. The Servlet will get attributes first from session, then response to client with xml data
在 Tomcat 5.0.28 中,它可以正常工作。当我尝试在 Tomcat 7 中运行应用程序时,我无法从 TestServlet 中的会话属性中获取值。检查tomcat日志文件后,我发现在Tomcat 7中,当GET /test_project/testSerlvet时,安全包会重新连接到不同的端口,然后它会生成一个新的会话,之前会话中的所有值都会丢失。这是日志:
/** start*/
10-Nov-2011 13:02:01 INFO {?:?} - GET /test_project/testAction.do, contentlength: -1
10-Nov-2011 13:02:01 INFO {?:?} - authorization required
10-Nov-2011 13:02:01 INFO {?:?} - GET /test_project/testAction.do, contentlength: -1
10-Nov-2011 13:02:01 INFO {?:?} - security package: Negotiate, connection id: 172.24.19.227:12755
10-Nov-2011 13:02:01 INFO {?:?} - token buffer: 53 byte(s)
10-Nov-2011 13:02:02 INFO {?:?} - continue token: TlRMTVNTUAACAAAACgAKADgAAAAFwomiaZrsOyIGARbofjQBAAAAALAAsABCAAAABQEoCgAAAA9FAEEARQBEADEAAgAKAEUAQQBFAEQAMQA
BABAAQwBRAEIAWQAwADAAMwAxAAQAJABwAGUAdAByAG8AbABlAHUAbQBwAGwAYQBjAGUALgBjAG8AbQADADYAQwBRAEIAWQAwADAAMwAxAC4AcABlAHQAcgBvAGwAZQB1AG0AcABsAGEAYwBlAC4AYwBvAG0ABQA
kAHAAZQB0AHIAbwBsAGUAdQBtAHAAbABhAGMAZQAuAGMAbwBtAAAAAAA=
10-Nov-2011 13:02:02 INFO {?:?} - continue required: true
10-Nov-2011 13:02:02 INFO {?:?} - GET /test_project/testAction.do, contentlength: -1
10-Nov-2011 13:02:02 INFO {?:?} - security package: Negotiate, connection id: 172.24.19.227:12755
10-Nov-2011 13:02:02 INFO {?:?} - token buffer: 72 byte(s)
10-Nov-2011 13:02:02 INFO {?:?} - continue required: false
10-Nov-2011 13:02:02 INFO {?:?} - successfully logged in user: *********
/** the block below is only in Tomcat 7 log*/
/** begin block*/
10-Nov-2011 13:31:18 INFO {?:?} - GET /test_project/TestServlet, contentlength: -1
10-Nov-2011 13:31:18 INFO {?:?} - authorization required
10-Nov-2011 13:31:18 INFO {?:?} - GET /test_project/TestServlet, contentlength: -1
10-Nov-2011 13:31:18 INFO {?:?} - security package: NTLM, connection id: 172.24.19.227:12883
10-Nov-2011 13:31:18 INFO {?:?} - token buffer: 53 byte(s)
10-Nov-2011 13:31:18 INFO {?:?} - continue token: TlRMTVNTUAACAAAACgAKADgAAAAFwomiJ+N+gNVCR+wo2DwBAAAAALAAsABCAAAABQEoCgAAAA9FAEEARQBEADEAAgAKAEUAQQBFAEQAMQA
BABAAQwBRAEIAWQAwADAAMwAxAAQAJABwAGUAdAByAG8AbABlAHUAbQBwAGwAYQBjAGUALgBjAG8AbQADADYAQwBRAEIAWQAwADAAMwAxAC4AcABlAHQAcgBvAGwAZQB1AG0AcABsAGEAYwBlAC4AYwBvAG0ABQA
kAHAAZQB0AHIAbwBsAGUAdQBtAHAAbABhAGMAZQAuAGMAbwBtAAAAAAA=
10-Nov-2011 13:31:18 INFO {?:?} - continue required: true
10-Nov-2011 13:31:18 INFO {?:?} - GET /test_project/TestServlet, contentlength: -1
10-Nov-2011 13:31:18 INFO {?:?} - security package: NTLM, connection id: 172.24.19.227:12883
10-Nov-2011 13:31:18 INFO {?:?} - token buffer: 72 byte(s)
10-Nov-2011 13:31:18 INFO {?:?} - continue required: false
10-Nov-2011 13:31:18 INFO {?:?} - successfully logged in user: *********
/** end block*/
/** codes below is same in both Tomcat 5.0.28 and Tomcat 7*/
10-Nov-2011 13:31:18 INFO {TestServlet.java:66} - ~~~~~~~~~>>> Start Point <<<~~~~~~~~~~
为什么安全包在 Tomcat 7 中打开新连接,但在 Tomcat 5 中保持连接?有谁知道问题是什么以及如何解决?
提前致谢。