-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime exception on building application jar #26773
Comments
I have the same issue. Was about to open an issue myself but may as well use this one. For me it only happens when I use categories/handlers. The error strangely disappears when I comment out the My other projects using the json-logging extensions work fine, but the difference is that I don't use categories. I'll keep trying arbitrary stuff, maybe I figure it out but someone should definitely look on this. PS: If I comment out the above mentioned line, I get this error:
My app.props file:
|
@gsmet I think you worked on the json logging, right? Please, any chance this is an easy fix? I had to do a very ugly workaround to be able to log a json to file, and I need to get rid of it as soon as this is fixed. |
@mihaipoenaru no idea. Please create a simple Maven reproducer so that we can have a look. Thanks! |
Hmmm. I see what the problem is. No idea how to fix it yet. |
I have a fix coming. Too late for 2.10.3.Final but I release 2.11.0.Final core artifacts tomorrow and it will be in it if all goes well. |
Despite being part of the recorder, it is called statically at build time. We need to be extremely careful about it. Fixes quarkusio#26773
PR is here: #26810 . |
Despite being part of the recorder, it is called statically at build time. We need to be extremely careful about it. Fixes quarkusio#26773 (cherry picked from commit d125cd8)
Thanks a lot, @gsmet ❤️. There will now be one less ugly workaround in the world |
Despite being part of the recorder, it is called statically at build time. We need to be extremely careful about it. Fixes quarkusio#26773
Despite being part of the recorder, it is called statically at build time. We need to be extremely careful about it. Fixes quarkusio#26773
Despite being part of the recorder, it is called statically at build time. We need to be extremely careful about it. Fixes quarkusio#26773 (cherry picked from commit d125cd8)
Describe the bug
When I try to build application jar the following exception occures:
ERROR] [error]: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingRuntimeInit threw an exception: java.lang.RuntimeException: You cannot invoke getValue() directly on an object returned from the bytecode recorder, you can only pass it back into the recorder as a parameter [ERROR] at io.quarkus.deployment.recording.BytecodeRecorderImpl$3.invoke(BytecodeRecorderImpl.java:444) [ERROR] at io.quarkus.deployment.recording.BytecodeRecorderImpl$$ReturnValueProxy22.getValue(Unknown Source) [ERROR] at io.quarkus.runtime.logging.LoggingSetupRecorder.configureFileHandler(LoggingSetupRecorder.java:500) [ERROR] at io.quarkus.runtime.logging.LoggingSetupRecorder.createNamedHandlers(LoggingSetupRecorder.java:333) [ERROR] at io.quarkus.runtime.logging.LoggingSetupRecorder.initializeBuildTimeLogging(LoggingSetupRecorder.java:261) [ERROR] at io.quarkus.deployment.logging.LoggingResourceProcessor.setupLoggingRuntimeInit(LoggingResourceProcessor.java:225) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566) [ERROR] at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944) [ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277) [ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) [ERROR] at java.base/java.lang.Thread.run(Thread.java:829) [ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501) [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Possible root cause
Direct use of possibleFileFormatters in io.quarkus.runtime.logging.LoggingSetupRecorder::initializeBuildTimeLogging.
Does logging to file make sense at build time?
Expected behavior
Quarkus jar is build.
Actual behavior
Error occurs: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingRuntimeInit threw an exception: java.lang.RuntimeException: You cannot invoke getValue() directly on an object returned from the
bytecode recorder, you can only pass it back into the recorder as a parameter
How to Reproduce?
a) Checkout https://github.com/quarkusio/quarkus-quickstarts/tree/main/getting-started
b) add the following to application.properties
quarkus.log.handler.file."aaa".enable=true
quarkus.log.handler.file."aaar".path=./logs/aaa.log
quarkus.log.handler.file."aaa".level=INFO
c) add depdencency to io.quarkus:quarkus-logging-json in pom.xml
d) run mvnw package
Output of
uname -a
orver
Microsoft Windows [Version 10.0.19044.1766]
Output of
java -version
openjdk 11.0.15 2022-04-19
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.10.x
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Additional information
No response
The text was updated successfully, but these errors were encountered: