0
votes

I am trying to connect a WSO2 CEP server to a WSO2 Message Broker server.

I have created a jndi.properties file:

connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://192.168.11.2:5673'
topic.testTopic = testTopic

an input event adaptor:

<?xml version="1.0" encoding="UTF-8"?>
<inputEventAdaptor name="MBJMSInputAdaptor" statistics="enable"
  trace="enable" type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
  <property name="java.naming.provider.url">repository/conf/jndi.properties</property>
  <property name="transport.jms.SubscriptionDurable">false</property>
  <property name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</property>
  <property name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</property>
  <property name="transport.jms.DestinationType">topic</property>
</inputEventAdaptor>

a stream definition:

<streamDefinitions xmlns="http://wso2.org/carbon/databridge">
  <streamDefinition>
    {
      "name":"testStream",
      "version":"1.0.0",
      "payloadData":[
        {"name":"id","type":"INT"},
        {"name":"name","type":"STRING"}
      ]
    }
  </streamDefinition>
</streamDefinitions>

and an event builder:

<?xml version="1.0" encoding="UTF-8"?>
<eventBuilder name="testBuilder" statistics="enable" trace="enable" xmlns="http://wso2.org/carbon/eventbuilder">
  <from eventAdaptorName="MBJMSInputAdaptor" eventAdaptorType="jms">
    <property name="topic">testTopic</property>
  </from>
  <mapping customMapping="enable" type="json">
    <property>
      <from jsonPath="id"/>
      <to name="id" type="int"/>
    </property>
    <property>
      <from jsonPath="name"/>
      <to name="name" type="string"/>
    </property>
  </mapping>
  <to streamName="testStream" version="1.0.0"/>
</eventBuilder>

Unfortunately, the WSO2 CEP server does not receive messages from the WSO2 Message Broker server, and throws the following exception:

[2014-11-28 13:00:00,226] INFO - {JMSEventAdaptorType} JMS input event adaptor loading listeners
Exception in thread "Thread-29" java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
at org.wso2.carbon.event.input.adaptor.jms.JMSEventAdaptorType.createJMSAdaptorListener(JMSEventAdaptorType.java:291)
at org.wso2.carbon.event.input.adaptor.jms.JMSEventAdaptorType.tryStartAdaptor(JMSEventAdaptorType.java:262)
at org.wso2.carbon.event.input.adaptor.jms.internal.ds.JMSEventAdaptorServiceHolder.loadLateStartEventAdaptors(JMSEventAdaptorServiceHolder.java:66)
at org.wso2.carbon.event.input.adaptor.jms.internal.ds.JMSEventAdaptorServiceHolder$1.run(JMSEventAdaptorServiceHolder.java:43)
at java.lang.Thread.run(Thread.java:745)

Could you help me debugging this exception?

1

1 Answers