Skip to content

Instantly share code, notes, and snippets.

@bobby
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobby/cf472afba67e5cd60e6e to your computer and use it in GitHub Desktop.
Save bobby/cf472afba67e5cd60e6e to your computer and use it in GitHub Desktop.
immutant.messaging subscription NPE
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
<queues>
<queue name="jms.topic.notification">
<address>jms.topic.notification</address>
</queue>
</queues>
</configuration>
(require '[immutant.messaging :as msg])
(def context (msg/context {:host "localhost"
:reconnect-attempts 10
:reconnect-retry-interval 10
:reconnect-retry-interval-multiplier 2
:client-id "foo"}))
(def topic (msg/topic "notification" :context context))
(def msgs (atom []))
(def subscription (msg/subscribe topic "foo" #(swap! msgs conj %)))
clojure.lang.Compiler$CompilerException: java.lang.NullPointerException, compiling:(bug.clj:12:19)
java.lang.NullPointerException:
org.projectodd.wunderboss.messaging.hornetq.HQMessaging.lookupJNDI HQMessaging.java: 371
org.projectodd.wunderboss.messaging.hornetq.HQMessaging.lookupJNDI HQMessaging.java: 376
org.projectodd.wunderboss.messaging.hornetq.HQMessaging.lookupTopic HQMessaging.java: 354
org.projectodd.wunderboss.messaging.hornetq.HQTopic.jmsDestination HQTopic.java: 107
org.projectodd.wunderboss.messaging.hornetq.HQTopic.subscribe HQTopic.java: 46
immutant.messaging.internal/topic-with-meta/reify/subscribe internal.clj: 73
immutant.messaging/subscribe messaging.clj: 326
...
boot.user/eval4681 boot.user6860085433588932183.clj: 1
...
clojure.core/eval core.clj: 3079
(require '[immutant.messaging :as msg])
(msg/queue "blah")
(def context (msg/context {:host "localhost"
:reconnect-attempts 10
:reconnect-retry-interval 10
:reconnect-retry-interval-multiplier 2
:client-id "foo"}))
(def topic (msg/topic "notification" :context context))
(def msgs (atom []))
(def subscription (msg/subscribe topic "foo" #(swap! msgs conj %)))
clojure.lang.Compiler$CompilerException: javax.jms.InvalidDestinationRuntimeException: HQ129010: Topic (Destination) cannot be null, compiling:(workaround.clj:14:19)
javax.jms.InvalidDestinationRuntimeException: HQ129010: Topic (Destination) cannot be null
javax.jms.InvalidDestinationException: HQ129010: Topic (Destination) cannot be null
org.hornetq.jms.client.HornetQSession.checkTopic HornetQSession.java: 481
org.hornetq.jms.client.HornetQSession.createDurableConsumer HornetQSession.java: 538
org.hornetq.jms.client.HornetQJMSContext.createDurableConsumer HornetQJMSContext.java: 565
org.projectodd.wunderboss.messaging.hornetq.HQTopic.subscribe HQTopic.java: 46
immutant.messaging.internal/topic-with-meta/reify/subscribe internal.clj: 73
immutant.messaging/subscribe messaging.clj: 326
...
boot.user/eval4683 boot.user3602822928222714245.clj: 1
...
clojure.core/eval core.clj: 3079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment