users@glassfish.java.net

JMS Authentication

From: <glassfish_at_javadesktop.org>
Date: Mon, 03 Mar 2008 07:53:42 PST

Hi,

There are several related posts, but none of them seem to solve my problem. I have a client which tries to send a message to a queue. However, I removed the anonymous user from the message queue and there is only one "admin/admin"-user left. One should think that this code works:

   ConnectionFactory cf = (ConnectionFactory) context.lookup("jms/org/ortec/magonia/ImportJobFactory");
        Connection conn = null;
        Session s = null;
        try {
            conn = cf.createConnection("admin", "admin");
            s = conn.createSession(false, s.AUTO_ACKNOWLEDGE);
            Destination destination = (Destination) context.lookup("jms/org/ortec/magonia/ImportJob");
            MessageProducer mp = s.createProducer(destination);
....

However, this piece of code always tries to connect using the "guest" credentials. I already changed the domain.xml into:

      <jms-service addresslist-behavior="random" addresslist-iterations="3" default-jms-host="default_JMS_host" init-timeout-in-seconds="60" reconnect-attempts="3" reconnect-enabled="true" reconnect-interval-in-seconds="5" type="EMBEDDED">
        <jms-host admin-password="admin" admin-user-name="admin" host="localhost" name="default_JMS_host" port="7676"/>
        <property name="userName" value="admin"/>
        <property name="password" value="admin"/>
      </jms-service>

But that doesn't do it either....

Could somebody tell me what I have to do on the client-side and on the server-side to rectify this? Should I add properties to my InitialContext?

BTW: calling EJBs over the same Initialcontext with ProgrammaticLogin functions.

Greetings,
Jan
[Message sent by forum member 'ossaert' (ossaert)]

http://forums.java.net/jive/thread.jspa?messageID=262006