-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Intermittent build error ClassPathElement.getResource(String) is null
#28461
Comments
/cc @geoand, @glefloch, @manovotn, @mkouba, @quarkusio/devtools @aloubyansky |
I am not familiar with The line in question is - https://github.com/quarkusio/quarkus/blob/main/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/QuarkusClassLoader.java#L364 As for why it sometimes return |
@kdubb I sent a PR for at least the |
I've tried creating a reproducer with no luck. We have a pretty big multi-module Gradle project to reproduce; unfortunately it isn't open source. |
@manovotn If you have any ideas/suggestions of what I could do to provide more information to you (aside from a reproducer) I'd be happy to gather it. This is a fairly painful issue directly affecting development. |
I'm not sure I'll be able to reliably test with your PR until #28440 is fixed. |
Actually, I guess I can check pick your changes back onto |
Is it possible that files are being deleted from the class path during tests? |
@kdubb would you mind trying https://github.com/aloubyansky/quarkus/tree/classloader-npe? It's not a fix, unfortunately, I just throw an |
Yes. I'll be working on this tomorrow. |
@kdubb did you get a chance to try the Alexey's branch? |
Yeah we talked in Zulip a bit. I can't seem to reproduce the issue at this point 😔. I believe his plan is to merge #28703 regardless so that if/when the issue arises again we'll have more information to debug it. |
@aloubyansky I haven't seen it in a very long time but it reappeared today. I'm assuming this includes your extra information. java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor#setupEndpoints threw an exception: java.lang.NullPointerException: Cannot invoke "io.quarkus.bootstrap.classloading.ClassPathResource.getData()" because the return value of "io.quarkus.bootstrap.classloading.ClassPathElement.getResource(String)" is null at io.quarkus.bootstrap.classloading.QuarkusClassLoader.getResourceAsStream(QuarkusClassLoader.java:409) at io.quarkus.resteasy.reactive.server.deployment.FilterClassIntrospector.usesGetResourceMethod(FilterClassIntrospector.java:26) at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor$4.inspect(ResteasyReactiveProcessor.java:717) at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor$4.visitGlobalRequestFilter(ResteasyReactiveProcessor.java:690) at org.jboss.resteasy.reactive.common.model.ResourceInterceptors.visitFilters(ResourceInterceptors.java:82) at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor.filtersAccessResourceMethod(ResteasyReactiveProcessor.java:729) at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor.setupEndpoints(ResteasyReactiveProcessor.java:437) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909) at io.quarkus.builder.BuildContext.run(BuildContext.java:281) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478) at java.base/java.lang.Thread.run(Thread.java:833) at org.jboss.threads.JBossThread.run(JBossThread.java:501) |
No, it's in another method, unfortunately. Previously it was in |
@aloubyansky @kdubb What's the current status of this issue? |
Intermittently getting this on 2.14.2
This seemed to start occurring after introducing a dependency with a microprofile-config.properties in it |
Thanks @jcjolley also during tests? If so, do the tests fail with that error? |
I had exactly the same issue and it was due to vscode-java extension. If you are using VSCode, give this a try: |
@gdraganic I use IntelliJ, but thanks for the info. I'll try shutting it down the next time I get this error. |
Is this still an issue? |
@kdubb Did you get a chance to test your app with the latest Quarkus? Since we don't have a reproducer there's not much we can do about it. |
Haven't seen the issue in quite a while. |
Thanks. Let's close for now and we can always reopen if this reappears |
Describe the bug
I am intermittently receiving a build error during
@QuarkusTest
runs in Gradle.Noticeably they don't appear to be random but intermittent with certain tests; although I'm not sure exactly what that means. Considering the stack trace I can't imagine this is related to our code.
The issue is similar/same as #14611 but that issue is targeting a much older version and was marked invalid.
Here is the complete logged exception:
Expected behavior
Build completes without intermittent errors.
Actual behavior
See above
How to Reproduce?
I cannot reproduce this in a "small" project. We have a 10 module Gradle project that I am seeing the issue in. While intermittent I would say it happens 60% of the time at this point.
Output of
uname -a
orver
macOS 12.6
Output of
java -version
OpenJDK 17.0.1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.5.1
Additional information
No response
The text was updated successfully, but these errors were encountered: