kotlinx-lincheck
kotlinx-lincheck copied to clipboard
Slf4j incompatibility
When running a test which uses Slf4J's LoggerFactory.getLogger, the test fails (in both stress-testing and model-testing) with:
java.lang.reflect.InvocationTargetException
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl could not be instantiated: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl cannot be cast to javax.xml.parsers.SAXParserFactory
Full stack trace | Source commit.
Full reproduction
Scripted as a Dockerfile for ease of use, but should do the same with any Java installation:
FROM archlinux:base
# Requires a working JRE
RUN pacman -Syuu --noconfirm git jre-openjdk
ENV JAVA_HOME=/usr/lib/jvm/default-runtime
# Checkout the project
RUN mkdir -p /opt
RUN git clone https://gitlab.com/opensavvy/pedestal.git /opt/pedestal
WORKDIR /opt/pedestal
RUN git switch --detach 1c5c820f
# Run the JVM tests
RUN ./gradlew cache:jvmTest
It seems a common pattern that Lincheck fails with logging libraries (#133, #116), but the error message is quite different, so I don't know if it's the same underlying problem or not.
The issue will likely be automatically resolved with #136
Hi, @CLOVIS-AI! It has taken a while to address the issue, but the recent 2.30 release should've fixed it. Could you please check?
Hi! Indeed, it seems to work, now.
Well, at least, it runs, takes some time, and then ends without printing any errors. Can you take a quick look at the test in case I wrote it incorrectly :pray:?
@CLOVIS-AI, the test looks good to me!
Since the issue has been fixed, I'm closing it now.