회사에서 remote로 내가 개발한 분석기 프로그램에 붙어서
데이터를 가져 와야 할 것이 있어서
마침 분석기 프로그램이 spring을 쓰고 있는 참에
spring rmi를 사용하기로 했다...
http invoker도 있지만 web.xml 설정이 좀 더 들어가서.. 그냥 rmi로 -_-;
어차피 배치성으로 접근 할 거라 뭐...
서버쪽에는 xml 설정을 통해 rmi 서비스를 설정해주고
(설정 방법은 여기..)
clinet에서는 단일 어플리케이션이라서.. 그냥 내부에서
RmiClientInterceptor를 사용해서 바로 준비함.
그런데 안 붙는다.. 으잉?
ping도 나가고 telnet으로 port 접근도 되는데
이상하게 계속 connection refused 에러 발생.
팀장님의 도움을 받아 서버쪽 톰캣 구동 시
hostname 옵션을 주어서 해결했다.
잘 붙는다~~
참고 : http://protegewiki.stanford.edu/index.php/Protege_Client_Server_RMI
데이터를 가져 와야 할 것이 있어서
마침 분석기 프로그램이 spring을 쓰고 있는 참에
spring rmi를 사용하기로 했다...
http invoker도 있지만 web.xml 설정이 좀 더 들어가서.. 그냥 rmi로 -_-;
어차피 배치성으로 접근 할 거라 뭐...
서버쪽에는 xml 설정을 통해 rmi 서비스를 설정해주고
(설정 방법은 여기..)
clinet에서는 단일 어플리케이션이라서.. 그냥 내부에서
RmiClientInterceptor를 사용해서 바로 준비함.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RmiClientInterceptor rmiClientInterceptor = new RmiClientInterceptor(); | |
rmiClientInterceptor.setServiceUrl("rmi://xx.xx.xx.xx:1099/SearchService"); | |
rmiClientInterceptor.setServiceInterface(com.tistory.devyongsik.web.service.RemoteSearchService.class); | |
rmiClientInterceptor.afterPropertiesSet(); | |
RemoteSearchService rmiService = (RemoteSearchService)new ProxyFactory(RemoteSearchService.class, rmiClientInterceptor).getProxy(); | |
rmiService.search(); |
그런데 안 붙는다.. 으잉?
ping도 나가고 telnet으로 port 접근도 되는데
이상하게 계속 connection refused 에러 발생.
팀장님의 도움을 받아 서버쪽 톰캣 구동 시
hostname 옵션을 주어서 해결했다.
잘 붙는다~~
참고 : http://protegewiki.stanford.edu/index.php/Protege_Client_Server_RMI