java - 如何用blazeds+java+flex+tomcat实现一个web app?

标签 java apache-flex tomcat implementation blazeds

我正在用 flex blazeds 和 Java 编写一个网络应用程序。我安装了使用 WTP 混合项目的 Eclipse 插件。当我运行我的 flex 服务时,我正在使用 flex 的服务器,该服务器使用 tomcat 的模拟,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.messaging.endpoints.AMFEndpoint 类'.一切都在 flex 拥有的模拟服务器中运行良好。

最佳答案

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

关于java - 如何用blazeds+java+flex+tomcat实现一个web app?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2503670/

相关文章:

java - 在gradle中运行带参数的jar

apache-flex - Flex Builder 中的后期构建操作

database - 数据库连接自动重连

actionscript-3 - Flash Builder 因警告(绑定(bind)错误)而中断?

java - 从属 jar 不会部署到 tomcat,其中带有此 jar 的项目在工作区中打开

eclipse - 来自 Eclipse 的 tomcat 7 项目

java - glEnableVertexAttribArray 上的 OpenGL 2.0 ES 1281 错误

java - Android - 套接字关闭速度不够快

java - 为什么在android应用中使用jdbc是错误的?

flash - 在Actionscript中播放MXML SoundEffect