小编F. *_*rov的帖子

Bean 引用被 [com.sun.proxy.$Proxy159] 类型的不兼容 bean 实例覆盖

我是开发 Web 服务的初学者,我有一个 jaxrs Web 服务,它具有以下配置:

@Configuration
@ComponentScan("com.example.service")
@ComponentScan("com.example.services")
@ImportResource({
"classpath:/META-INF/cxf/cxf.xml",
"classpath:/META-INF/cxf/cxf-servlet.xml"
})



public class AppConfig {
@Bean(destroyMethod = "shutdown")
public SpringBus cxf() {
return new SpringBus();
}


@Bean
public Server jaxRsServer() {

//Define swagger feature
Swagger2Feature feature = new Swagger2Feature();


//REST Factory with all services,providers and features
JAXRSServerFactoryBean factory = RuntimeDelegate.getInstance().createEndpoint(jaxRsApiApplication(), JAXRSServerFactoryBean.class);
factory.setServiceBeans(Arrays.asList(baseRestService(), materialsRestService(), batchRestService(), billingRestService(), locationRestService(), customerRestService(), equipmentRestService(), projectRestService(), reservationRestService(), waferRestService()));
factory.setAddress(factory.getAddress());
factory.setProviders(Arrays.asList(jsonProvider(), authenticationService()));
factory.getFeatures().add(feature);
return factory.create();
}

@Bean
public JaxRsApiApplication jaxRsApiApplication() {
return new JaxRsApiApplication();
}

@Bean …
Run Code Online (Sandbox Code Playgroud)

rest spring jax-rs spring-bean

2
推荐指数
1
解决办法
4133
查看次数

标签 统计

jax-rs ×1

rest ×1

spring ×1

spring-bean ×1