簡體   English   中英

如何使用blazeds + java + flex + tomcat來實現Web應用程序?

[英]How to implement a web app with blazeds+java+flex+tomcat?

我正在用Flex Blazed和Java編寫Web應用程序的代碼。 我安裝了用於使用WTP混合項目的Eclipse插件。 我正在使用flex的服務器,當我運行我的Flex服務時,該服務器使用了tomcat的模擬,Web應用程序獲取了數據,一切正常。 問題是,當我復制項目時,flex生成的所有文件都在我的tomcat或熾熱的tomcat中,它不起作用,這是因為我想在服務器上實現我的應用,錯誤是:

"(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沒有找到類flex.messaging.endpoints.AMFEndpoint的一個用於我-AMF“ http://172.16.8.245:8400/IEC-BLAZEDS/messagebroker/amf ”。 所有這些在flex擁有的仿真服務器中都能正常工作。

確保web.xml具有用於messagebroker的servlet,並且BlazeDS庫位於WEB-INF / lib文件夾中。

我不知道您是否已經檢查過,但是由於Java版本的緣故,我有幾次相同的轉儲。 Flex服務器使用的Java版本可能與您的tomcat / blazeDS版本不同。

另外,您不應該在tomcat服務器中復制項目。 為什么不將您的應用程序發布在war文件中?

為了使開發更加容易,我直接在Flex Builder中工作,創建了一個混合的Flex / Java項目(這樣做是因為Java部分確實很輕巧),然后使該應用程序在Tomcat服務器中運行。 為了使我的應用程序在另一台服務器上運行,我首先確保該服務器使用與我在應用程序中使用的Java版本相同的Java版本(或更高版本),然后部署war文件。 技巧就完成了。

這種類型的問題很普遍。最近,我也遇到了這種問題。經過48小時的研究,我知道像在部署webapp時一樣,一個小錯誤會使這個錯誤變得很大。

您的錯誤消息: http : //172.16.8.245 : 8400/IEC-BLAZEDS/messagebroker/amf '

當您未完全部署在服務器Web應用程序中時,會出現此錯誤消息。 例如,您在計算機上tomcat下的webapps中創建了“ IEC-BLAZEDS”文件夾。 首先,檢查它在您的機器上是否正常運行。

現在,如果要在任何服務器及其相應的webapps文件夾中進行部署,請確保必須直接放置“ IEC-BLAZEDS”文件夾的副本。

肯定地,它將為您工作。 如上所述修改恢復了我的問題。

希望這對您有幫助。

-Tej Ilindra即將推出的Flex專業課程...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM