下面我添加了添加Swagger2feature之后的代码
BeanCreationException , BeanInstantiationException and NoSuchMethodError(io.swagger.jaxrs.config.BeanConfig.setUsePathBasedConfig(Z)V)
public static void main(String[] args) {
SpringApplication.run(TechpubsServicesSBApp.class, args);
}
@Bean
public Server rsServer() {
JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
endpoint.setBus(bus);
endpoint.setServiceBeans(Arrays.<Object>asList(testImpl));
endpoint.setAddress("/");
endpoint.setProviders(Arrays.<Object>asList(testExceptionMapper));
endpoint.setProvider(new JacksonJsonProvider());
Swagger2Feature swagger2Feature = new Swagger2Feature();
swagger2Feature.setTitle("Test API");
swagger2Feature.setVersion(deployedVersion.concat("(").concat(deployedInstance.toUpperCase()).concat(")"));
swagger2Feature.setPrettyPrint(true);
swagger2Feature.setSupportSwaggerUi(true);
endpoint.setFeatures(Collections.singletonList(swagger2Feature));
return endpoint.create();
}</i>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rsServer' defined in com.geaviation.techpubs.ws.TechpubsServicesSBApp: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.cxf.endpoint.Server]: Factory method 'rsServer' threw exception; nested exception is java.lang.NoSuchMethodError: io.swagger.jaxrs.config.BeanConfig.setUsePathBasedConfig(Z)V
有没有人遇到类似的错误?