-
Oct 25th, 2011, 09:23 PM
#1
<jee:jndi-lookup ... lookup-on-startup="false" does not work
Hi,
I am trying to connect to a JMS queue on Weblogic 10.3, and the queue lookup is achieved through the spring context. See configuration from application context below
<jee:jndi-lookup id="queue" jndi-name="myOrg.myQueue"/>
This configuration works fine, but I want my queue to be looked up on demand rathar than on startup. My new configuration is as follows (the only change I made):
<jee:jndi-lookup id="queue" jndi-name="myOrg.myQueue" lookup-on-startup="false" proxy-interface="javax.jms.Queue"/>
The ear deployed fine on startup but when I try sending a message to this queue, I get the following exception:
org.springframework.jms.InvalidDestinationExceptio n: [JMSClientExceptions:055142]Foreign destination, MyModule!myOrg.myQueue
Any ideas?
-
Feb 2nd, 2012, 09:38 AM
#2
I have the same problem with Jboss queue when I set lookup-on-startup to false Jboss check the queue object instance of and fail when it is not a JbossDestination type.
the class responsible of jndi object lookup is : JndiObjectFactoryBean, this class create the jndiObject when calling afterPropertiesSet() method.
there are 2 case, if (this.proxyInterfaces != null || !this.lookupOnStartup || !this.cache || this.exposeAccessContext) Spring creates a proxy object after calling loockup method, else lookup method is called directly and the object is stored to jndiObject.
Why Spring proxy the object when I just need to force the lookupOnStartup to false?
how can we get the TargetSource from proxy to pass it to the Jms client provider (Jboss, Weblogic,...)?
Last edited by h; Feb 3rd, 2012 at 07:56 AM.
-
Mar 14th, 2012, 08:59 AM
#3
It worked for me after setting proxy-interface="javax.jms.ConnectionFactory- Please try this
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules