Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError for CommandResolverFactory #39

Open
aianta opened this issue Dec 19, 2018 · 3 comments
Open

java.lang.NoClassDefFoundError for CommandResolverFactory #39

aianta opened this issue Dec 19, 2018 · 3 comments

Comments

@aianta
Copy link

aianta commented Dec 19, 2018

I'm trying to test out the vert.x shell, but am having trouble getting it started. When I run the command
vertx run -conf '{"telnetOptions":{"port":5000}}' maven:io.vertx:vertx-shell:3.6.2

I get the following stack trace

Failed in deploying verticle
java.lang.NoClassDefFoundError: io/vertx/ext/shell/spi/CommandResolverFactory
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
        at io.vertx.core.impl.IsolatingClassLoader.loadClass(IsolatingClassLoader.java:62)
        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 io.vertx.ext.shell.impl.ShellServiceImpl.start(ShellServiceImpl.java:92)
        at io.vertx.ext.shell.ShellVerticle.start(ShellVerticle.java:47)
        at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$8(DeploymentManager.java:494)
        at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:320)
        at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: io.vertx.ext.shell.spi.CommandResolverFactory
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 30 more

I'm running

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

And Vert.x version 3.6.2 in the CLI on Windows 10 Pro.

Is there something I'm missing?

@slavaatsig
Copy link

Got exactly same error with vert.x 3.6.8 on MacOS:

openjdk 11.0.4 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.15.1, JRE 11 Mac OS X amd64-64-Bit Compressed References 20190717_289 (JIT enabled, AOT enabled)
OpenJ9   - 0f66c6431
OMR      - ec782f26
JCL      - fa49279450 based on jdk-11.0.4+11)

@sibay
Copy link

sibay commented Feb 2, 2020

any news? I got the same error on Windows 10

PS > java -version
openjdk version "11.0.3" 2019-04-16 LTS
OpenJDK Runtime Environment Zulu11.31+11-CA (build 11.0.3+7-LTS)
OpenJDK 64-Bit Server VM Zulu11.31+11-CA (build 11.0.3+7-LTS, mixed mode)

PS> .\bin\vertx -version
3.8.5

@sibay
Copy link

sibay commented Feb 2, 2020

using vertx full distribution (3.8.5) and copying
vertx-shell-3.8.5.jar
termd-core-1.1.6.jar
into the lib folder fixed the issue. all vertx run -conf '{"telnetOptions":{"port":8081}}' commands with

  • maven:io.vertx:vertx-shell:3.8.5
  • service:io.vertx.ext.shell
  • io.vertx.ext.shell.ShellVerticle

worked fine.
My understanding of the maven service was, that it loads everything what is needed and sets the the correct classpath. Perhaps this assumption is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants