Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-1965 StreamMessage.writeObject() ignores Long data type
  3. AMQ-1964

StreamMessage.writeObject() doesn't behave according to the JMS 1.1 specification

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 5.2.0
    • Component/s: Broker
    • Labels:
      None

      Description

      The subj method has restrictions on the types of objects it can accept, but those restrictions aren't implemented. Testcase below.

      // get a live session
              ConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false&broker.useJmx=false");
              Session session = cf.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
      
              StreamMessage sm = session.createStreamMessage();
      
              // only primitives (with wrappers), String and byte[] are allowed:
              // http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/StreamMessage.html#writeObject(java.lang.Object)
      
              try
              {
                  sm.writeObject(new Object());
                  fail("Should've failed with MessageFormatException");
              }
              catch (MessageFormatException e)
              {
                  // JMS 1.1 spec, Section 7.3 Standard Exceptions, page 89, 1st paragraph
                  // expected
              }
      

        Attachments

          Activity

            People

            • Assignee:
              rajdavies Robert Davies
              Reporter:
              aperepel Andrew Grande

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment