title: AXIS2: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
body: <p>I installed a fresh WSO2 ESB version 4.2.3 (last stable up to now) and I configured the JMS transport in the <code>axis2.xml</code> file as following:</p>
  
  <pre><code>&lt;!-- Configuration for JBoss 4.2.2 GA MQ --&gt;
  &lt;transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener"&gt;
      &lt;parameter name="SMSOUTQueueConnectionFactory" locked="false"&gt;
              &lt;parameter name="java.naming.factory.initial" locked="false"&gt;org.jnp.interfaces.NamingContextFactory&lt;/parameter&gt;
              &lt;parameter name="java.naming.factory.url.pkgs" locked="false"&gt;org.jboss.naming:org.jnp.interfaces&lt;/parameter&gt;
              &lt;parameter name="java.naming.provider.url" locked="false"&gt;jnp://192.168.10.125:1100&lt;/parameter&gt;
              &lt;parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false"&gt;ConnectionFactory&lt;/parameter&gt;
              &lt;parameter name="transport.jms.ConnectionFactoryType" locked="false"&gt;queue&lt;/parameter&gt;
              &lt;parameter name="transport.jms.Destination" locked="true"&gt;queue/SMSOUTQueue&lt;/parameter&gt;
      &lt;/parameter&gt;
  &lt;/transportReceiver&gt;
  </code></pre>
  
  <p>Immediately after, during the startup an error has been found:</p>
  
  <pre><code>15:09:16,585 INFO  [STDOUT] 15:09:16,585 ERROR [BaseUtils] JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
  15:09:16,587 INFO  [STDOUT] 15:09:16,585 ERROR [ListenerManager] Couldn't initialize the jmstransport listener
  org.apache.axis2.transport.base.BaseTransportException: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected
          at org.apache.axis2.transport.base.BaseUtils.handleException(BaseUtils.java:167)
          at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:522)
          at org.apache.axis2.transport.jms.JMSConnectionFactory.&lt;init&gt;(JMSConnectionFactory.java:92)
          at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:58)
          at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.&lt;init&gt;(JMSConnectionFactoryManager.java:45)
          at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:58)
          at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)
          at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)
          at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:386)
          at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:273)
          at org.wso2.carbon.core.init.PreAxis2ConfigItemListener.bundleChanged(PreAxis2ConfigItemListener.java:117)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:916)
          at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
          at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
  </code></pre>
  
  <p>I found a lot of posts where people say to remove the <code>...WEB-INF/lib/geronimo-jms_1.1_spec-1.1.0.wso2v1.jar</code>, because otherwise synapse doesn't work with any external JMS broker (I found same answer also for Mule ESB), but for me this solution doesn't work.</p>
  
  <p>The problem is very similar <a href="http://rajikak.blogspot.it/2011/04/jms-error-jndi-lookup-of-name.html" rel="nofollow">to this link</a>.</p>
  
  <p>Any help is very appreciated. Thanks a lot in advance.</p>