Error: Could not find or load main class com.networknt.server.Server error

213 Views Asked by At

I have a quick question. Do you have a light-4j framework docker image hosted somewhere in which I can just add my API jar and run docker? I am getting a hard time running my APIs generated using codegen CLI in docker. It consistently gives me Error: Could not find or load main class com.networknt.server.Server error

1

There are 1 best solutions below

0
On

Have you tried mvn clean install exec:exec? If you want to run with the jar file, you need to build with mvn clean install -Prelease to generate the final fat jar.

This is one of the features contributed by one of the members to speed up the testing cycle to avoid building all extra artifacts for each cycle. It might confuse new developers, though. The generated README.md has some information on how to build and start. Let me know it is not clear, and I will add extra info. When you run the build.sh to generate a docker image, it will be built with -Prelease in the script.