title: ActiveMQ setup - Unable to send the message to Queue (error - java.io.IOException: Unknown data type: 47)
body: <p>I have installed ActiveMQ and could access the url at - <code>http://localhost:8161/admin/queues.jsp</code>. When I try to drop a message to a queue I am getting the below error.</p>
  <p>The sample code is given below:</p>
  <pre class="lang-java prettyprint-override"><code>public class MessageReceiver {
      public static void main(String[] args) throws JMSException {
            ApplicationContext context = new ClassPathXmlApplicationContext(&quot;spring-beans.xml&quot;);
            JmsTemplate jmsTemplate=(JmsTemplate) context.getBean(&quot;jmsTemplate&quot;);
            jmsTemplate.send(
                  new MessageCreator() {
                        public ObjectMessage  createMessage(Session session) throws JMSException {
                            ObjectMessage message = session.createObjectMessage();
                            message.setObject(&quot;My first Message&quot;);                      
                             return message;
  
                    }
      }  );
  
        System.out.println(&quot;MESSAGE SENT TO myMessageQueue&quot;);
        Message receivedMessage=jmsTemplate.receive(&quot;queue&quot;);
        ObjectMessage msg = (ObjectMessage)receivedMessage;
        System.out.println(&quot;Message Received :&quot;+msg.getObject().toString());
  
  }
  </code></pre>
  <p>Spring xml is:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id=&quot;connectionFactory&quot; class=&quot;org.apache.activemq.ActiveMQConnectionFactory&quot;&gt;
      &lt;property name=&quot;brokerURL&quot;&gt;
          &lt;value&gt;tcp://localhost:8161&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name=&quot;userName&quot;&gt;
          &lt;value&gt;admin&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name=&quot;password&quot;&gt;
          &lt;value&gt;admin&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id=&quot;destination&quot; class=&quot;org.apache.activemq.command.ActiveMQQueue&quot;&gt;
      &lt;constructor-arg value=&quot;queue&quot; /&gt;
  &lt;/bean&gt;
  &lt;bean id=&quot;jmsTemplate&quot; class=&quot;org.springframework.jms.core.JmsTemplate&quot;&gt;
      &lt;property name=&quot;connectionFactory&quot; ref=&quot;connectionFactory&quot; /&gt;
      &lt;property name=&quot;defaultDestination&quot; ref=&quot;destination&quot; /&gt;
  &lt;/bean&gt;
  </code></pre>
  <p>Error is:</p>
  <pre><code>log4j:WARN No appenders could be found for logger (org.springframework.core.env.StandardEnvironment).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  Exception in thread &quot;main&quot; org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Unknown data type: 47
      at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
      at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)
      at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534)
      at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:526)
      at com.example.example.MessageReceiver.main(MessageReceiver.java:15)
  Caused by: javax.jms.JMSException: Unknown data type: 47
      at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:72)
      at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1435)
      at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1522)
      at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:328)
      at org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:196)
      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:457)
      ... 3 more
  Caused by: java.io.IOException: Unknown data type: 47
      at org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:348)
      at org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
      at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:221)
      at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:213)
      at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
      at java.lang.Thread.run(Thread.java:662)
  </code></pre>