Reputation: 71
When starting my Quarkus app with
java -jar target/quarkus-app/quarkus-run.jar
or with a packed Uber-jar I get :
ClassNotFoundException: javax.annotation.Priority
But when I start from IntelliJ or with
mvn quarkus:dev
It all start well.
Complete stackTrace:
$ java -jar target/quarkus-app/quarkus-run.jar Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:53) at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:28) Caused by: java.lang.NoClassDefFoundError: javax/annotation/Priority at io.smallrye.config.SmallRyeConfigBuilder$InterceptorWithPriority$1.getPriority(SmallRyeConfigBuilder.java:461) at io.smallrye.config.SmallRyeConfigBuilder$InterceptorWithPriority.(SmallRyeConfigBuilder.java:469) at io.smallrye.config.SmallRyeConfigBuilder$InterceptorWithPriority.(SmallRyeConfigBuilder.java:448) at io.smallrye.config.SmallRyeConfigBuilder$InterceptorWithPriority.(SmallRyeConfigBuilder.java:441) at io.smallrye.config.SmallRyeConfigBuilder.getDefaultInterceptors(SmallRyeConfigBuilder.java:213) at io.smallrye.config.SmallRyeConfig$ConfigSources.buildInterceptors(SmallRyeConfig.java:571) at io.smallrye.config.SmallRyeConfig$ConfigSources.(SmallRyeConfig.java:516) at io.smallrye.config.SmallRyeConfig.(SmallRyeConfig.java:66) at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:419) at io.quarkus.runtime.generated.Config.(Unknown Source) at io.quarkus.runner.ApplicationImpl.(Unknown Source) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at java.base/java.lang.Class.newInstance(Class.java:584) at io.quarkus.runtime.Quarkus.run(Quarkus.java:66) at io.quarkus.runtime.Quarkus.run(Quarkus.java:41) at io.quarkus.runtime.Quarkus.run(Quarkus.java:120) at io.quarkus.runner.GeneratedMain.main(Unknown Source) ... 6 more Caused by: java.lang.ClassNotFoundException: javax.annotation.Priority at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at io.quarkus.bootstrap.runner.RunnerClassLoader.loadClass(RunnerClassLoader.java:107) at io.quarkus.bootstrap.runner.RunnerClassLoader.loadClass(RunnerClassLoader.java:57) ... 26 more
Upvotes: 2
Views: 5798
Reputation: 71
My pom is so big and ugly , witch maybe is part of the problem. But it helped to do a lot of exclutions on jakarta.annotation-api
<exclusion>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</exclusion>
And to include version 1.3.5 of jakarta.annotation-api
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
Upvotes: 1