2012-08-07 4 views
-1

내 red5 응용 프로그램을 webapps 폴더에 배포하려고합니다. 그러나! 출력에 약간의 오류가 있습니다. 내가 웹 어플리케이션에서 내 응용 프로그램 폴더를 가지고 그 모든 후 Red5 응용 프로그램 디버그

Exception in thread "Launcher:/myApp" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'web.context' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Unsatisfied dependency expressed through bean property 'clientRegistry': : Cannot find class [org.red5.core.Application] for bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.core.Application; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.core.Application] for bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.core.Application 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1147) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1040) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557) 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416) 
    at org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:594) 
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.core.Application] for bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.core.Application 
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1208) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:568) 
[INFO] [Launcher:/myApp] org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.s[email protected]1af1915: defining beans [placeholderConfig,web.context,web.scope,web.handler]; parent: org.s[email protected]46136 
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1277) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:302) 
    at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:185) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:805) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:762) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:680) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1132) 
    ... 11 more 
Caused by: java.lang.ClassNotFoundException: org.red5.core.Application 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484) 
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329) 
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:258) 
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1229) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1200) 
    ... 19 more 

,하지만 내 프로젝트의 클래스 폴더에 어떤을 .class 파일이 없습니다. 그래서, 내 클라이언트 애플 리케이션에서 서버 측 애플 리케이션을 사용할 수 없습니다. 무엇이 잘못 되었나요?

응용 프로그램이 기본적으로 작성되었습니다. 여기 내 RED5-web.xml을

<?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> 

그리고 내 응용 프로그램 클래스

package org.red5.core; 

/* 
* RED5 Open Source Flash Server - http://www.osflash.org/red5 
* 
* Copyright (c) 2006-2008 by respective authors (see below). All rights reserved. 
* 
* This library is free software; you can redistribute it and/or modify it under the 
* terms of the GNU Lesser General Public License as published by the Free Software 
* Foundation; either version 2.1 of the License, or (at your option) any later 
* version. 
* 
* This library is distributed in the hope that it will be useful, but WITHOUT ANY 
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 
* 
* You should have received a copy of the GNU Lesser General Public License along 
* with this library; if not, write to the Free Software Foundation, Inc., 
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
*/ 

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; 

/** 
* Sample application that uses the client manager. 
* 
* @author The Red5 Project ([email protected]) 
*/ 
public class Application extends ApplicationAdapter { 

    /** {@inheritDoc} */ 
    @Override 
    public boolean connect(IConnection conn, IScope scope, Object[] params) { 
     return true; 
    } 

    /** {@inheritDoc} */ 
    @Override 
    public void disconnect(IConnection conn, IScope scope) { 
     super.disconnect(conn, scope); 
    } 

} 

이클립스에서 Red5의 플러그인으로이 모든 것을 한 것입니다. 그래서 ... 나는 무엇이 잘못 될 수 있는지 전혀 모른다.

+0

오류를 곧장 게시하는 것은별로 도움이되지 않습니다. 오류가 발생한 곳에서 코드를 추가하고 파일을 참조하는 경우 파일 시스템에 대한 프레임 워크를 표시하십시오. –

+0

그것에 대해 더 많은 정보를 추가했습니다. –

답변

7

나는 똑같은 문제를 가지고 있었다. 새로운 Red5_1.0 만 사용하여 자습서 비디오를 따라하려고하는 것처럼 들립니다. 며칠 째, 맥주와 멍이 들려서 내 책상에 머리가 부딪혀서 red5-web.xml 파일에서 클래스를 "org.red5.server.scope.WebScope"로 변경하면 제대로 작동한다는 것을 발견했습니다. (bean id = "web.scope"). 또한 org.red5.core 소스 가져 오기를 "import org.red5.server.api.IScope;"에서 변경해야 할 수도 있습니다. 을 "import org.red5.server.api.scope.IScope;"로 변경하십시오. 분명히 Red5의 최신 버전에서 일부 클래스 리팩터링이 발생했습니다

+1

1.0 최종 버전 및 몇 가지 RC가 새 패키지를 사용해야합니다. Red5 코어의 범위는 "범위"패키지에 있습니다. 마지막으로 org.red5 네임 스페이스/패키지 공간을 사용하지 마십시오. 자신의 패키지를 앱용으로 사용하면 더 쉽게 사용할 수 있습니다. –

0

제 9 영역에서 언급 한 것처럼 클래스가 이미 "org.red5.server.scope.WebScope"로 설정되었지만 비슷한 오류가 발생했습니다. 매트의 대답. 나중에 webaps/chat/WEB-INF/아래에 lib 디렉토리가없는 것을 발견했습니다.

누구나 비슷한 문제가있는 경우 유용 할 수 있습니다.

관련 문제