生活随笔
收集整理的這篇文章主要介紹了
red5-server-1.0.6-RELEASE 启动异常
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 問題出現
當我試著去https://github.com/Red5/red5-server下載Red5的源碼,我是把自己編譯源碼的,
最終的Red5-server需要依賴其他幾個組件:
(1) red5-service
(2) red5-server-common
(3) red5-io
一次編譯完上面三個項目之后,開始輸入命令編譯red5-server,因為這個才是我們最終想要的流媒體服務器.
mvn
-Dmaven.test
.skip=true install
當讓有上面這一步還不夠:上面只是完成了編譯工作.我們還需要把red5運行的文件大成壓縮包。
mvn
-Dmaven.test
.skip=true clean package
-P assemble
這樣完成之后,你將會再red5-server的target目錄看到如下內容:
2 我首先會把red5-server-1.0.6-SNAPSHOT-server.zip復制到我常用的工作目錄中去.然后解壓該壓縮包。解壓之后看起來應該是這樣:
3 然后一起準備妥當,雙擊red5.bat ,會彈出一個新的黑色窗口.然后程序開始啟動.但是當我啟動過程中,意外的事情發生了.red5沒有像我想象的那么順利.卻拋出如下異常信息:
2015-
09-
08 13:
41:
12,
813 [Launcher:/oflaDemo] WARN o.s.w.c.s.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'web.scope' defined in ServletContext resource [/WEB-INF/red5-
web.xml]: Invocation of init method failed; nested exception is
java.lang.NoSuchMethodError:
org.red5.server.scope.Scope$ConcurrentScopeSet.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1574) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
539) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
476) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:
303) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
230) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
299) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
194) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
755) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
757) ~[spring-context-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
480) ~[spring-context-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:
485) [tomcatplugin-
1.9.jar:na]
Caused by:
java.lang.NoSuchMethodError:
org.red5.server.scope.Scope$ConcurrentScopeSet.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;at org.red5.server.scope.Scope$ConcurrentScopeSet.hasName(Scope.java:
1411) ~[red5-server-common-
1.0.6-
SNAPSHOT.jar:na]at
org.red5.server.scope.Scope.hasChildScope(Scope.java:
819) ~[red5-server-common-
1.0.6-
SNAPSHOT.jar:na]at
org.red5.server.scope.Scope.init(Scope.java:
872) ~[red5-server-common-
1.0.6-
SNAPSHOT.jar:na]at
org.red5.server.scope.WebScope.register(WebScope.java:
225) ~[red5-
server.jar:na]at
org.red5.server.scope.WebScope.afterPropertiesSet(WebScope.java:
111) ~[red5-
server.jar:na]at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1633) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1570) ~[spring-beans-
4.1.7.
RELEASE.jar:
4.1.7.RELEASE]...
10 common frames omitted
4 問題解決方法
導致問題代碼:
Caused by: java.lang.NoSuchMethodError: org.red5.server.scope.ScopeConcurrentScopeSet.keySet()Ljava/util/concurrent/ConcurrentHashMapKeySetView;
經過查閱資料最后發現是java版本的事,我的環境一直用的jdk7 原來keySet不適合java8以下版本,解決方法:將java版本跳到java8版本,或者直接重新安裝一個java8的jdk .
總結
以上是生活随笔為你收集整理的red5-server-1.0.6-RELEASE 启动异常的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。