2014-02-24 2 views
0

에 액세스 할 수 없습니다. Spring을 사용하고 HTTP 호출자 원격 서비스에 액세스하려고 시도하고 있으며 spring-http-client-config.xml에서 URL을 지정했습니다. 메신저이 예외를 받고하지만 왜 임은 HTTP 호출자 원격 서비스

<bean id="securityService" 
     class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean"> 
    <property name="serviceUrl" value="http://blr1272d:8080/MaskOracle/remoting/securityService" /> 
    <property name="serviceInterface" value="com.him.mask.security.remote.service.SecurityService" /> 
    <property name="httpInvokerRequestExecutor" ref="httpInvokerRequestExecuter"/> 

</bean> 
<bean id="httpInvokerRequestExecuter" 
class="org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor" /> 

임 확실하지 이하

org.springframework.remoting.RemoteAccessException: Could not access HTTP invoker remote service at [http://blr1272d:8080/MaskOracle/remoting/securityService]; nested exception is java.io.IOException: Did not receive successful HTTP response: status code = 401, status message = [Unauthorized] 

나는 스프링 HTTP 클라이언트-config.xml 파일에서 지정한 구성 세부 사항 있는 아래 예외를 받고. 문제 해결을 도와주세요. 감사합니다

+1

... 상태 코드 = 401, 상태 메시지 = [Unauthorized] – Stefan

답변

0

http://blr1272d:8080/MaskOracle/remoting/securityService에서 귀하의 서비스는 인증이 필요하지만 귀하의 securityService은 자격 증명을 사용하지 않는 것으로 보입니다.

org.springframework.richclient.security.remoting.BasicAuthCommonsHttpInvokerProxyFactoryBean을 사용하고 authenticationToken 속성을 설정합니다.