[Originally posted erroneously to the pact-js chan...
# pact-jvm
a
[Originally posted erroneously to the pact-js channel] I'm using pact-jvm version 4.3.7 on a Spring Boot project. Running provider tests with Spring Boot 2.7 works fine, but if I uprev to Spring Boot 3 the test fails with the following stack trace:
Copy code
ANTLR Tool version 4.9.2 used for code generation does not match the current runtime version 4.10.1
ANTLR Runtime version 4.9.2 used for parser compilation does not match the current runtime version 4.10.1

...

Caused by: java.lang.ExceptionInInitializerError
	at au.com.dius.pact.core.support.Version.parse(Version.java:79)
	at au.com.dius.pact.core.model.DefaultPactReader.pactFromJson(PactReader.kt:219)
	at au.com.dius.pact.core.model.DefaultPactReader.loadPact(PactReader.kt:214)
	at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.loadPactsForProvider(PactBrokerLoader.kt:251)
	at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.load(PactBrokerLoader.kt:120)
	at au.com.dius.pact.provider.junit5.PactVerificationInvocationContextProvider$resolvePactSources$pactSources$1$pacts$1.invoke(PactJUnit5VerificationProvider.kt:83)
	at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:39)
	... 60 more
Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
	at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56)
	at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48)
	at au.com.dius.pact.core.support.VersionLexer.<clinit>(VersionLexer.java:115)
	... 67 more
Caused by: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
	... 70 more
I'm guessing that the problem is that an Antlr 4 runtime dependency has been introduced via an uprev from Hibernate 5 to 6 (itself triggered by the uprev from Spring Boot 2 to 3), but pact needs Antlr 3. Is there any way around this? tia
u
4.3.x and 4.4.x won't work with Springboot 3. See https://github.com/pact-foundation/pact-jvm/pull/1663
4.5.0-beta1 has a spring6 module that will work
a
Thanks @uglyog - I will try out the beta!
Good news that seems to have resolved the error - can now run provider verification tests without issue again. Thanks! For anyone else having similar issues it may be worth noting that using Intellij I also had to update my Kotlin plugin version to stop the IDE complaining that it couldn't resolve imports from pact dependencies. Any idea when an official 4.5.0 will be out?
u
Ideally, we can release the non-beta version when we know that there are no issues impacting people. Unfortunately, most people will avoid the beta versions, so we won't know what issues would be impacting people until we release the non-beta version. 😉
a
Lol 😆 I must be swimming against that tide, because I currently rely on betas for both pact-js and pact-jvm.