2012-07-26 56 views
0

我無法用Red5服務器創建我的應用程序。我有一個錯誤Red5。沒有範圍與我的項目

NetConnection.Connect.Rejected: No scope 'TestEcho' on this server. 
NetConnection.Connect.Closed 

我做了類似ping應用程序來測試一切工作正常。我的階級是這樣的:

package org.red5.core; 

import org.red5.server.adapter.ApplicationAdapter; 
import org.red5.server.api.IConnection; 
import org.red5.server.api.IScope; 
import org.red5.server.api.service.ServiceUtils; 

public class Application extends ApplicationAdapter { 

    public void appDisconnect(IConnection conn) 
    { 
     super.appDisconnect(conn); 
    } 


    public boolean appStart() 
    { 
     return true; 
    } 


    public void appStop() 
    {} 


    public boolean appConnect(IConnection conn, Object[] params) 
    { 
     return true; 
    } 


    public Object echo(Object p) 
    { 
     return p; 
    } 

} 

我也有RED5-web.xml和red5-web.properties

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> 
<beans> 

    <!-- 
    Defines a properties file for dereferencing variables 
    --> 
    <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
     <property name="location" value="/WEB-INF/red5-web.properties" /> 
    </bean> 

    <!-- 
    Defines the web context 
    --> 
    <bean id="web.context" class="org.red5.server.Context" 
     autowire="byType" /> 

    <!-- 
    Defines the web scopes 
    --> 
    <bean id="web.scope" class="org.red5.server.WebScope" 
     init-method="register"> 
     <property name="server" ref="red5.server" /> 
     <property name="parent" ref="global.scope" /> 
     <property name="context" ref="web.context" /> 
     <property name="handler" ref="web.handler" /> 
     <property name="contextPath" value="${webapp.contextPath}" /> 
     <property name="virtualHosts" value="${webapp.virtualHosts}" /> 
    </bean> 

    <!-- 
    Defines the web handler which acts as an applications endpoint 
    --> 
    <bean id="web.handler" 
     class="org.red5.core.Application" 
     singleton="true" /> 

</beans> 

而且

webapp.contextPath=/TestEcho 
webapp.virtualHosts=127.0.0.1 

所以,這是奇怪,但在迴音演示應用程序我無法連接到rtmp:// localhost:1935/TestEcho 而我想要注意的是演示應用程序很好用,例如,oflaDemo。問題在哪裏?......

回答

3

你使用哪個版本? 如果使用RED5 1.0,請用

<bean id="web.scope" class="org.red5.server.scope.WebScope" init-method="register"> 

代替

<bean id="web.scope" class="org.red5.server.WebScope" init-method="register"> 
+0

文件名?另一個-1 – David 2013-02-17 06:47:14

1

我在Red5的一個bigginer。我也遇到了同樣的問題。搜索後,我找到了很多論壇。在我的搜索過程中,我也瀏覽了您的查詢。所以我認爲如果我在這裏發佈解決方案會很有幫助。

問題是有重複的red5.jar文件。在我的場景中,我在RED5_HOME中有一個jar文件,而在myapp/WEB-INF/lib文件夾中有另一個。我們不應該有兩個Red5.jar文件。 red5.jar必須位於RED5_HOME目錄中。所以我已經從myapp/WEB-INF/lib文件夾中刪除了所有包括red5.jar的jar。它解決了我的問題。

0

我只是有同樣的問題,這是virtualHost名稱的配置問題。

我通過將red5-web.propertieswebapp.virtualHosts=localhost更改爲webapp.virtualHosts=*進行了修復。

希望它可以幫助

0

檢查東西很簡單 - 如果你是在Windows上 - RED5安裝,默認情況下啓動服務。然後,您可能已經手動複製了另一個版本的red5--用於開發。這就是我發生的事 - 有一個Windows服務 - 運行red5 - 已經被遺忘了。而我實際上正在運行另一個red5版本的文件系統。