title: JNDI lookup gives "NullPointerException" when do lookup for a queue in LDAP
body: <p>I have successfully registered and retrieved the connection factory object from LDAP server.But when i try to look up for queue from LDAP server it gives NPE.
  I'm using OracleAQ with ApacheDS..</p>
  
  <p>My code is;</p>
  
  <pre><code>DirContext destctxQF = (DirContext) inictx.lookup("cn=OracleDBQueues");    
  System.out.println("OracleDBQueues look up success " +  destctxQF.toString());
  Queue queue = (Queue) destctxQF.lookup("cn=ratha.test");
  </code></pre>
  
  <p>And my LDIF definition for the queue is;</p>
  
  <pre><code>dn: cn=ratha.test,cn=OracleDBQueues,cn=ORCL,cn=OracleContext,ou=Services,o=s
   gi,c=us
  objectClass: javaContainer
  objectClass: orclDBAQObject
  objectClass: javaNamingReference
  objectClass: javaObject
  objectClass: top
  cn: ratha.test
  javaClassName: oracle.jms.AQjmsDestination
  orcldbaqobjtype: Queue
  javaFactory: oracle.jms.AQjmsDestinationFactory
  orcldbaqobjname: test
  orcldbaqobjowner: ratha
  orcldbaqpointerattr: cn=ratha.test_table,cn=OracleDBQueuesTables,cn=ORCL,cn=
   OracleContext,ou=Services,o=sgi,c=us
  </code></pre>
  
  <p>Any clue on this?
  Complete error stack is;</p>
  
  <pre><code>javax.naming.NamingException: problem generating object using object factory [Root exception is java.lang.NullPointerException]; remaining name 'cn=ratha.test'
      at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:1070)
      at com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(ComponentContext.java:526)
      at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:159)
      at com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:148)
      at OracleAQJNDIClient.get_Factory_from_LDAP(OracleAQJNDIClient.java:93)
      at OracleAQJNDIClient.main(OracleAQJNDIClient.java:142)
  Caused by: java.lang.NullPointerException
      at oracle.jms.AQjmsDestinationFactory.getObjectInstance(AQjmsDestinationFactory.java:120)
      at javax.naming.spi.DirectoryManager.getObjectInstance(DirectoryManager.java:176)
      at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:1063)
      ... 5 more
  </code></pre>
  
  <p>Thanks,
  -Ratha</p>