-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Describe the bug
Given classes SuperClass
and ImplClass
in different packages with ImplClass extends SuperClass
, a @PreDestroy
annotated method on the SuperClass
can not be called by quarkus.
Error message reads:
Error occurred while destroying instance of bean [ImplClass_Bean]: java.lang.IllegalAccessError: ImplClass_Bean tried to access method 'void SuperClass.preDestroyHook()' (ImplClass_Bean and SuperClass are in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader
Expected behavior
The preDestroyHook()
gets called successfully regardless of modifiers.
Actual behavior
The preDestroyHook()
only gets called successfully if it is public
.
For default and protected
visibility, the behavior as described above occurs.
For private
, the method gets called successfully, but arc warns about private visibility not being recommended.
How to Reproduce?
Output of uname -a
or ver
No response
Output of java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
tested for each of 3.0.0.Alpha3, 2.16.0.Final, 2.13.7.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response