Results 1 to 3 of 3

Thread: <jee:jndi-lookup ... lookup-on-startup="false" does not work

  1. #1
    Join Date
    Oct 2011
    Posts
    2

    Default <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?

  2. #2
    Join Date
    Sep 2004
    Location
    Paris-France
    Posts
    31

    Default

    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.

  3. #3
    Join Date
    Feb 2012
    Location
    US
    Posts
    9

    Default

    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
  •