我有一个简单的Spring引导应用程序,可以在控制台中正常运行。 但是我不能在VSC中调试它。
代码是:
package com.sample.service.sample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
/**
* sample service
*
*/
@EnableDiscoveryClient
@SpringBootApplication
@EnableBinding(Source.class)
@EnableMongoRepositories(basePackages = "com.sample.service.sample.repositories")
public class ServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceApplication.class, args);
}
}
例外是:
nested exception is java.lang.NoClassDefFoundError: org/objenesis/strategy/InstantiatorStrategy
我在Spring Boot的VSC设置中错过了什么?