|
Hi , I’ve just tried to build my first webapp but I
have the following Problem : I created a new folder in the webapps folder called
/tester I created the META-INF folder with these files : - red5-web.properties webapp.contextPath=/tester webapp.virtualHosts=localhost,
127.0.0.1 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> <bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"
value="/WEB-INF/red5-web.properties" /> </bean> <bean id="web.context" class="org.red5.server.Context"
autowire="byType" /> <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> <bean id="web.handler" class="org.red5.server.adapter.ApplicationAdapter"
singleton="true" /> <!-- this will support calling methods through
"myhandler.<methodName>"--> <bean id="myhandler.service"
class="org.red5.server.webapp.tester.Application"
singleton="true" /> </beans> Web.xml <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>My sample Red5
application</display-name> <context-param> <param-name>globalScope</param-name> <param-value>default</param-value> </context-param> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/red5-*.xml</param-value> </context-param> <context-param> <param-name>locatorFactorySelector</param-name> <param-value>red5.xml</param-value> </context-param> <context-param> <param-name>parentContextKey</param-name> <param-value>default.context</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/log4j.properties</param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>/tester</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app> Application.java /
class package org.red5.server.webapp.tester; import org.red5.server.adapter.ApplicationAdapter; public class Application extends ApplicationAdapter { public int add(int a, int b){ return a + b; } } When I start Red5 I get the following Error : INFO | jvm 1 | 2006/11/13 22:30:31 | [ERROR] 5484
WrapperSimpleAppMain:( org.red5.server.JettyLoader.error ) Error loading jetty INFO | jvm 1 | 2006/11/13 22:30:31 | org.springframework.beans.factory.CannotLoadBeanClassException:
Cannot find class [org.red5.server.webapp.tester.Application] for bean with
name 'myhandler.service' defined in ServletContext resource [/WEB-INF/red5-web.xml];
nested exception is java.lang.ClassNotFoundException: org.red5.server.webapp.tester.Application INFO | jvm 1 | 2006/11/13 22:30:31 | Caused by: INFO | jvm 1 | 2006/11/13 22:30:31 | java.lang.ClassNotFoundException:
org.red5.server.webapp.tester.Application INFO | jvm 1 | 2006/11/13 22:30:31 | at java.net.URLClassLoader$1.run(URLClassLoader.java:200) INFO | jvm 1 | 2006/11/13 22:30:31 | at java.security.AccessController.doPrivileged(Native
Method) INFO | jvm 1 | 2006/11/13 22:30:31 | at java.net.URLClassLoader.findClass(URLClassLoader.java:188) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:349) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:320) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.util.ClassUtils.forName(ClassUtils.java:177) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:313) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:912) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:687) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:397) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:330) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:450) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1129) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:420) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:457) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:156) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:119) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.jetty.Server.doStart(Server.java:210) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.red5.server.JettyLoader.init(JettyLoader.java:102) INFO | jvm 1 | 2006/11/13 22:30:31 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) INFO | jvm 1 | 2006/11/13 22:30:31 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) INFO | jvm 1 | 2006/11/13 22:30:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) INFO | jvm 1 | 2006/11/13 22:30:31 | at java.lang.reflect.Method.invoke(Method.java:585) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1104) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1066) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:136) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:380) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.red5.server.Standalone.main(Standalone.java:136) INFO | jvm 1 | 2006/11/13 22:30:31 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) INFO | jvm 1 | 2006/11/13 22:30:31 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) INFO | jvm 1 | 2006/11/13 22:30:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) INFO | jvm 1 | 2006/11/13 22:30:31 | at java.lang.reflect.Method.invoke(Method.java:585) INFO | jvm 1 | 2006/11/13 22:30:31 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:136) INFO | jvm 1 | 2006/11/13 22:30:31 | at java.lang.Thread.run(Thread.java:595) The great Question is now : Where I Have to place my Application.class
or Application.java, so that Red5 will find it ? Tx in Advance Snooop |
_______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
