Red5 1.0.7M10:无法找到或加载主要 class 文件
Red5 1.0.7M10: Could not find or load main class Files
我打算在 Windows 2012 服务器上查看最新的 1.0.7,并下载了最新的 .zip。我将 .zip 解压缩到我的普通 Red5 目录 (d:\program files (x86)\Red5) 并尝试 运行 red5.bat 并得到错误,"Could not find or load main class Files"。但是,RED5_HOME 和 JAVA_HOME 没有改变。我错过了什么?
red5.bat 文件的输出:
D:\Program Files (x86)\Red5>if NOT DEFINED RED5_MAINCLASS set RED5_MAINCLASS=org
.red5.server.Bootstrap
D:\Program Files (x86)\Red5>if NOT DEFINED JAVA_HOME goto err
D:\Program Files (x86)\Red5>REM JAVA options
D:\Program Files (x86)\Red5>REM You can set JVM additional options here if you w
ant
D:\Program Files (x86)\Red5>if NOT DEFINED JVM_OPTS set JVM_OPTS=-Xverify:none -
XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseParNewGC -XX:InitialCodeCach
eSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=t
rue
D:\Program Files (x86)\Red5>REM Set up logging options
D:\Program Files (x86)\Red5>set LOGGING_OPTS=-Dlogback.ContextSelector=org.red5.
logging.LoggingContextSelector -Dcatalina.useNaming=true
D:\Program Files (x86)\Red5>REM Set up security options
D:\Program Files (x86)\Red5>REM set SECURITY_OPTS=-Djava.security.debug=failure
-Djava.security.manager -Djava.security.policy="D:\Program Files (x86)\Red5/conf
/red5.policy"
D:\Program Files (x86)\Red5>set SECURITY_OPTS=-Djava.security.debug=failure
D:\Program Files (x86)\Red5>REM Set up tomcat options
D:\Program Files (x86)\Red5>set TOMCAT_OPTS=-Dcatalina.home=D:\Program Files (x8
6)\Red5
D:\Program Files (x86)\Red5>REM Setup python/jython path
D:\Program Files (x86)\Red5>set JYTHON_OPTS=-Dpython.home=lib
D:\Program Files (x86)\Red5>REM Combined java options
D:\Program Files (x86)\Red5>set JAVA_OPTS=-Dlogback.ContextSelector=org.red5.log
ging.LoggingContextSelector -Dcatalina.useNaming=true -Djava.security.debug=fail
ure -Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseParNewGC
-XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quar
tz.skipUpdateCheck=true -Dcatalina.home=D:\Program Files (x86)\Red5 -Dpython.hom
e=lib
D:\Program Files (x86)\Red5>set RED5_CLASSPATH=D:\Program Files (x86)\Red5\red5-
service.jar;D:\Program Files (x86)\Red5\conf;
D:\Program Files (x86)\Red5>if NOT DEFINED RED5_OPTS set RED5_OPTS=
D:\Program Files (x86)\Red5>goto launchRed5
D:\Program Files (x86)\Red5>echo Starting Red5
Starting Red5
D:\Program Files (x86)\Red5>"D:\Program Files\Java\jdk8\bin\java" -Dlogback.Cont
extSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true -D
java.security.debug=failure -Xverify:none -XX:+TieredCompilation -XX:+UseBiased
Locking -XX:+UseParNewGC -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=3
2m -Dorg.terracotta.quartz.skipUpdateCheck=true -Dcatalina.home=D:\Program Files
(x86)\Red5 -Dpython.home=lib -cp "D:\Program Files (x86)\Red5\red5-service.jar;
D:\Program Files (x86)\Red5\conf;" org.red5.server.Bootstrap
Java HotSpot(TM) 64-Bit Server VM warning: Using the ParNew young collector with
the Serial old collector is deprecated and will likely be removed in a future r
elease
Error: Could not find or load main class Files
我终于能够通过更改 red5.bat 文件并弄乱一些参数周围的引号来启动 Red5。这是一个 Windows 服务器,所以 red5 在 c:\program files (x86)\red5 中。这是修改后的 red5.bat 文件和后续错误:
if NOT DEFINED RED5_HOME set RED5_HOME=%~dp0
if NOT DEFINED RED5_MAINCLASS set RED5_MAINCLASS=org.red5.server.Bootstrap
if NOT DEFINED JAVA_HOME goto err
if NOT DEFINED JVM_OPTS set JVM_OPTS=-Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseParNewGC -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true
set LOGGING_OPTS=-Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true
set SECURITY_OPTS=-Djava.security.debug=failure
set TOMCAT_OPTS=-Dcatalina.home="%RED5_HOME%"
更改了上面的行以包含引号
set JYTHON_OPTS=-Dpython.home=lib
set JAVA_OPTS=%LOGGING_OPTS% %SECURITY_OPTS% %JAVA_OPTS% %JVM_OPTS% %TOMCAT_OPTS% %JYTHON_OPTS%
set RED5_CLASSPATH=%RED5_HOME%\red5-service.jar";"%RED5_HOME%\conf;%CLASSPATH%
在第一个参数的结尾和第二个参数的开头添加了引号。引号自动添加到参数的前端和末尾。
if NOT DEFINED RED5_OPTS set RED5_OPTS=
goto launchRed5
:launchRed5
echo Starting Red5
"%JAVA_HOME%\bin\java" %JAVA_OPTS% -cp "%RED5_CLASSPATH%" %RED5_MAINCLASS% %RED5_OPTS%
然而,在我能够获得 Red5 运行ning 之后,我添加了我的应用程序 eTutor,并尝试录制流。我收到了这个错误。
[INFO] [RTMPConnectionExecutor-1] maple.classroom.MapleClassroom - W3C x-category:session x-event:connect c-ip:76.242.102.xxx c-client-id:0
[INFO] [Red5_Scheduler_Worker-31] maple.classroom.MapleClassroom - W3C x-category:stream x-event:play c-ip:76.242.102.xxx x-sname:4fb77abf-56aa-45cd-8907-11aa2a333cb6
[INFO] [Red5_Scheduler_Worker-32] maple.classroom.MapleClassroom - W3C x-category:stream x-event:play c-ip:76.242.102.xxx x-sname:4fb77abf-56aa-45cd-8907-11aa2a333cb6 x-name:CADEaudio/2820/MOB_49_0_2
[INFO] [RTMPConnectionExecutor-1] org.red5.server.stream.StreamService - closeStream stream id: 1 connection: WAOIKZMBN2YZO
[INFO] [RTMPConnectionExecutor-1] org.red5.server.stream.StreamService - Stream not found - streamId: 1 connection: WAOIKZMBN2YZO
[INFO] [Red5_Scheduler_Worker-17] maple.classroom.MapleClassroom - W3C x-category:stream x-event:stop c-ip:76.242.102.xxx cs-bytes:3953 sc-bytes:4031 x-sname:4fb77abf-56aa-45cd-8907-11aa2a333cb6
[INFO] [RTMPConnectionExecutor-4] org.red5.server.scope.BasicScope - ClientBroadcastStream already exists: org.red5.server.stream.ClientBroadcastStream@60f07d5c new: org.red5.server.stream.ClientBroadcastStream@60f07d5c
[INFO] [RTMPConnectionExecutor-4] org.red5.server.stream.ClientBroadcastStream - Stream start: CADEaudio/2820/MOB_49_0_2
[INFO] [RTMPConnectionExecutor-4] maple.classroom.MapleClassroom - W3C x-category:stream x-event:record-start c-ip:76.242.102.xxx x-sname:22665dc5-26ea-470a-98b5-0cf9b5894d5c x-file-name:MOB_49_0_2.flv
[WARN] [Red5_Scheduler_Worker-24] org.red5.server.stream.RecordingListener - Exception while pushing to consumer
java.nio.BufferUnderflowException: null
at java.nio.HeapByteBuffer.get(Unknown Source)
at org.apache.mina.core.buffer.AbstractIoBuffer.get(AbstractIoBuffer.java:625)
at org.apache.mina.core.buffer.AbstractIoBuffer.get(AbstractIoBuffer.java:1337)
at org.red5.server.stream.consumer.ImmutableTag.build(ImmutableTag.java:183)
at org.red5.server.stream.consumer.FileConsumer$QueuedData.<init>(FileConsumer.java:795)
at org.red5.server.stream.consumer.FileConsumer.pushMessage(FileConsumer.java:256)
at org.red5.server.stream.RecordingListener.processQueue(RecordingListener.java:319)
at org.red5.server.stream.RecordingListener.access0(RecordingListener.java:57)
at org.red5.server.stream.RecordingListener$EventQueueJob.execute(RecordingListener.java:383)
at org.red5.server.scheduling.QuartzSchedulingServiceJob.executeInternal(QuartzSchedulingServiceJob.java:89)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
好的,原来的问题已经解决了。问题出在 red5.bat 文件和文件路径周围引号的处理中。我不得不在周围加上引号:
set TOMCAT_OPTS=-Dcatalina.home="%RED5_HOME%"
RED5_CLASSPATH 将自己的引号添加到开始和结束的类路径值中,但没有将它们添加到各个参数中。因此,我还必须添加 "inside" 以下语句,以便引用每个参数:
set RED5_CLASSPATH=%RED5_HOME%\red5-service.jar";"%RED5_HOME%\conf;%CLASSPATH%
我还不知道当我尝试 运行 它作为一项服务时会发生什么,但我希望当 1.0.7 最终版本发布时,一切都会好起来的。有一个错误,但那是另一个问题 post.
我打算在 Windows 2012 服务器上查看最新的 1.0.7,并下载了最新的 .zip。我将 .zip 解压缩到我的普通 Red5 目录 (d:\program files (x86)\Red5) 并尝试 运行 red5.bat 并得到错误,"Could not find or load main class Files"。但是,RED5_HOME 和 JAVA_HOME 没有改变。我错过了什么?
red5.bat 文件的输出:
D:\Program Files (x86)\Red5>if NOT DEFINED RED5_MAINCLASS set RED5_MAINCLASS=org
.red5.server.Bootstrap
D:\Program Files (x86)\Red5>if NOT DEFINED JAVA_HOME goto err
D:\Program Files (x86)\Red5>REM JAVA options
D:\Program Files (x86)\Red5>REM You can set JVM additional options here if you w
ant
D:\Program Files (x86)\Red5>if NOT DEFINED JVM_OPTS set JVM_OPTS=-Xverify:none -
XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseParNewGC -XX:InitialCodeCach
eSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=t
rue
D:\Program Files (x86)\Red5>REM Set up logging options
D:\Program Files (x86)\Red5>set LOGGING_OPTS=-Dlogback.ContextSelector=org.red5.
logging.LoggingContextSelector -Dcatalina.useNaming=true
D:\Program Files (x86)\Red5>REM Set up security options
D:\Program Files (x86)\Red5>REM set SECURITY_OPTS=-Djava.security.debug=failure
-Djava.security.manager -Djava.security.policy="D:\Program Files (x86)\Red5/conf
/red5.policy"
D:\Program Files (x86)\Red5>set SECURITY_OPTS=-Djava.security.debug=failure
D:\Program Files (x86)\Red5>REM Set up tomcat options
D:\Program Files (x86)\Red5>set TOMCAT_OPTS=-Dcatalina.home=D:\Program Files (x8
6)\Red5
D:\Program Files (x86)\Red5>REM Setup python/jython path
D:\Program Files (x86)\Red5>set JYTHON_OPTS=-Dpython.home=lib
D:\Program Files (x86)\Red5>REM Combined java options
D:\Program Files (x86)\Red5>set JAVA_OPTS=-Dlogback.ContextSelector=org.red5.log
ging.LoggingContextSelector -Dcatalina.useNaming=true -Djava.security.debug=fail
ure -Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseParNewGC
-XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quar
tz.skipUpdateCheck=true -Dcatalina.home=D:\Program Files (x86)\Red5 -Dpython.hom
e=lib
D:\Program Files (x86)\Red5>set RED5_CLASSPATH=D:\Program Files (x86)\Red5\red5-
service.jar;D:\Program Files (x86)\Red5\conf;
D:\Program Files (x86)\Red5>if NOT DEFINED RED5_OPTS set RED5_OPTS=
D:\Program Files (x86)\Red5>goto launchRed5
D:\Program Files (x86)\Red5>echo Starting Red5
Starting Red5
D:\Program Files (x86)\Red5>"D:\Program Files\Java\jdk8\bin\java" -Dlogback.Cont
extSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true -D
java.security.debug=failure -Xverify:none -XX:+TieredCompilation -XX:+UseBiased
Locking -XX:+UseParNewGC -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=3
2m -Dorg.terracotta.quartz.skipUpdateCheck=true -Dcatalina.home=D:\Program Files
(x86)\Red5 -Dpython.home=lib -cp "D:\Program Files (x86)\Red5\red5-service.jar;
D:\Program Files (x86)\Red5\conf;" org.red5.server.Bootstrap
Java HotSpot(TM) 64-Bit Server VM warning: Using the ParNew young collector with
the Serial old collector is deprecated and will likely be removed in a future r
elease
Error: Could not find or load main class Files
我终于能够通过更改 red5.bat 文件并弄乱一些参数周围的引号来启动 Red5。这是一个 Windows 服务器,所以 red5 在 c:\program files (x86)\red5 中。这是修改后的 red5.bat 文件和后续错误:
if NOT DEFINED RED5_HOME set RED5_HOME=%~dp0
if NOT DEFINED RED5_MAINCLASS set RED5_MAINCLASS=org.red5.server.Bootstrap
if NOT DEFINED JAVA_HOME goto err
if NOT DEFINED JVM_OPTS set JVM_OPTS=-Xverify:none -XX:+TieredCompilation -XX:+UseBiasedLocking -XX:+UseParNewGC -XX:InitialCodeCacheSize=8m -XX:ReservedCodeCacheSize=32m -Dorg.terracotta.quartz.skipUpdateCheck=true
set LOGGING_OPTS=-Dlogback.ContextSelector=org.red5.logging.LoggingContextSelector -Dcatalina.useNaming=true
set SECURITY_OPTS=-Djava.security.debug=failure
set TOMCAT_OPTS=-Dcatalina.home="%RED5_HOME%"
更改了上面的行以包含引号
set JYTHON_OPTS=-Dpython.home=lib
set JAVA_OPTS=%LOGGING_OPTS% %SECURITY_OPTS% %JAVA_OPTS% %JVM_OPTS% %TOMCAT_OPTS% %JYTHON_OPTS%
set RED5_CLASSPATH=%RED5_HOME%\red5-service.jar";"%RED5_HOME%\conf;%CLASSPATH%
在第一个参数的结尾和第二个参数的开头添加了引号。引号自动添加到参数的前端和末尾。
if NOT DEFINED RED5_OPTS set RED5_OPTS=
goto launchRed5
:launchRed5
echo Starting Red5
"%JAVA_HOME%\bin\java" %JAVA_OPTS% -cp "%RED5_CLASSPATH%" %RED5_MAINCLASS% %RED5_OPTS%
然而,在我能够获得 Red5 运行ning 之后,我添加了我的应用程序 eTutor,并尝试录制流。我收到了这个错误。
[INFO] [RTMPConnectionExecutor-1] maple.classroom.MapleClassroom - W3C x-category:session x-event:connect c-ip:76.242.102.xxx c-client-id:0
[INFO] [Red5_Scheduler_Worker-31] maple.classroom.MapleClassroom - W3C x-category:stream x-event:play c-ip:76.242.102.xxx x-sname:4fb77abf-56aa-45cd-8907-11aa2a333cb6
[INFO] [Red5_Scheduler_Worker-32] maple.classroom.MapleClassroom - W3C x-category:stream x-event:play c-ip:76.242.102.xxx x-sname:4fb77abf-56aa-45cd-8907-11aa2a333cb6 x-name:CADEaudio/2820/MOB_49_0_2
[INFO] [RTMPConnectionExecutor-1] org.red5.server.stream.StreamService - closeStream stream id: 1 connection: WAOIKZMBN2YZO
[INFO] [RTMPConnectionExecutor-1] org.red5.server.stream.StreamService - Stream not found - streamId: 1 connection: WAOIKZMBN2YZO
[INFO] [Red5_Scheduler_Worker-17] maple.classroom.MapleClassroom - W3C x-category:stream x-event:stop c-ip:76.242.102.xxx cs-bytes:3953 sc-bytes:4031 x-sname:4fb77abf-56aa-45cd-8907-11aa2a333cb6
[INFO] [RTMPConnectionExecutor-4] org.red5.server.scope.BasicScope - ClientBroadcastStream already exists: org.red5.server.stream.ClientBroadcastStream@60f07d5c new: org.red5.server.stream.ClientBroadcastStream@60f07d5c
[INFO] [RTMPConnectionExecutor-4] org.red5.server.stream.ClientBroadcastStream - Stream start: CADEaudio/2820/MOB_49_0_2
[INFO] [RTMPConnectionExecutor-4] maple.classroom.MapleClassroom - W3C x-category:stream x-event:record-start c-ip:76.242.102.xxx x-sname:22665dc5-26ea-470a-98b5-0cf9b5894d5c x-file-name:MOB_49_0_2.flv
[WARN] [Red5_Scheduler_Worker-24] org.red5.server.stream.RecordingListener - Exception while pushing to consumer
java.nio.BufferUnderflowException: null
at java.nio.HeapByteBuffer.get(Unknown Source)
at org.apache.mina.core.buffer.AbstractIoBuffer.get(AbstractIoBuffer.java:625)
at org.apache.mina.core.buffer.AbstractIoBuffer.get(AbstractIoBuffer.java:1337)
at org.red5.server.stream.consumer.ImmutableTag.build(ImmutableTag.java:183)
at org.red5.server.stream.consumer.FileConsumer$QueuedData.<init>(FileConsumer.java:795)
at org.red5.server.stream.consumer.FileConsumer.pushMessage(FileConsumer.java:256)
at org.red5.server.stream.RecordingListener.processQueue(RecordingListener.java:319)
at org.red5.server.stream.RecordingListener.access0(RecordingListener.java:57)
at org.red5.server.stream.RecordingListener$EventQueueJob.execute(RecordingListener.java:383)
at org.red5.server.scheduling.QuartzSchedulingServiceJob.executeInternal(QuartzSchedulingServiceJob.java:89)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
好的,原来的问题已经解决了。问题出在 red5.bat 文件和文件路径周围引号的处理中。我不得不在周围加上引号:
set TOMCAT_OPTS=-Dcatalina.home="%RED5_HOME%"
RED5_CLASSPATH 将自己的引号添加到开始和结束的类路径值中,但没有将它们添加到各个参数中。因此,我还必须添加 "inside" 以下语句,以便引用每个参数:
set RED5_CLASSPATH=%RED5_HOME%\red5-service.jar";"%RED5_HOME%\conf;%CLASSPATH%
我还不知道当我尝试 运行 它作为一项服务时会发生什么,但我希望当 1.0.7 最终版本发布时,一切都会好起来的。有一个错误,但那是另一个问题 post.