Java: Exception on main thread java.lang.NoClassDefFoundError

I am trying to get Red5 Flash Media Server to work on my computer. I installed it, but when I start 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 problem: 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 / red 5, 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

      

However, despite all this, I still see the same error message.

+2


a source to share


6 answers


I had the same problem "java.lang.ClassNotFoundException: org.red5.server.Bootstrap"

after I built a new red5 server from trunk to "dist" directory



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

.

+7


a source


Correct class path:

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

      



Note:

  • Unsigned 3D after =

  • No $

    up /usr

    anywhere
+2


a source


You need your red5.sh to have the correct permissions:

chmod 755 red5.sh

      

The core of the AccessController is down, so the class was not found.

+1


a source


You didn't build it from source after checking svn. Just enter ant after checkout :).

+1


a source


This may not be correct:

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, the server ignores the CLASSPATH environment variable. Java EE application servers do not use it. What server software is used as a listener?

0


a source


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

0


a source







All Articles