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

NoClassDefFoundError for Vertx verticle with docker image

Open yaniv51 opened this issue 6 years ago • 1 comments
trafficstars

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"

yaniv51 avatar Mar 10 '19 14:03 yaniv51

So you're building a jar with dependencies, correct? Then have you checked the vertx-docker-java-fatjar example?

tsegismont avatar Mar 11 '19 08:03 tsegismont