如何使用 blazeds+java+flex+tomcat 实现 Web 应用程序?

发布于 2024-08-26 10:37:30 字数 3707 浏览 4 评论 0原文

我正在用 Flex blazeds 和 Java 编写一个 Web 应用程序。我安装了 Eclipse 插件以使用 WTP 混合项目。我正在使用 Flex 的服务器,该服务器使用 Tomcat 的模拟,当我运行 Flex 服务时,Web 应用程序获取了数据,一切正常。问题是当我在我的tomcat或blazeds的tomcat中复制由flex生成的所有文件的项目时,它不起作用,这是因为我想在服务器上实现我的应用程序,错误是:

"(mx.messaging.messages::ErrorMessage)#0
  body = (Object)#1
  clientId = (null)
  correlationId = "B425A2A7-7D12-A982-7779-8CCBF669413C"
  destination = ""
  extendedData = (null)
  faultCode = "Client.Error.MessageSend"
  faultDetail = "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'"
  faultString = "Send failed"
  headers = (Object)#2
  messageId = "1CBC6020-0ED8-C4CC-3B77-8CCBF6D6621D"
  rootCause = (mx.messaging.events::ChannelFaultEvent)#3
    bubbles = false
    cancelable = false
    channel = (mx.messaging.channels::AMFChannel)#4
      authenticated = false
      channelSets = (Array)#5
        [0] (mx.messaging::ChannelSet)#6
          authenticated = false
          channelIds = (Array)#7
            [0] "my-amf"
          channels = (Array)#8
            [0] (mx.messaging.channels::AMFChannel)#4
          clustered = false
          connected = false
          currentChannel = (mx.messaging.channels::AMFChannel)#4
          initialDestinationId = (null)
          messageAgents = (Array)#9
            [0] (mx.rpc::AsyncRequest)#10
              authenticated = false
              autoConnect = true
              channelSet = (mx.messaging::ChannelSet)#6
              clientId = (null)
              connected = false
              defaultHeaders = (null)
              destination = "ADEscenario"
              id = "7D92EDF2-CF62-9545-BA11-8CCBF6691E6B"
              reconnectAttempts = 0
              reconnectInterval = 0
              requestTimeout = -1
              subtopic = ""
      connected = false
      connectTimeout = -1
      enableSmallMessages = true
      endpoint = "http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf"
      failoverURIs = (Array)#11
      id = "my-amf"
      mpiEnabled = false
      netConnection = (flash.net::NetConnection)#12
        client = (mx.messaging.channels::AMFChannel)#4
        connected = false
        objectEncoding = 3
        proxyType = "none"
        uri = "http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf"
      piggybackingEnabled = false
      polling = false
      pollingEnabled = true
      pollingInterval = 3000
      protocol = "http"
      reconnecting = false
      recordMessageSizes = false
      recordMessageTimes = false
      requestTimeout = -1
      uri = "http://{server.name}:{server.port}/IEC-BLAZEDS/messagebroker/amf"
      url = "http://{server.name}:{server.port}/IEC-BLAZEDS/messagebroker/amf"
      useSmallMessages = false
    channelId = "my-amf"
    connected = false
    currentTarget = (mx.messaging.channels::AMFChannel)#4
    eventPhase = 2
    faultCode = "Channel.Connect.Failed"
    faultDetail = "NetConnection.Call.Failed: HTTP: Failed: url: 'http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'"
    faultString = "error"
    reconnecting = false
    rejected = false
    rootCause = (Object)#13
      code = "NetConnection.Call.Failed"
      description = "HTTP: Failed"
      details = "http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf"
      level = "error"
    target = (mx.messaging.channels::AMFChannel)#4
    type = "channelFault"
  timestamp = 0
  timeToLive = 0"

我不知道为什么tomcat 找不到用于 my-amf 'http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'。一切都在 Flex 的模拟服务器中运行良好。

I'm coding a web app in flex blazeds and Java. I installed the Eclipse plugins for using WTP mixed project. I'm using flex's server that uses an emulate of tomcat when i ran my flex service the web app got the datas, everythings is ok. the problem is when i copy the project with all files generated by flex in my tomcat or the blazeds's tomcat, it doesn't work, this is becasue i want to implement my app on a server the error is:

