java.lang.NoSuchMethodError:org.codehaus.jackson.JsonFactory.enable(Lorg / codehaus / jackson / JsonParser $ Feature;

时间:2017-07-03 16:37:45

标签: json apache jackson avro

我在Eclipse中执行java代码时遇到错误(我没有使用Maven)

a = 3
attr(a, 'time_defined') = Sys.time()
b = 4
attr(b, 'time_defined') = Sys.time()

save(a, b, file = 'my_data.RData')

# ... later on ...

load('my_data.RData')

if(difftime(attr(a, 'time_defined'), Sys.time(), units = 'days') > 10) # do the following if more than 10 days old

我正在使用罐子:

Exception in thread "main" java.lang.NoSuchMethodError: org.codehaus.jackson.JsonFactory.enable(Lorg/codehaus/jackson/JsonParser$Feature;)Lorg/codehaus/jackson/JsonFactory;
    at org.apache.avro.Schema.<clinit>(Schema.java:88)
    at org.apache.avro.Schema$Parser.parse(Schema.java:997)
    at com.rishav.avro.AvroExampleWithoutCodeGeneration.serialize(AvroExampleWithoutCodeGeneration.java:36)
    at com.rishav.avro.AvroExampleWithoutCodeGeneration.main(AvroExampleWithoutCodeGeneration.java:94)

第36行 - &gt; Schema schema = new Schema.Parser()。parse(new File(“StudentActivity.avsc”));

avro-1.8.2.jar
java-jason.jar
jason-simple-1.1.1.jar
org.apache.sling.commons.json-2.0.6-sources.jar
org.apache.sling.launchpad-9
jackson-core-asl-1.1.0.jar
jackson-mapper-asl-1.1.0.jar

1 个答案:

答案 0 :(得分:0)

你可以改为:

Schema schema = new Schema.Parser().parse.newFile("resources/StudentActivity.avsc");