Open
Description
We were attempting to upgrade our project to Avro 1.12.0 with jackson-dataformat-avro
version 2.17.2
The failure I get is as follows:
Exception in thread "main" java.lang.NoSuchMethodError: 'org.apache.avro.Schema$Parser org.apache.avro.Schema$Parser.setValidate(boolean)'
at com.fasterxml.jackson.dataformat.avro.AvroMapper.schemaFrom(AvroMapper.java:240)
at com.fmr.difrango.ztester.DemoJacksonAvroFailure.main(DemoJacksonAvroFailure.java:23)
To demonstrate this, I created the following example program that uses issue19.avsc as the schema to load.
package com.difrango.ztester;
import com.fasterxml.jackson.dataformat.avro.AvroMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
public class DemoJacksonAvroFailure {
private static final Logger LOGGER = LoggerFactory.getLogger(DemoJacksonAvroFailure.class);
public static void main(String[] args) {
var expectedStream =
DemoJacksonAvroFailure.class.getClassLoader().getResourceAsStream("issue19.avsc");
var mapper = new AvroMapper();
mapper.registerModule(new Jdk8Module());
mapper.registerModule(new JavaTimeModule());
try {
var expected = mapper.schemaFrom(expectedStream);
} catch (IOException e) {
LOGGER.error("Error Handling the Schema", e);
}
}
}