"(mx.messaging.messages::ErrorMessage)#0
  body = (Object)#1
  clientId = (null)
  correlationId = "B425A2A7-7D12-A982-7779-8CCBF669413C"
  destination = ""
  extendedData = (null)
  faultCode = "Client.Error.MessageSend"
  faultDetail = "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'"
  faultString = "Send failed"
  headers = (Object)#2
  messageId = "1CBC6020-0ED8-C4CC-3B77-8CCBF6D6621D"
  rootCause = (mx.messaging.events::ChannelFaultEvent)#3
    bubbles = false
    cancelable = false
    channel = (mx.messaging.channels::AMFChannel)#4
      authenticated = false
      channelSets = (Array)#5
        [0] (mx.messaging::ChannelSet)#6
          authenticated = false
          channelIds = (Array)#7
            [0] "my-amf"
          channels = (Array)#8
            [0] (mx.messaging.channels::AMFChannel)#4
          clustered = false
          connected = false
          currentChannel = (mx.messaging.channels::AMFChannel)#4
          initialDestinationId = (null)
          messageAgents = (Array)#9
            [0] (mx.rpc::AsyncRequest)#10
              authenticated = false
              autoConnect = true
              channelSet = (mx.messaging::ChannelSet)#6
              clientId = (null)
              connected = false
              defaultHeaders = (null)
              destination = "ADEscenario"
              id = "7D92EDF2-CF62-9545-BA11-8CCBF6691E6B"
              reconnectAttempts = 0
              reconnectInterval = 0
              requestTimeout = -1
              subtopic = ""
      connected = false
      connectTimeout = -1
      enableSmallMessages = true
      endpoint = "http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf"
      failoverURIs = (Array)#11
      id = "my-amf"
      mpiEnabled = false
      netConnection = (flash.net::NetConnection)#12
        client = (mx.messaging.channels::AMFChannel)#4
        connected = false
        objectEncoding = 3
        proxyType = "none"
        uri = "http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf"
      piggybackingEnabled = false
      polling = false
      pollingEnabled = true
      pollingInterval = 3000
      protocol = "http"
      reconnecting = false
      recordMessageSizes = false
      recordMessageTimes = false
      requestTimeout = -1
      uri = "http://{server.name}:{server.port}/IEC-BLAZEDS/messagebroker/amf"
      url = "http://{server.name}:{server.port}/IEC-BLAZEDS/messagebroker/amf"
      useSmallMessages = false
    channelId = "my-amf"
    connected = false
    currentTarget = (mx.messaging.channels::AMFChannel)#4
    eventPhase = 2
    faultCode = "Channel.Connect.Failed"
    faultDetail = "NetConnection.Call.Failed: HTTP: Failed: url: 'http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'"
    faultString = "error"
    reconnecting = false
    rejected = false
    rootCause = (Object)#13
      code = "NetConnection.Call.Failed"
      description = "HTTP: Failed"
      details = "http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf"
      level = "error"
    target = (mx.messaging.channels::AMFChannel)#4
    type = "channelFault"
  timestamp = 0
  timeToLive = 0"

i don't know why tomcat doesn't find the class of flex.messaging.endpoints.AMFEndpoint that is used for my-amf 'http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'. all works well in the emulated server that flex has.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

最美的太阳 2024-09-02 10:37:30

确保 web.xml 具有用于消息代理的 servlet,并且 BlazeDS 库位于 WEB-INF/lib 文件夹中。

Make sure that the web.xml has a servlet for the messagebroker and that the BlazeDS libs are in your WEB-INF/lib folder.

虫児飞 2024-09-02 10:37:30

我不知道你是否检查过,但由于 java 版本的原因,我有时也会遇到相同的转储。
Flex 服务器可能使用与 Tomcat / blazeDS 不同的 Java 版本。

另外,您不应该在 tomcat 服务器中复制项目。为什么不在 war 文件中发布应用程序?

为了使开发更容易,我直接在 Flex Builder 中工作,创建一个混合的 Flex/Java 项目(我这样做是因为 Java 部分非常轻),并使应用程序在 Tomcat 服务器中运行。为了使我的应用程序在另一台服务器上运行,我首先确保该服务器使用与我在应用程序中使用的相同的 Java 版本(或更高版本),然后部署 war 文件。技巧就完成了。

I don't know if you've checked that, but I've had the same dump some times because of java versions.
The flex server may be using a different java version than your tomcat / blazeDS one.

Also, you shouldn't be copying your project in a tomcat server. Why don't you release your application in a war file?

What I do to make developments easier, I work directly in Flex Builder, creating a mixed Flex/Java project (I do that cause the Java part is really light), and making the application run in a Tomcat server. To make my application run in another server, I first make sure the server uses the same Java version (or later) as the one I used in my application and then I deploy the war file. And the trick is done.

反差帅 2024-09-02 10:37:30

这种类型的问题很常见。最近,我也遇到了这种问题。经过 48 小时的研究,我发现一个小错误会导致这个错误变得很大,就像我们在部署 webapp 时所做的那样。

您的错误消息:
http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'

当您未在服务器 web 应用程序中完美部署时,会出现此错误消息。
例如,您在计算机的 tomcat 下的 webapps 中创建了“IEC-BLAZEDS”文件夹。
首先,检查它是否在您的机器上正常运行。

现在,如果您要在任何服务器及其相应的 webapps 文件夹中进行部署,请确保必须直接放置“IEC-BLAZEDS”文件夹的副本。

毫无疑问,它会为你工作。如上修改恢复了我的问题。

希望这对您有帮助。

-泰吉·伊林德拉
即将推出的 Flex Professional...

This type of problem is common.Recently, me too had struggled with this type.After 48 hrs of my research, i came to know that a small mistake make this error big as we did during deployment of webapp.

your Error Message:
http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf'

This Error message occurs when you are not perfectly deployed in your servers webapp.
For example, you created "IEC-BLAZEDS" folder in webapps under tomcat in your machine.
First, check whether it is running properly in ur machine.

Now, if you are going to deploy in any server and in their corresponding webapps folder, make sure that copy of "IEC-BLAZEDS" folder must be directly placed.

Definitly, it will works for you. As above modification recoverd my problem.

Hope this is helpful to you.

-Tej Ilindra
An upcoming Flex Professioinal...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文