2012-07-26 55 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版本的文件系统。