简体   繁体   中英

Mule 3.7.3 and Jackson 2.9.0 issues-NoSuchMethodError

I am having lots of issues getting Mule to work with Jackson classes. The classes present in my final library only have the following files. To eliminate the possibility of maven pulling in other jackson libraries, I create a mule project without using maven and simply pull in the bare minimum libraries. However, it is failing with NoSuchMethodError for CSVMapper().reader(MyClass) etc. and later with

Caused by: java.lang.NoSuchMethodError: 
               com.fasterxml.jackson.databind.JsonMappingException.<init>
         (Ljava/io/Closeable;Ljava/lang/String;)V

jackson-core-2.9.0.jar jackson-databind-2.9.0.jar jackson-annotations-2.9.0.jar jackson-dataformat-csv-2.9.0.jar

I get NoSuchMethodError when I call methods that are definitely in the classpath. To make matters worse the program runs fine outside of Mule.

It turns out that the following module mule-core.3.7.3 has an older version of Jackson ie 2.4.3. Unfortunately what works with version 2.9.0 now fails with

 Too many entries: expected at most 1 (value #1 (18 chars) "20170822211046.581")

How can solve this problem?

I solved it by using the Jackson libraries provided by Mule ie version 2.4.3 for converted JSON to Java objects. For the CSV conversion to Map I used apache commons-csv replacing Jackson's CSVMapper.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM