简体   繁体   中英

Netty class not found exception while executing JAR

I've made JAR file from a project I made, however when I try to execute it, it gives:

    Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/channel/socket/ServerSocketChannelFactory
at org.ddosdefense.httpfilter.HTTPInterceptor.main(HTTPInterceptor.java:66)
    Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.socket.ServerSocketChannelFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 1 more

Inside the jar file all the libraries are present. In the .classpath file the netty jar library is present:

    <classpathentry kind="lib" path="ddos2_lib/netty-3.6.2.Final.jar"/>

When I execute the project in eclipse it works perfectly. Anyone has an idea how to solve this problem?

Thanks in advance!

您很可能没有将jar打包到您生产的jar中,或者错过了通过-cp选项指定netty jar的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM