jkurs
jkurs

Reputation: 105

Vertx run results in resource not found error

I am trying to run a vertx server with dynamoDB and lombok annotations, and I am unable to get it to work properly. I have added the .jar files for vertx, dynamoDB, and lombok to my classpath. Everything compiles fine in IntelliJ, but I cannot get it to run properly from my terminal.

I get:

Users-MacBook-Pro:Server User$ vertx run Server.java 
java.lang.RuntimeException: Resource not found: Server.java
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:73)
    at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
    at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
    at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
    at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
    at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
    at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
    at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
    at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
    at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
    at io.vertx.core.Launcher.main(Launcher.java:49)
Failed in deploying verticle 
java.lang.RuntimeException: Resource not found: Server.java
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:73)
    at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
    at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
    at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
    at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
    at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
    at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
    at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
    at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
    at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
    at io.vertx.core.Launcher.main(Launcher.java:49)

java.lang.RuntimeException: Resource not found: Server.java
    at io.vertx.core.impl.verticle.CompilingClassLoader.<init>(CompilingClassLoader.java:73)
    at io.vertx.core.impl.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:38)
    at io.vertx.core.impl.DeploymentManager.createVerticles(DeploymentManager.java:184)
    at io.vertx.core.impl.DeploymentManager.lambda$doDeployVerticle$2(DeploymentManager.java:157)
    at io.vertx.core.impl.FutureImpl.checkCallHandler(FutureImpl.java:158)
    at io.vertx.core.impl.FutureImpl.setHandler(FutureImpl.java:100)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:130)
    at io.vertx.core.impl.DeploymentManager.doDeployVerticle(DeploymentManager.java:102)
    at io.vertx.core.impl.DeploymentManager.deployVerticle(DeploymentManager.java:90)
    at io.vertx.core.impl.VertxImpl.deployVerticle(VertxImpl.java:574)
    at io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer.deploy(VertxIsolatedDeployer.java:46)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.vertx.core.impl.launcher.commands.ClasspathHandler.deploy(ClasspathHandler.java:160)
    at io.vertx.core.impl.launcher.commands.RunCommand.deploy(RunCommand.java:389)
    at io.vertx.core.impl.launcher.commands.RunCommand.run(RunCommand.java:262)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:230)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:365)
    at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
    at io.vertx.core.Launcher.main(Launcher.java:49)

Would appreciate some help with this!

Upvotes: 0

Views: 2658

Answers (2)

jkurs
jkurs

Reputation: 105

I was able to fix this issue by creating a fat jar module out of my project. I followed this for help: http://vertx.io/blog/my-first-vert-x-3-application/

Upvotes: 0

tsegismont
tsegismont

Reputation: 9128

This error simply tells you that the Vert.x CLI could not find the Server.java file in the current working directory.

Given that you use Lombok (which modifies code at compile time), I would recommend to run your Verticle after you compiled it with your IDE or build tool.

Here is a list of possibilities to start a Verticle

Upvotes: 1

Related Questions