参考这篇文章https://www.cnblogs.com/fanqisoft/p/10283156.html

 

将提供者配置类中的

1     @Bean
2     public HessianServiceExporter hessianExporterUserService(UserService userService){
3         HessianServiceExporter hessianServiceExporter = new HessianServiceExporter();
4         hessianServiceExporter.setService(userService);
5         hessianServiceExporter.setServiceInterface(UserService.class);
6         return hessianServiceExporter;
7     }

替换为

1     @Bean
2     public HttpInvokerServiceExporter httpExporterUserService(UserService userService){
3         HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter();
4         exporter.setService(userService);
5         exporter.setServiceInterface(UserService.class);
6         return exporter;
7     }

 

将服务消费者

1     @Bean
2     public HessianProxyFactoryBean userService(){
3         HessianProxyFactoryBean proxy = new HessianProxyFactoryBean();
4         proxy.setServiceUrl("http://localhost:8081/SpringRmiService_war_exploded/user.service");
5         proxy.setServiceInterface(UserService.class);
6         return proxy;
7     }

替换为

1     @Bean
2     public HttpInvokerProxyFactoryBean userService(){
3         HttpInvokerProxyFactoryBean proxy = new HttpInvokerProxyFactoryBean();
4         proxy.setServiceUrl("http://localhost:8081/SpringRmiService_war_exploded/user.service");
5         proxy.setServiceInterface(UserService.class);
6         return proxy;
7     }

 

相关文章:

  • 2021-10-03
  • 2022-01-03
  • 2022-12-23
  • 2021-10-26
  • 2021-09-30
  • 2021-10-20
猜你喜欢
  • 2021-12-22
  • 2021-08-15
  • 2021-08-23
  • 2021-07-26
  • 2021-11-14
  • 2021-12-21
  • 2021-11-05
相关资源
相似解决方案