Java:线程主java.lang.NoClassDefFoundError中的异常

发布于 2024-09-01 09:58:41 字数 1344 浏览 4 评论 0原文

我正在尝试让 Red5 Flash Media Server 在我的计算机上运行。我已经安装了它,但是当我运行服务器时,我收到此错误:-

 Exception in thread "main" java.lang.NoClassDefFoundError: org/red5/server/Bootstrap
 Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
  Could not find the main class: org.red5.server.Bootstrap. Program will exit.

我遇到了这个链接,其中有人遇到了同样的问题: http://trac.red5.org/ticket/762

看起来他们运行了以下命令命令:

export CLASSPATH=3D$RED5_HOME/lib/slf4j-api-1.5.10.jar:$RED5_HOME/lib/logback-   core-0.9.18.jar:$RED5_HOME/lib/logback-classic-0.9.18.jar

我在 /usr/share/red5 中安装了 red5,所以我运行了这个:

export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar

然而尽管如此,我仍然看到相同的错误消息。

I am trying to get the Red5 Flash Media Server working on my computer. I have installed it, but when I run the server I get this error:-

 Exception in thread "main" java.lang.NoClassDefFoundError: org/red5/server/Bootstrap
 Caused by: java.lang.ClassNotFoundException: org.red5.server.Bootstrap
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
  Could not find the main class: org.red5.server.Bootstrap. Program will exit.

I came across this link where someone had the same issue:
http://trac.red5.org/ticket/762

It looks like they ran the following command:

export CLASSPATH=3D$RED5_HOME/lib/slf4j-api-1.5.10.jar:$RED5_HOME/lib/logback-   core-0.9.18.jar:$RED5_HOME/lib/logback-classic-0.9.18.jar

I have red5 installed in /usr/share/red5, so I ran this:

export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar

Yet despite all this I am still seeing the same error message.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

穿越时光隧道 2024-09-08 09:58:41

在我从主干构建一个新的red5服务器到“dist”目录后,我曾经遇到过同样的问题,例如“java.lang.ClassNotFoundException:org.red5.server.Bootstrap”

只需指向RED5_HOME环境变量到那个“dist”位置。

I used to have the same problem like "java.lang.ClassNotFoundException: org.red5.server.Bootstrap" after I builded a new red5 server from the trunk to 'dist' directory

just point RED5_HOME environment variable to that "dist" location.

许你一世情深 2024-09-08 09:58:41

正确的类路径是:

export CLASSPATH=/usr/share/red5/lib/slf4j-api-1.5.10.jar:/usr/share/red5/lib/logback-core-0.9.18.jar:/usr/share/red5/lib/logback-classic-0.9.18.jar

注意:

  • = 符号之后没有 3D
  • /usr 之前任何地方都没有 $

The correct class path is:

export CLASSPATH=/usr/share/red5/lib/slf4j-api-1.5.10.jar:/usr/share/red5/lib/logback-core-0.9.18.jar:/usr/share/red5/lib/logback-classic-0.9.18.jar

Notice:

  • No 3D after = sign
  • No $ before /usr anywhere
止于盛夏 2024-09-08 09:58:41

您需要确保您的 red5.sh 具有正确的权限:

chmod 755 red5.sh

java AccessController 失败,因此找不到该类。

You need to ensure your red5.sh has the correct permissions:

chmod 755 red5.sh

The java AccessController is failing, thus the class is not being found.

陌上青苔 2024-09-08 09:58:41

在 svn checkout 之后,您没有从源代码构建它。结帐后只需输入 ant :)。

You did not build it from source after svn checkout. Just type ant after checkout :).

谁与争疯 2024-09-08 09:58:41

这可能是不正确的:

export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar

我认为应该是:

export CLASSPATH=/usr/share/red5/lib/slf4j-api-1.5.10.jar:/usr/share/red5/lib/logback-core-0.9.18.jar:/usr/share/red5/lib/logback-classic-0.9.18.jar

如果这不起作用,那么服务器将忽略 CLASSPATH 环境变量。 Java EE 应用服务器不使用它。您使用哪种服务器软件作为监听器?

This might be incorrect:

export CLASSPATH=3D$/usr/share/red5/lib/slf4j-api-1.5.10.jar:$/usr/share/red5/lib/logback-core-0.9.18.jar:$/usr/share/red5/lib/logback-classic-0.9.18.jar

I think it should be:

export CLASSPATH=/usr/share/red5/lib/slf4j-api-1.5.10.jar:/usr/share/red5/lib/logback-core-0.9.18.jar:/usr/share/red5/lib/logback-classic-0.9.18.jar

If that doesn't work, then the server is ignoring the CLASSPATH environment variable. Java EE app servers don't use it. Which server software are you using as the listener?

甜味超标? 2024-09-08 09:58:41

red5 引导类位于 boot.jar 中,这是启动 red5 时唯一需要位于类路径上的 jar。

The red5 bootstrap class is in the boot.jar and this is the only jar that needs to be on the classpath when starting red5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文