NoSuchMethodError with SLF4J API

前端 未结 8 1993
醉梦人生
醉梦人生 2021-01-03 19:19

When Use with slf4j,

String test = blahblahblah;
logger.info(\"{}\",test);

Trace as below

java.lang.NoSuchMethodError: org.         


        
8条回答
  •  别那么骄傲
    2021-01-03 20:06

    In my case, we are having correct version match between the various SLF4J API and integration libraries. But we are also using tika-app jar, which also have SLF4J classes wrapped inside it.

    To check if you are also having some (fat)jar which contains SLF4J classes, On Unix system:

    Go to your WEB-INF/lib/ directory and run following command

    for i in *.jar; do jar -tvf "$i" | grep -Hsi MessageFormatter && echo "$i"; done

    This will print matching result from all jars on console.

    Finally, we replaced tika-app jar by tika-core jar.

提交回复
热议问题