Skip to content
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

Warning about failing to index Spring class on reload #42237

Closed
fedinskiy opened this issue Jul 31, 2024 · 20 comments · Fixed by #43501
Closed

Warning about failing to index Spring class on reload #42237

fedinskiy opened this issue Jul 31, 2024 · 20 comments · Fixed by #43501
Labels
area/spring Issues relating to the Spring integration kind/bug Something isn't working
Milestone

Comments

@fedinskiy
Copy link
Contributor

fedinskiy commented Jul 31, 2024

Describe the bug

I have an app, which uses several Spring extensions. When I run in a Dev Mode and do a reload (manually or a by adding a new file) there is a warning in a logs.

This warning emerged after update from 3.11.0 to 3.12.3

Expected behavior

No warnings during reload

Actual behavior

-07-31 12:07:06,391 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Restarting as requested by the user.
2024-07-31 12:07:06,400 INFO  [io.quarkus] (Quarkus Main Thread) app stopped in 0.008s
<...>
2024-07-31 12:07:06,530 WARN  [io.qua.arc.pro.BeanArchives] (build-12) Failed to index org.springframework.aot.hint.annotation.Reflective: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV for app-1.0.0-SNAPSHOT@2d2d94bf

How to Reproduce?

  1. Create an app:
 mvn io.quarkus.platform:quarkus-maven-plugin:3.13.0:create -DprojectGroupId=my-groupId -DprojectArtifactId=app -DprojectVersion=1.0.0-SNAPSHOT -DpackageName=org.my.group -DquarkusRegistryClient=false -DplatformVersion=3.13.0 -Dextensions=quarkus-rest,spring-boot-properties,spring-di,spring-security,spring-web && cd app # spring-data-jpa also seem to be affected
  1. Run in a dev mode: mvn clean quarkus:dev
  2. Wait for the app to start and reload it by pressing s or by adding a new class

Output of uname -a or ver

6.7.3-200.fc39.x86_64

Output of java -version

Java version: 21.0.1, vendor: Eclipse Adoptium

Quarkus version or git rev

3.13.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

No response

@fedinskiy fedinskiy added the kind/bug Something isn't working label Jul 31, 2024
@quarkus-bot quarkus-bot bot added the area/spring Issues relating to the Spring integration label Jul 31, 2024
Copy link

quarkus-bot bot commented Jul 31, 2024

/cc @geoand (spring)

@fedinskiy
Copy link
Contributor Author

It seems, that 3.12.0 is the first version which is affected, since 3.11.3 is not

fedinskiy added a commit to fedinskiy/quarkus-startstop that referenced this issue Jul 31, 2024
Also add a bit of debugging related to quarkusio/quarkus#42237
fedinskiy added a commit to fedinskiy/quarkus-startstop that referenced this issue Aug 1, 2024
- Change all dependencies to the latest versions
- Add a bit of debugging related to quarkusio/quarkus#42237 and quarkusio/quarkus#42248
- After 3.13.0 quarkus OTEL exporter uses GRPC streams to export traces.
  Our hacked together OTEL server could not handle that and was rewritten to conform to OTEL specifications more.
fedinskiy added a commit to fedinskiy/quarkus-startstop that referenced this issue Aug 1, 2024
- Change all dependencies to the latest versions
- Add a bit of debugging related to quarkusio/quarkus#42237 and quarkusio/quarkus#42248
- After 3.13.0 quarkus OTEL exporter uses GRPC streams to export traces.
  Our hacked together OTEL server could not handle that and was rewritten to conform to OTEL specifications more.
@geoand
Copy link
Contributor

geoand commented Aug 2, 2024

Hm...

When I start the application (before any live reload, I see):

2024-08-02 13:57:05,839 WARN  [io.qua.agr.dep.AgroalProcessor] (build-18) The Agroal dependency is present but no JDBC datasources have been defined.
2024-08-02 13:57:05,945 WARN  [io.qua.hib.orm.dep.HibernateOrmProcessor] (build-22) Hibernate ORM is disabled because no JPA entities were found
2024-08-02 13:57:05,967 WARN  [io.qua.dat.dep.dev.DevServicesDatasourceProcessor] (build-36) Unable to determine a database type for default datasour

And these warnings make sense as you have not added any JDBC related extensions

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Aug 2, 2024
@fedinskiy
Copy link
Contributor Author

@geoand try to drop "spring-data-jpa" from the creation command (ie make it look like this: mvn io.quarkus.platform:quarkus-maven-plugin:3.13.0:create -DprojectGroupId=my-groupId -DprojectArtifactId=app -DprojectVersion=1.0.0-SNAPSHOT -DpackageName=org.my.group -DquarkusRegistryClient=false -DplatformVersion=3.13.0 -Dextensions=quarkus-rest,spring-boot-properties,spring-di,spring-security,spring-web && cd app)
The warnings you mentioned will be gone, but the reflection warning will stay

@geoand
Copy link
Contributor

geoand commented Aug 2, 2024

In that case I see the following on reload:

WARN  [io.qua.arc.pro.BeanArchives] (build-9) Failed to index org.springframework.aot.hint.annotation.Reflective: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV for app-1.0.0-SNAPSHOT@37a3eb7f

@geoand
Copy link
Contributor

geoand commented Aug 2, 2024

@aureamunoz ^

@fedinskiy
Copy link
Contributor Author

@geoand yes, that is the one I meant. I will change the description to make it more clear

fedinskiy added a commit to fedinskiy/quarkus-startstop that referenced this issue Aug 5, 2024
- Change all dependencies to the latest versions
- Add a bit of debugging related to quarkusio/quarkus#42237 and quarkusio/quarkus#42248
- After 3.13.0 quarkus OTEL exporter uses GRPC streams to export traces.
  Our hacked together OTEL server could not handle that and was rewritten to conform to OTEL specifications more.
fedinskiy added a commit to fedinskiy/quarkus-startstop that referenced this issue Aug 5, 2024
- Change all dependencies to the latest versions
- Add a bit of debugging related to quarkusio/quarkus#42237 and quarkusio/quarkus#42248
- After 3.13.0 quarkus OTEL exporter uses GRPC streams to export traces.
  Our hacked together OTEL server could not handle that and was rewritten to conform to OTEL specifications more.
fedinskiy added a commit to fedinskiy/quarkus-startstop that referenced this issue Aug 5, 2024
- Change all dependencies to the latest versions
- Add a bit of debugging related to quarkusio/quarkus#42237 and quarkusio/quarkus#42248
- After 3.13.0 quarkus OTEL exporter uses GRPC streams to export traces.
  Our hacked together OTEL server could not handle that and was rewritten to conform to OTEL specifications more.
@geoand geoand removed the triage/needs-feedback We are waiting for feedback. label Aug 5, 2024
@aureamunoz
Copy link
Member

I've just seen this one. The org.springframework.aot.hint.annotation.Reflective wasn't included in our quarkus-spring dependency but it has been in #42895 so it will be released with 3.14.2 and the warning should be gone

@michalvavrik
Copy link
Member

I've just seen this one. The org.springframework.aot.hint.annotation.Reflective wasn't included in our quarkus-spring dependency but it has been in #42895 so it will be released with 3.14.2 and the warning should be gone

@aureamunoz #42895 is merged and present in 3.14.2, I tested this reproducer with 3.14.4 and the issue is still present. Will you have a look?

@aureamunoz
Copy link
Member

Hi, I just looked at it and I can't reproduce it. Everything works fine for me, I don't have any errors. Do you have the project in question?

@michalvavrik
Copy link
Member

Hi, I just looked at it and I can't reproduce it. Everything works fine for me, I don't have any errors. Do you have the project in question?

I only saw it in CI when I bumped Quarkus to 3.14.4. Let me try it locally and report back.

@michalvavrik
Copy link
Member

Here are steps to reproduce:

mvn io.quarkus.platform:quarkus-maven-plugin:3.14.4:create -DprojectGroupId=my-groupId -DprojectArtifactId=app -DprojectVersion=1.0.0-SNAPSHOT -DpackageName=org.my.group -DquarkusRegistryClient=false -DplatformVersion=3.14.4 -Dextensions=quarkus-rest,spring-boot-properties,spring-di,spring-security,spring-web && cd app

mvn clean quarkus:dev

Wait for the app to start and reload it by pressing s or by adding a new class.

@michalvavrik
Copy link
Member

2024-09-17 12:58:32,670 WARN [io.qua.arc.pro.BeanArchives] (build-25) Failed to index org.springframework.aot.hint.annotation.Reflective: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV for app-1.0.0-SNAPSHOT@61e16160

@aureamunoz
Copy link
Member

No way to reproduce:

~/tmp/app  mvn clean quarkus:dev                                                                                                                                                                                       ✔  14:34:10 
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------------< my-groupId:app >---------------------------
[INFO] Building app 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ app ---
[INFO] Deleting /Users/auri/tmp/app/target
[INFO] 
[INFO] --- quarkus:3.14.4:dev (default-cli) @ app ---
[INFO] Invoking resources:3.3.1:resources (default-resources) @ app
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] Invoking quarkus:3.14.4:generate-code (default) @ app
[INFO] Invoking compiler:3.13.0:compile (default-compile) @ app
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 2 source files with javac [debug parameters release 21] to target/classes
[INFO] Invoking resources:3.3.1:testResources (default-testResources) @ app
[INFO] skip non existing resourceDirectory /Users/auri/tmp/app/src/test/resources
[INFO] Invoking quarkus:3.14.4:generate-code-tests (default) @ app
[INFO] Invoking compiler:3.13.0:testCompile (default-testCompile) @ app
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 4 source files with javac [debug parameters release 21] to target/test-classes
Listening for transport dt_socket at address: 5005
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2024-09-17 14:34:51,257 INFO  [io.quarkus] (Quarkus Main Thread) app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.14.4) started in 1.526s. Listening on: http://localhost:8080

