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

MBeanExporter produces "Using deprecated '-debug' fallback for parameter name resolution..." warnings #31171

Closed
Sebottenhof99 opened this issue Sep 5, 2023 · 4 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid

Comments

@Sebottenhof99
Copy link

Sebottenhof99 commented Sep 5, 2023

I have a bean that implements NotificationPublisherAware in order to send JMX notifications.

I put then this bean to MBeanExporter's Bean Map:

 Map<String, Object> beans = new HashMap<>();
    String key =  someName;
    beans.put(key, jmxNotificationSender);
    exporter.setBeans(beans);

In this way created MBeanExporter bean then tries to prepare my jmxNotificationSender. Among others exporter invokes createAndConfigureMBean method, which in turn uses MBeanInfoAssembler to scan jmxNotificationSender to obtain some information. I could trace down, that AbstractReflectiveMBeanInfoAssembler as an implementation is used here. This AbstractReflectiveMBeanInfoAssembler invokes getOperationParameters method, which actually causes the warning since it discovers method parameters (introspection).

Will this issue somehow be handled in the future?

Tested with Spring Framework 6.0.9 and Java 17

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 5, 2023
@bclozel
Copy link
Member

bclozel commented Sep 5, 2023

Have you tried compiling your application with the -parameters compiler flag as suggested in the upgrade notes?

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Sep 5, 2023
@sbrannen sbrannen changed the title MBeanExporter produces "Using deprecated '-debug' fallback for parameter name resolution..." warnings MBeanExporter produces "Using deprecated '-debug' fallback for parameter name resolution..." warnings Sep 5, 2023
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Sep 5, 2023
@Sebottenhof99
Copy link
Author

Hello=) yes, sure. And it works out. With this solution I just have a feeling, that it is not a proper solution, but a workaround to push the warning away...maybe I am wrong here

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 5, 2023
@sbrannen
Copy link
Member

sbrannen commented Sep 5, 2023

Hello=) yes, sure. And it works out.

Thanks for the confirmation.

Closing this issue as a result.

With this solution I just have a feeling, that it is not a proper solution, but a workaround to push the warning away...maybe I am wrong here

It's not a workaround. It's the appropriate action to take. The -debug option is deprecated.

Furthermore, LocalVariableTableParameterNameDiscoverer (which relied on -debug) no longer exists in Spring Framework 6.1.

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2023
@sbrannen sbrannen added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Sep 5, 2023
@Sebottenhof99
Copy link
Author

@sbrannen got it, thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants