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

JDK 18 version sanity check raising AbstractMethodError #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hc747
Copy link

@Hc747 Hc747 commented Aug 31, 2022

Account for java.lang.AbstractMethodError in same clause of try-catch construct when performing version sanity check.

I.e.

Unexpected problem occured during version sanity check
Reported exception:
java.lang.AbstractMethodError: Receiver class org.apache.logging.slf4j.SLF4JServiceProvider does not define or inherit an implementation of the resolved method 'abstract java.lang.String getRequestedApiVersion()' of interface org.slf4j.spi.SLF4JServiceProvider.
	at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:297)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:141)
	at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:421)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:407)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:356)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:382)
	at io.micronaut.runtime.Micronaut.<clinit>(Micronaut.java:50)

… construct when performing version sanity check.
@hazendaz
Copy link
Contributor

@Hc747 What slf4j are you using?

@ceki
Copy link
Member

ceki commented Aug 31, 2022

How is this related to JDK 18? I do not think it is.

Which logging back-end are you using? Is it log4j 2.18 or earlier?

@Hc747
Copy link
Author

Hc747 commented Sep 1, 2022

@Hc747 What slf4j are you using?

My configuration is as follows:

Oracle OpenJDK 18.0.2.1+1-1
slf4j_version=2.0.0
log4j2_version=2.18.0
api "org.slf4j:slf4j-api:$slf4j_version"
api "org.apache.logging.log4j:log4j-api:$log4j2_version"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:$log4j2_version"
implementation "org.apache.logging.log4j:log4j-core:$log4j2_version"

@Hc747
Copy link
Author

Hc747 commented Sep 1, 2022

How is this related to JDK 18? I do not think it is.

Which logging back-end are you using? Is it log4j 2.18 or earlier?

Might be related to JDK 18 as the invocation throws an AbstractMethodError rather than a NoSuchFieldError - not sure if this behaviour was changed in JDK 18, but it clearly deviates from the expected behaviour, as we arrive in the component of the try-catch clause that catches all exceptions.

@Hc747 Hc747 closed this Sep 1, 2022
@Hc747 Hc747 reopened this Sep 1, 2022
@ceki
Copy link
Member

ceki commented Sep 1, 2022

I think this issue is related to log4j2 version 2.18.0 which does not yet fully support SLF4J 2.0.

See also LOG4J2-3370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants