我的网络应用环境: 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中的session属性获取值。在检查了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中保持连接?有谁知道问题是什么以及如何解决它?
提前致谢。