quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.56k stars 2.62k forks source link

Warning about failing to index Spring class on reload #42237

Open fedinskiy opened 1 month ago

fedinskiy commented 1 month ago

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
  2. Run in a dev mode: mvn clean quarkus:dev
  3. 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

quarkus-bot[bot] commented 1 month ago

/cc @geoand (spring)

fedinskiy commented 1 month ago

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

geoand commented 1 month ago

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

fedinskiy commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

@aureamunoz ^

fedinskiy commented 1 month ago

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

aureamunoz commented 1 week ago

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 https://github.com/quarkusio/quarkus/pull/42895 so it will be released with 3.14.2 and the warning should be gone