Sun Java Solaris Communities My SDN Account Join SDN
 
Documentation

JMS Specification Errata

 

The JavaTM Message Service specification, Version 1.0.2, contains the following errors.

  1. On page 33 (Section 3.5.9), the specification says that ConnectionMetaData.getJMSXPropertyNames() returns a String[], when in fact it returns an Enumeration.
  2. On page 37 (Section 3.8.1.1), the specification says, "Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, and IS." The keyword ESCAPE also cannot be used as an identifier in a message selector and should be added to this list.
  3. On pages 40 and 99 (Sections 3.8.1.1 and 9.1.8), the syntax for a message selector is shown with different opening and closing quotation marks, both for single and double quotes. The single quotes look like this:
    selector = new String(“(name = `SUNW') or (name = `IBM')");
    
    The quotation marks should look the same; you use an apostrophe (') to enter both opening and closing quotes.
  4. On page 54 (Section 4.4.3), the specification refers to TemporaryDestinations. However, "TemporaryDestination" is a generic term for a TemporaryQueue or TemporaryTopic, not an actual class or interface.
  5. On pages 61 and 62 (Sections 4.5 and 4.6), the spec refers to the createMessageConsumer and createMessageProducer methods. However, "createMessageConsumer" and "createMessageProducer" are generic terms for QueueSession.createReceiver, TopicSession.createSubscriber, QueueSession.createSender, and TopicSession.createPublisher; they are not actual methods in javax.jms.Session.
  6. On page 76 (Section 7.2), the specification says, "JMS defines JMSException as the root interface for exceptions thrown by JMS methods."

    JMSException is a class, not an interface.

  7. Page 89 of the specification (Section 9.1.2.1) gives an example of using JNDI to obtain an InitialContext object. It should also mention that the user needs to import javax.naming.* in order to do this.
  8. On pages 92 and 97 (Sections 9.1.3.5 and 9.1.6.2), the signature of the onMessage method is shown as

    void onMessage(Message message)

    However, if you use this signature, you get a compiler error:

    NewsListener.java:7: The method void onMessage(javax.jms.Message) declared in class NewsListener cannot override the method of the same signature declared in interface javax.jms.MessageListener.  The access modifier is made more restrictive.
        void onMessage(Message message) {

    You have to declare the method public, as the Javadoc for the MessageListener interface says.

  9. On page 92 (Section 9.1.3.5), the code needed for registering a message listener is shown as follows:

    StockListener myListener;
    subscriber.setMessageListener(myListener);

    In fact, this won't work as shown. You have to initialize the listener:

    StockListener myListener = new StockListener();