vertx-examples icon indicating copy to clipboard operation
vertx-examples copied to clipboard

NoClassDefFoundError in gradle-simplest

Open kumangxxx opened this issue 9 years ago • 2 comments

what i did :

  • cloned the project
  • build the project using ./gradlew shadowJar
  • run the jar using java -jar build/libs/gradle-simplest-3.4.2-fat.jar
  • got this error :
Exception in thread "main" java.lang.NoClassDefFoundError: io/vertx/core/spi/VerticleFactory
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at io.vertx.core.ServiceHelper.loadFactories(ServiceHelper.java:61)
        at io.vertx.core.ServiceHelper.loadFactories(ServiceHelper.java:47)
        at io.vertx.core.impl.DeploymentManager.loadVerticleFactories(DeploymentManager.java:55)
        at io.vertx.core.impl.DeploymentManager.<init>(DeploymentManager.java:51)
        at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:178)
        at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:143)
        at io.vertx.core.impl.VertxImpl.<init>(VertxImpl.java:139)
        at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:34)
        at io.vertx.core.Vertx.vertx(Vertx.java:80)
        at io.vertx.example.HelloWorldEmbedded.main(HelloWorldEmbedded.java:13)
Caused by: java.lang.ClassNotFoundException: io.vertx.core.spi.VerticleFactory
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 29 more

environment :

  • ubuntu 16.04
  • Java 1.8.0_144

any idea what is wrong ?

thanks!

kumangxxx avatar Sep 15 '17 10:09 kumangxxx

interesting... it works fine on macOS + Java 1.8.0_144

Sammers21 avatar Sep 15 '17 20:09 Sammers21

Works fine for me as well on Fedora and OpenJDK8. Please reopen with more info if issue persists

tsegismont avatar May 29 '18 16:05 tsegismont