i use client to access a remote topic.the envroment is jboss3.2.2 + MSSQL 
SERVER 2000 + WINDOWS 2000 PRO.the remote topic is configed on jboss3.2.2.when 
the client access the topc,encounter a exception:

org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: 
(java.net.ConnectException: Connection refused: connect)

but when the remote server run on jboss3.2.3,the client can access the remote 
topic successful.
   
the follow is the client code frag:

    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
           "org.jnp.interfaces.NamingContextFactory");
    ht.put(Context.PROVIDER_URL, "192.168.5.157:1099");
    ht.put("java.naming.rmi.security.manager", "yes");
    ht.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");

    // ???JNDI
    Context ctx = new InitialContext(ht);

    // 1: ??JNDI??ConnectionFactory
    TopicConnectionFactory factory =
        (TopicConnectionFactory)
        ctx.lookup("ConnectionFactory");

    // 2: ?ConnectionFactory??JMS??
    TopicConnection connection =
        factory.createTopicConnection();

    // 3: ?Connection????
    TopicSession session = connection.createTopicSession(
        false, Session.AUTO_ACKNOWLEDGE);

    // 4: ??JNDI?????????
    Topic topic = (Topic) ctx.lookup("topic/logInAndOutTopic");

    // 5: ?????????
    TopicPublisher publisher = session.createPublisher(topic);
the code frag in the follow:
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
           "org.jnp.interfaces.NamingContextFactory");
    ht.put(Context.PROVIDER_URL, "192.168.5.157:1099");
    ht.put("java.naming.rmi.security.manager", "yes");
    ht.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");

    // init JNDI
    Context ctx = new InitialContext(ht);

    // 1: find ConnectionFactory 
    TopicConnectionFactory factory =
        (TopicConnectionFactory)
        ctx.lookup("ConnectionFactory");

    // 2:create connection
    TopicConnection connection =
        factory.createTopicConnection();

    // 3: create session
    TopicSession session = connection.createTopicSession(
        false, Session.AUTO_ACKNOWLEDGE);

    // 4: find the topic
    Topic topic = (Topic) ctx.lookup("topic/logInAndOutTopic");

    // 5: create publisher
    TopicPublisher publisher = session.createPublisher(topic);

i must use jboss3.2.2 as the container,please help me.appreciate your help!!

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3859920#3859920

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3859920


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to