简体   繁体   中英

Spring boot app fails to run in STS but runs fine on command line

When I execute the project on the command line mvn spring-boot:run -Dskiptests , the project loads up just fine. But when I run the project from the STS IDE, Debug As --> Spring Boot App or Debug As --> Debug on Server, I get the below error

java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.asMap(Lcom/google/common/collect/ListMultimap;)Ljava/util/Map;

NoSuchMethodError usually points to a different version of a library being used than what is expected. As the app runs when using mvn , the version in your pom.xml seems to be fine. Please make sure if you have not added a different version of Guava in your project classpath. You may also make sure that you are using the correct version of your Maven settings.xml file in STS, and update the project with 'Force update of snapshots / releases' on.

EDIT: I've just reread your qustion: -Dskiptests may cause the portion of your code that causes the problems be skipped. Please check your pom.xml if you have the correct version of Guava in it.

EDIT 2: The method you are trying to call has been in Guava since 15.0.

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