Not sure this is supported any more, also, if its not too late I would switch to activemq, which is.

On 10 November 2012 19:48, Michael O'Sullivan <mjjos1@gmail.com> wrote:
Hi there,

I am using the latest release of openjms. In a small local program I am running to demonstrate queues, I am trying to create a durable topic subscriber programmatically to subscribe to a topic I am also creating programmatically.
However, whenever I call createDurableSubscriber(topic, "alastingsubscription") on my TopicSession object, I always get the following exception:


Unfortunately, an error occured :javax.jms.InvalidDestinationException: No destination with name=MobileComputing exists
javax.jms.InvalidDestinationException: No destination with name=MobileComputing exists
        at org.exolab.jms.messagemgr.ConsumerManagerImpl.getDestination(Consumer
ManagerImpl.java:756)
        at org.exolab.jms.messagemgr.ConsumerManagerImpl.createInactiveDurableCo
nsumer(ConsumerManagerImpl.java:571)
        at org.exolab.jms.messagemgr.ConsumerManagerImpl.createDurableConsumer(C
onsumerManagerImpl.java:345)
        at org.exolab.jms.server.ServerSessionImpl.createDurableConsumer(ServerS
essionImpl.java:343)
        at org.exolab.jms.server.net.RemoteServerSession.createDurableConsumer(R
emoteServerSession.java:245)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.exolab.jms.net.orb.DefaultORB$Handler.invoke(DefaultORB.java:572)

        at org.exolab.jms.net.orb.DefaultORB$1.run(DefaultORB.java:530)
        at org.exolab.jms.common.threads.ThreadPool$NotifyingRunnable.run(Thread
Pool.java:211)
        at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown So
urce)
        at java.lang.Thread.run(Unknown Source)

I have been trying different things for a while now with no luck. The strange thing is, if I create a non-durable topic subscriber, it works perfectly fine. I can also create a TopicPublisher programmatically for the programatically created topic with no problems. I could create the topic with the given name in the config file manually and do a context lookup, and then create a durable subscriber to it, and that does work perfectly. However, for the purposes of the demonstration, I want the users to be able to create topics programmatically on the fly.

I was looking through the source code for openjms using the above stack trace. The createInactiveDurablableSubscriber() method in ConsumerManagerImpl.java calls the getDestination() method, also located in ConsumerManagerImpl.java. It passes a boolean argument of false, called "create" in the formal parameter list of getDestination(), to getDestination(). The javadoc for getDestination() says that "create" indicates if the destination should be created automatically or not if it does not already exist. This I believe leads to the exception being thrown. The createSubscriber() method in ConsumerManagerImpl.java also calls getDestination(), but it passes a true boolean value instead, which leads to the destination being created in this case, which might explain why creating a non-durable subscriber above, actually works. So I am not sure how to approach this problem.

Any advice here would be very much appreciated.

Thanks very much,

Michael




------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
openjms-user mailing list
openjms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openjms-user