vertx-examples
vertx-examples copied to clipboard
NoClassDefFoundError for Vertx verticle with docker image
Hi all, We are using Vertx docker image for our vertx web application server (written in Java) from the example below: https://github.com/vert-x3/vertx-examples/blob/master/docker-examples/vertx-docker-java/Dockerfile
After adding vertx Thymeleaf template engine, we found that on run time(on production), there is an exception: java.lang.NoClassDefFoundError: org/attoparser/IMarkupParser while trying to render HTML file with Thymeleaf, although the .CLASS files was found inside the fat JAR file.
After a small research, we found that our application is missing current jar CLASSPATH. For fixing it, we just added the current JAR file to CLASSPATH environment variable: ENV CLASSPATH "$VERTICLE_HOME/$VERTICLE_JAR"
So you're building a jar with dependencies, correct? Then have you checked the vertx-docker-java-fatjar example?