Description of problem: JMS Connection.getMetaData returns a usable enumeration only on the first call to getMetaData. Invoking getMetaData multiple times, either on the same connection or even completely different connections results in a empty Enumeration. To me more precise, after the first call to getMetaData, subsequent calls during the duration of the JVM, on any connection will return a empty Enumeration. Looks like this is is a bug in the MRG client implementation. Debugging shows that org.apache.qpid.client.CustomJMSXProperty is used to return the metadata Enumeration. But the _names member in this class is static, which means that all connections get the same Enumeration object. So, if someone gets the connection meta and iterates over the Enumeration, other connections see the same modified Enumeration as well. And because the Enumeration's pointer has already been advanced to the end, others are not able to get elements from the Enumeration. How reproducible: Always Steps to Reproduce: 1. Run a client with the following code Connection conn = factory.createConnection(); for (Enumeration meta = conn.getMetaData().getJMSXPropertyNames(); meta.hasMoreElements();) { System.out.println(meta.nextElement()); } System.out.println("Getting connection meta data again"); for (Enumeration meta = conn.getMetaData().getJMSXPropertyNames(); meta.hasMoreElements();) { System.out.println(meta.nextElement()); } 2. Observe that the second time around nothing is printed, since the enumeration is empty. Actual results: If conn.getMetaData().getJMSXPropertyNames() is called a second time on the same connection or in a different connection (from the same JVM) an empty enumeration is returned. Expected results: Every time getJMSXPropertyNames() is called, a enumeration with the property names should be returned.
This issue is tracked in upstream via https://issues.apache.org/jira/browse/QPID-3270 A fix has been committed in upstream. Details as follows. http://svn.apache.org/viewvc?view=rev&rev=1138295 http://svn.apache.org/viewvc?view=rev&rev=1138296
Fix was tested on: RHEL 5.7 x86/x64 qpid-java-common-0.10-9.el5 qpid-java-client-0.10-9.el5 qpid-java-jca-0.10-9.el5 qpid-java-example-0.10-9.el5 RHEL 6.1 x86/x64 qpid-java-jca-0.10-9.el6.noarch qpid-java-common-0.10-9.el6.noarch qpid-java-example-0.10-9.el6.noarch qpid-java-client-0.10-9.el6.noarch changing to VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1339.html