Red5启动多个应用时端口冲突的解决办法

启动多个Red5的应用时,报端口冲突的错误“Address already in use”(Windows下没有,Linux下报错):

 

2009-11-17 12:01:04,330 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] WARN  o.s.b.f.s.DisposableBeanAdapter - Couldn't find a destroy method named 'shutdown' on bean with name 'schedulingService'
2009-11-17 12:01:04,356 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:beanRefContext.xml], factory key [default.context]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'default.context' defined in URL [file:/u2ct/gs-tomcat/webapps/ls-1.0.0/WEB-INF/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:341) [spring-web-2.5.6.jar:2.5.6]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:195) [spring-web-2.5.6.jar:2.5.6]
    at org.red5.server.war.WarLoaderServlet.contextInitialized(WarLoaderServlet.java:120) [jakubiak-red5-core-0.9-SNAPSHOT.jar:na]
    at com.todream.location.server.LocationServerStartupListener.contextInitialized(LocationServerStartupListener.java:22) [LocationServerStartupListener.class:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934) [catalina.jar:na]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) [catalina.jar:na]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1274) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296) [catalina.jar:na]
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) [catalina.jar:na]
    at java.lang.Thread.run(Thread.java:619) [na:1.6.0_06]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'default.context' defined in URL [file:/u2ct/gs-tomcat/webapps/ls-1.0.0/WEB-INF/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.6.jar:2.5.6]
    at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_06]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:141) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:384) [spring-beans-2.5.6.jar:2.5.6]
    ... 20 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248) [spring-beans-2.5.6.jar:2.5.6]
    ... 36 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.6.jar:2.5.6]
    at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_06]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) [spring-context-2.5.6.jar:2.5.6]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.6.0_06]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [na:1.6.0_06]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [na:1.6.0_06]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [na:1.6.0_06]
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) [spring-beans-2.5.6.jar:2.5.6]
    ... 38 common frames omitted
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind(Native Method) [na:1.6.0_06]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) [na:1.6.0_06]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) [na:1.6.0_06]
    at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:251) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:48) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(AbstractPollingIoAcceptor.java:523) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$200(AbstractPollingIoAcceptor.java:65) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:407) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.0-M6.jar:na]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [na:1.6.0_06]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [na:1.6.0_06]
    ... 1 common frames omitted
2009-11-17 12:01:04,371 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] ERROR o.red5.server.war.WarLoaderServlet -
org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:beanRefContext.xml], factory key [default.context]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'default.context' defined in URL [file:/u2ct/gs-tomcat/webapps/ls-1.0.0/WEB-INF/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:389) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:341) [spring-web-2.5.6.jar:2.5.6]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:195) [spring-web-2.5.6.jar:2.5.6]
    at org.red5.server.war.WarLoaderServlet.contextInitialized(WarLoaderServlet.java:120) [jakubiak-red5-core-0.9-SNAPSHOT.jar:na]
    at com.todream.location.server.LocationServerStartupListener.contextInitialized(LocationServerStartupListener.java:22) [LocationServerStartupListener.class:na]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934) [catalina.jar:na]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) [catalina.jar:na]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1274) [catalina.jar:na]
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296) [catalina.jar:na]
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) [catalina.jar:na]
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) [catalina.jar:na]
    at java.lang.Thread.run(Thread.java:619) [na:1.6.0_06]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'default.context' defined in URL [file:/u2ct/gs-tomcat/webapps/ls-1.0.0/WEB-INF/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.6.jar:2.5.6]
    at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_06]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:141) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:384) [spring-beans-2.5.6.jar:2.5.6]
    ... 20 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248) [spring-beans-2.5.6.jar:2.5.6]
    ... 36 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rtmpTransport' defined in class path resource [red5-core.xml]: Invocation of init method failed; nested exception is java.net.BindException: Address already in use
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) [spring-beans-2.5.6.jar:2.5.6]
    at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_06]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) [spring-beans-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) [spring-context-2.5.6.jar:2.5.6]
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) [spring-context-2.5.6.jar:2.5.6]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.6.0_06]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [na:1.6.0_06]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [na:1.6.0_06]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [na:1.6.0_06]
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) [spring-beans-2.5.6.jar:2.5.6]
    ... 38 common frames omitted
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind(Native Method) [na:1.6.0_06]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) [na:1.6.0_06]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) [na:1.6.0_06]
    at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:251) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:48) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(AbstractPollingIoAcceptor.java:523) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$200(AbstractPollingIoAcceptor.java:65) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:407) [mina-core-2.0.0-M6.jar:na]
    at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.0-M6.jar:na]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [na:1.6.0_06]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [na:1.6.0_06]
    ... 1 common frames omitted

 

解决办法:修改red5-core.xml:

1:  <bean class="java.net.InetSocketAddress">
2:      <constructor-arg index="0" type="java.lang.String"
3:          value="0.0.0.0" />
4:      <constructor-arg index="1" type="int" value="1935" />
5:  </bean>

 

换一个端口,例如把1935换成19350:

1:  <bean class="java.net.InetSocketAddress">
2:      <constructor-arg index="0" type="java.lang.String"
3:          value="0.0.0.0" />
4:      <constructor-arg index="1" type="int" value="19350" />
5:  </bean>

这时再启动就正常了。但是如果客户端仍然用“rtmp://192.168.0.xxx/app”连接时是连不上服务器的。需要将rui换成:“rtmp://192.168.0.xxx:19350/app”,要加上服务器端配置的端口

你可能感兴趣的:(java,spring,应用服务器,bean,Mina)