Java Message Service By Richard Monson-Haefel and David A. Chappell Unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. This page was updated April 9, 2008 Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification UNCONFIRMED errors and suggestions from readers: (5) Figure 1-3; The three JMS clients should be named "Application A", "Application B", "Application C" and not all as "Application C {28} 5th paragraph; Here is the original quote: "The Topic object encapsulates a vendoe specific name for identifying a physical topic in the message server. The topic object has one method getName(), ..." These are really 2 methods (in The topic object) AND it's getTopicName() {35} Figure 3-1. Anatomy of a message; JMSCorrelationID header field is repeated {37} Last paragraph; The method for setting delivery mode is named setDeliveryMode() and NOT setJMSDeliveryMode() as dictated by the MessageProducer interface. {40} 5th paragraph; In the sentence "The value of a property can be a String, boolean, byte, double, int, long or float", the type "short" should be added. [42] 3rd paragraph; the sample code won't compile. The corrected version is: Enumeration propertyNames = message.getPropertyNames(); while (propertyNames.hasMoreElements()) { String name = (String) propertyNames.nextElement(); Object value = message.getObjectProperty(name); System.out.println("\nname" + " = " + value); } (44) 1st paragraph; The page is about message selectors and how the format of a selector is a subset of SQL-92. The example given appears to contain invalid SQL: session.createSubscriber(chatTopic, " username != 'William' ", false); The != is incorrect syntax and should be <> as described in Appendix D. {44} Line 9 from the bottom; "'username != 'William'" have an extra ' before the word "username". (49) 1st paragraph; Third sentence refers to "set() methods" when it should say "write() methods". [51] 2nd paragraph; The sentence "...the pointer in the stream must be reset..." should be changed to "...the pointer in the stream is reset..." since this is done by the JMS provider. The application developer has no way of doing this. Also, this words the paragraph like the last paragraph on page 53. [53] Table 3-1: Table incorrectly shows that a char primitive can be read in as a String from a StreamMessage [82] QRetailer constructor; The line tFactory = (TopicConnectionFactory)jndi.lookup(broker); should read tFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory"); The same reasoning applies to qFactory [85] QRetailer constructor; The line tFactory = (TopicConnectionFactory)jndi.lookup(broker); should read tFactory = (TopicConnectionFactory)jndi.lookup("TopicConnectionFactory"); The same applies to the line qFactory = (QueueConnectionFactory)jndi.lookup(broker); should read qFactory = (QueueConnectionFactory)jndi.lookup("QueueConnectionFactory"); [87] middle of the page of sample code ; I've compiled QWholesaler and have a casting error. When I look through the code, it's obvious that the argument is not correct. Both of the jndi.lookup takes in broker as argument but casts them to be TopicConnnectionFactory and QueueConnectionFactory. The sample code is as follows: tFactory = (TopicConnectionFactory)jndi.lookup(broker); qFactory = (QueueConnectionFactory)jndi.lookup(broker); tConnect = tFactory.createTopicConnection(username, password); {94} code sample at bottom of page; The two lines System.out.println("[" + message.getText() + "]"); if (message != null) { should clearly be swapped. If the message is null, you would not want to call message.getText(). [118] 1st paragraph; The sentence "if the message is NOT redelivered AND it is NOT already in a rollback," should be changed to "if the message is NOT redelivered OR it is NOT already in a rollback," because the negation of the expression A && B is NOT A || NOT B. {121} The whole page; A lot of Java type casts are missing from the source code. (130) 5th paragraph, starts with "Although Java has...": The word "links" at the end of the first sentence should be "leaks". (151) "When messages are received from the wholesalers, RetailerMessageBean can process them quickly and efficiently, providing a more scalable option then the JMS clients we developed in Chapter 4:" should be "When messages are received from the wholesalers, RetailerMessageBean can process them quickly and efficiently, providing a more scalable option than the JMS clients we developed in Chapter 4:" i.e. then --> than (154) After end of last sentence of chapter 8: The words "message-driven beans" appear after the last sentence; they should be removed. {201} Last source code example on page; Same error as "[42] 3rd paragraph;"