3

Spring JMS going against a JBoss 4.x JBossMQ queue (I know, old JBoss, JBossMQ superseded by JBoss Messaging, but I can't change the stack). Everything works when the Spring JMS configuration is loaded at startup, but when I make the JNDI lookups lazy, so that they are first loaded when I want to send a JMS message, I get the following exception:

org.springframework.jms.InvalidDestinationException: Destination is not an instance of SpyDestination QUEUE.myQueueName; nested exception is javax.jms.InvalidDestinationException: Destination is not an instance of SpyDestination QUEUE.myQueueName
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:285)

My config:

    <jee:jndi-lookup id="beanNameForMyQueue" 
    jndi-name="queue/myQueueName" 
    resource-ref="true" environment-ref="jndiEnvironment" 
    lookup-on-startup="false" cache="true" proxy-interface="javax.jms.Queue" />

I found a JBoss JIRA on this, and this similar HornetQ post, but so far no dice.

Am I just out of luck with the lazy init, or is there a workaround?

atrain
  • 9,139
  • 1
  • 36
  • 40

0 Answers0