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

Unnamed module issue when using FailureAnalyzer with JPMS #28881

Closed
eallais opened this issue Jul 27, 2022 · 4 comments
Closed

Unnamed module issue when using FailureAnalyzer with JPMS #28881

eallais opened this issue Jul 27, 2022 · 4 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression)

Comments

@eallais
Copy link

eallais commented Jul 27, 2022

I am trying to make FailureAnalyzer working with Java Platform Module System (JPMS) on JDK 11.

FailureAnalyzer is working great when there is not module-info.java, in contrary when this file exists I've got this stacktrace:

Caused by: java.lang.IllegalAccessException: module com.example.failureanalyzer does not open com.example.failureanalyzer to unnamed module @3b74ac8
	at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:202) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:506) ~[spring-core-5.3.21.jar:5.3.21]
	... 27 common frames omitted

Here is the content of module-info.java:

module com.example.failureanalyzer {
    requires spring.context;
    requires spring.beans;
    requires spring.boot.autoconfigure;
    requires spring.boot;
}
@eallais eallais changed the title Unnamed module issue with using FailureAnalyzer with JPMS Unnamed module issue when using FailureAnalyzer with JPMS Jul 27, 2022
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 27, 2022
@bclozel
Copy link
Member

bclozel commented Jul 27, 2022

I think this might be a duplicate of #27753, since Spring Boot's FailureAnalyzer infrastructure is loaded with SpringFactoriesLoader.

@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Feb 9, 2023
@jhoeller
Copy link
Contributor

The stacktrace above suggests that a CGLIB proxy is being created from a class in that package. If that is unavoidable, the module needs to be declared as open: https://stackoverflow.com/questions/46482364/what-is-an-open-module-in-java-9-and-how-do-i-use-it - otherwise its visibility is too restricted for such proxy purposes.

@bclozel not sure this is related to SpringFactoriesLoader, actually, it rather looks like a CGLIB proxy requirement.

@rstoyanchev rstoyanchev added the status: waiting-for-feedback We need additional information before we can continue label Feb 21, 2023
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Feb 28, 2023
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 7, 2023
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)
Projects
None yet
Development

No branches or pull requests

5 participants