一个 Flex 客户端使用 BlazeDS 连接到两个 Web 应用程序 - 检测到重复的基于 HTTP 的 FlexSession
我有一个 Flex 应用程序,它通过 BlazeDS 与单个 Tomcat 实例中运行的两个 Web 应用程序进行通信。
Flex 客户端由浏览器从第一个 Web 应用程序加载,一切正常。但是,在首次调用第二个 Web 应用程序时,客户端收到以下错误:
检测到重复的基于 HTTP 的 FlexSession,通常是由于远程主机禁用会话 cookie。必须启用会话 cookie 才能正确管理客户端连接。
对同一服务方法的后续调用会成功。
我看过一些帖子,在两个 Flex 应用程序从同一浏览器页面调用单个 Web 应用程序的上下文中提到相同的错误,但似乎没有任何内容对我的情况有帮助 - 所以如果有人可以提供帮助,我将非常感激出去......
干杯,马克
I have a flex application that communicates via BlazeDS with two webapps running inside a single instance of Tomcat.
The flex client is loaded by the browser from the first webapp and all is well. However on the initial call to the second webapp the client receives the following error:
Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.
Subsequent calls to the same service method succeed.
I've seen a few posts around referring to the same error in the context of two flex apps calling a single webapp from the same browser page, but nothing which seems to help my situation - so I'd be very grateful if anyone could help out....
Cheers, Mark
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为您提供三个潜在的解决方案:
我曾经发现,如果我在设置消息通道之前点击远程对象,那么 CientID 就会搞砸。一旦应用程序加载,在进行任何远程对象调用之前,尝试建立一个初始消息通道。
Flash Builder 的网络监控工具可能会导致 BlazeDS 出现一些问题。我在应用程序加载上设置了一个配置选项,用于检查我是否处于开发环境中(在设置 #1 的通道之前调用它)。如果我在开发部门,我会手动分配一个 UID。由于某种原因,这在开发环境之外并不能很好地发挥作用...自从我将其全部设置好以来已经有一段时间了,所以我不记得为什么要这样做:
BlazeDS 默认情况下只允许单个 HTTP 会话根据客户端/浏览器进行设置。在我的流媒体通道定义中,我添加了以下内容以允许每个浏览器进行额外的会话:
Three potential solutions for you:
I found once that if I hit a remote object before setting up a messaging channel then the CientID would get screwed up. Try to establish an initial messaging channel once the application loads, and before any remote object calls are made.
Flash Builder's network monitoring tool can cause some problems with BlazeDS. I set up a configuration option on application load that checks to see if I'm in the dev environment (it is called just before setting up my channel from #1). If I'm in dev, I assign a UID manually. For some reason this doesn't take well outside the dev environment... been awhile since I set it all up so I can't remember the finer points as to why:
BlazeDS by default only allows for a single HTTP session to be setup per client/browser. In my streaming channel definitions I added the following to allow for additional sessions per browser:
问题:当
flex.war
和Livecycle.lca
文件托管在 WebSphere Server 上的单独 JVM 中时,出现重复会话错误。解决方案:
在事件的命令文件内,在调用远程服务(Java 方法或 LC Process)之前,在执行方法中将
FlexClientId
设置为 null。我猜这种方法也可以在其他场景中使用,以防止重复会话错误。
Problem: Duplicate session errors when
flex.war
andLivecycle.lca
files are hosted in separate JVMs on WebSphere Server.Solution:
Inside the command file for the event, set
FlexClientId
to null in execute method before calling remote service (Java method or LC Process).Guess this approach can be used in other scenarios as well to prevent Duplicate session errors.