[Java/helidon]: first attemp at introducing Helidon
not sure what's going on here
it run inside the first layer, seems to be something not copied between containes
anything I can try to fix this?
maybe creating a all-in-one jar, honestly not sure to remember the name, fatjar, uberjar ... the idea is to have one jar file without extra dependencies.
the jar is not working since some required library are not copied from build container
the idea is to have one jar file
this is what mvn package does
then this issue comes from pom.xml, I mean a class could not be found
Caused by: java.lang.NoClassDefFoundError: io/helidon/media/common/MediaSupport
try :
- bundle exec rake config
- cd java/helidon
- docker build . -f .Dockerfile -t test
- docker run -ti test ash
- /usr/bin/java -XX:-RelaxAccessControlCheck -XX:+UseNUMA -XX:+UseParallelGC -jar /opt/web/target/helidon.webserver.jar
still an error
Error: Unable to initialize main class web.helidon.Main
Caused by: java.lang.NoClassDefFoundError: io/helidon/media/common/MediaSupport
let's see if @tomas-langer or @barchetta can help
I pulled this PR and I can build and run the helidon application in a shell. My hunch is you are not copying target/libs to your container image.
Our default packaging consists of:
-
target/application.jar: this contains the application code and aClass-Pathentry for runtime dependencies -
target/libs: contains all runtime dependencies for the application as referenced by the jar'sClass-Path
Thanks @barchetta! I'm wondering if there's a way to create a sort of uber-jar that will also contain all those libs.
@whiplash we consider the uber-jar an anti-pattern as they are not Docker image friendly and they introduce complexities concerning merging of resources (like META-INF/services/*).
Another thing to note is that we support packaging the application as a jlink runtime image. I have verified that this works with this PR:
mvn clean install -Pjlink-image
target/helidon.webserver-jri/bin/start
In this case target/helidon.webserver-jri contains a custom Java Runtime Image, plus the application code, plus the runtime dependencies.
Thanks so much @barchetta.
@waghanza we can try with this jlink runtime and see how it goes
@waghanza maybe we made it :)