2009-11-25 6 views
0

메시지를 처리하고 메시지를 처리 ​​할 수 ​​있도록 원격 서버의 큐 ("JBoss MQ"를 실행하는)로 메시지를 보내야합니다. 위의 코드를 실행할 때원격 서버에 JMS 메시지 보내기

Properties properties = new Properties(); 
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); 
    properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces"); 
    properties.put(Context.PROVIDER_URL, "jnp://192.168.1.131.129:1299"); 
    InitialContext jndiContext = new InitialContext(properties); 

    //[2] Look up connection factory and queue. 
    ConnectionFactory connectionFactory = (ConnectionFactory)jndiContext.lookup("UIL2XAConnectionFactory"); 
    Queue queue = (Queue)jndiContext.lookup("Queue/DataTransferQueue"); 

하지만 예외가 : 는 (비록, 내가 원격 서버를 Ping 할 수 있습니다).

javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.1.131.129:1299 and 
discovery failed with error: javax.naming.CommunicationException: 
Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] 
[Root exception is javax.naming.CommunicationException: Failed to connect to server 192.168.1.131.129:1299 

원격 대기열에 연결하기 위해 특별한 방법이 있습니까?

+0

왜이 기능을 사용합니까? – Adam

답변

1

사용중인 IP 주소가 올바르지 않습니다 : 192.168.1.131.129 5 개 번호를 가지고, 그것은 단지 나는 다음과 같은 프로세스 인수와 함께 내 JBoss 서버를 다시 시작하여 문제를 해결 4.

+0

오타와를 수정하고 다시 시도해 주셔서 감사합니다. – Attilah

1

이 있어야합니다

-b 0.0.0.0

JBoss 서버는 기본적으로 로컬 연결 만 허용하기 위해 시작됩니다. 앞에서 언급 한 인수로 시작하여 원격 연결을 허용하도록 지시합니다.