users@glassfish.java.net

Re: jms durable subscriber fail (Unsupported:setClientID():inACC=false)

From: NBW <emailnbw_at_gmail.com>
Date: Wed, 9 Sep 2009 09:21:24 -0400

You can't use a clientId in session.createDurableSubscriber when you are
using container managed (GF for example) resources. You can only do that
when you are running your subscriber in the Application Container (ACC)
environment.
You have two choices. You can convert to using an MDB instead for your
client, or you create all your resources with the imqadmin tool and not
create anything using the Glassfish administration tools (console or cli),
then when you look your resource up it will be managed outside GF container
and your existing code should work. In a sense with that option your
stateless session bean client becomes a simple JMS client and you lose all
the container managed goodies that an MDB would provide. The MDB is the
recommended way of doing it but will probably involve more refactoring for
you code.

-Noah

On Wed, Sep 9, 2009 at 8:45 AM, zamek42 <zamek42_at_gmail.com> wrote:

>
> Hi All,
>
> I need a status topic for my application to send/receive status messages.
> Sender is working well, and reader is working from standalone client
> application. I need a web client reader for this topic, via a stateless
> session bean, but it produce this message.
>
> My topicfactory is:
> jndi name: jms/CTStatusTopicFactory
> Pool Name: jms/CTStatusTopicFactory
> Type: javax.jms.TopicConnectionFactory
> no additional properties: userName=guest, password=guest
>
> My destination is:
> JNDI Name: jms/CTStatusTopic
> resource type: javax.jms.Topic
> there is a property:Name=CTStatusTopic
>
> Here is my opening code in a stateless session bean:
>
> InitialContext ic = new InitialContext();
> this.connectionFactory =
>
> (TopicConnectionFactory)ic.lookup(BGProcessConst.STATUS_TOPIC_FACTORY_NAME);
>
> this.connection = connectionFactory.createTopicConnection();
> this.connection.setClientID("statusId"); // here is the exception
> this.session = this.connection.createTopicSession(false,
> Session.AUTO_ACKNOWLEDGE);
> this.subscriber = this.session.createDurableSubscriber(statusTopic,
> clientId);
>
>
> What is my mistake or how can I make a durable subscription from stateless
> bean?
>
> parameters:
> Debian Gnu Linux unstable, Java 1.6.0_14 from sun, glassfish V2.1
>
> thx a lot
> Zoltan Zidarics
>
> --
> View this message in context:
> http://www.nabble.com/jms-durable-subscriber-fail-%28Unsupported%3AsetClientID%28%29%3AinACC%3Dfalse%29-tp25364251p25364251.html
> Sent from the java.net - glassfish users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>