2024-09-17 14:34:51,260 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2024-09-17 14:34:51,260 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, rest-jackson, security, smallrye-context-propagation, spring-boot-properties, spring-di, spring-security, spring-web, vertx]
2024-09-17 14:34:57,103 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Restarting as requested by the user.
2024-09-17 14:34:57,115 INFO  [io.quarkus] (Quarkus Main Thread) app stopped in 0.010s
2024-09-17 14:34:57,211 WARN  [io.qua.arc.pro.BeanArchives] (build-15) Failed to index org.springframework.aot.hint.annotation.Reflective: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV for app-1.0.0-SNAPSHOT@12d99494
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2024-09-17 14:34:57,357 INFO  [io.quarkus] (Quarkus Main Thread) app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.14.4) started in 0.240s. Listening on: http://localhost:8080

2024-09-17 14:34:57,357 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2024-09-17 14:34:57,358 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, rest-jackson, security, smallrye-context-propagation, spring-boot-properties, spring-di, spring-security, spring-web, vertx]
2024-09-17 14:34:57,358 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Live reload total time: 0.258s 
2024-09-17 14:34:58,555 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Restarting as requested by the user.
2024-09-17 14:34:58,560 INFO  [io.quarkus] (Quarkus Main Thread) app stopped in 0.004s
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2024-09-17 14:34:58,763 INFO  [io.quarkus] (Quarkus Main Thread) app 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.14.4) started in 0.202s. Listening on: http://localhost:8080

2024-09-17 14:34:58,763 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2024-09-17 14:34:58,763 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, rest-jackson, security, smallrye-context-propagation, spring-boot-properties, spring-di, spring-security, spring-web, vertx]
2024-09-17 14:34:58,764 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Aesh InputStream Reader) Live reload total time: 0.210s 

--
Tests paused
Press [e] to edit command line args (currently ''), [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options>

This is my env:

 ~/tmp/app  java -version                                                                                                                                                                                      ✔  1m 24s  14:33:55 
openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)
 ~/tmp/app  mvn -version                                                                                                                                                                                                ✔  14:33:58 
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /Users/auri/.sdkman/candidates/maven/current
Java version: 21.0.3, vendor: Eclipse Adoptium, runtime: /Users/auri/.sdkman/candidates/java/21.0.3-tem
Default locale: es_ES, platform encoding: UTF-8
OS name: "mac os x", version: "14.6.1", arch: "aarch64", family: "mac"
 ~/tmp/app  quarkus -version                                                                                                                                                                                            ✔  14:34:06 
3.4.1

@michalvavrik
Copy link
Member

No way to reproduce

Just read your logs, there is 2024-09-17 14:34:57,211 WARN [io.qua.arc.pro.BeanArchives] (build-15) Failed to index org.springframework.aot.hint.annotation.Reflective: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV for app-1.0.0-SNAPSHOT@12d99494.

@michalvavrik
Copy link
Member

btw @aureamunoz I am glad you are looking into this, thank you

@aureamunoz
Copy link
Member

No way to reproduce

Just read your logs, there is 2024-09-17 14:34:57,211 WARN [io.qua.arc.pro.BeanArchives] (build-15) Failed to index org.springframework.aot.hint.annotation.Reflective: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader: DEV for app-1.0.0-SNAPSHOT@12d99494.

Oups!

@aureamunoz
Copy link
Member

It appears that the @Reflective annotation is part of a new specific Spring Framework dependency, which comes from the Spring Experimental AOT package. This dependency is not currently included in any of our Quarkus Spring* dependencies.

Initially, I added this class to be included in the quarkus-spring-aop module because I didn’t notice the aot distinction. The package name for the class is very similar to the AOP module's and doesn’t include the word "experimental," which led to the confusion.

To resolve this, a new Quarkus Spring Experimental project/artifact/dependency will need to be created to support this functionality.

@aureamunoz
Copy link
Member

aureamunoz commented Sep 25, 2024

false alarm, it can be included in the quarkus-spring-core

aureamunoz added a commit to aureamunoz/quarkus that referenced this issue Sep 25, 2024
@aureamunoz
Copy link
Member

PR for fixing this created: #43501

@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 26, 2024
mskacelik pushed a commit to mskacelik/quarkus that referenced this issue Sep 27, 2024
@gsmet gsmet modified the milestones: 3.16.0.CR1, 3.15.2 Oct 18, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 21, 2024
Fixes quarkusio#42237

(cherry picked from commit 9cf2c80)
bschuhmann pushed a commit to bschuhmann/quarkus that referenced this issue Nov 16, 2024
jedla97 added a commit to jedla97/quarkus-startstop that referenced this issue Dec 12, 2024
rsvoboda pushed a commit to quarkus-qe/quarkus-startstop that referenced this issue Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/spring Issues relating to the Spring integration kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants