0
votes

I am trying to populate a JMS message store from the WSO2 ESB.

I set up the following configuration for the message store...

<messageStore name="JMSMS" class="org.apache.synapse.message.store.impl.jms.JmsStore" 
xmlns="http://ws.apache.org/ns/synapse">
    <parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory
    </parameter>
    <parameter name="java.naming.provider.url">repository/conf/jndi.properties</parameter>
    <parameter name="store.jms.destination">JMSMS</parameter>
    <parameter name="store.jms.username">admin</parameter>
    <parameter name="store.jms.password">admin</parameter>
    <parameter name="store.jms.JMSSpecVersion">1.1</parameter>

When I start the ESB I get the following error :-

[2014-07-29 16:43:45,633] ERROR - JmsStore Store [JMSMS]. Could not create a new connection to the broker. Initial Context Factory:[org.apache.qpid.jn di.PropertiesFileInitialContextFactory]; Provider URL:[repository/conf/jndi.properties]; Connection Factory:[null].

I have used the above java.naming.factory.initial to successfully connect to a standard Message Broker queue as an endpoint without going through the Message store.

I have also tried changing the value of java.naming.factory.initial to org.apache.qpid.jndi.PropertiesFileInitialContextFactory but get the same error.

Does anyone have an idea of what config or files I am missing?

Cheers Macca

Update

Below is the jndi.properties and axis2.xml config I am using

JNDI.Properties

connectionfactory.ConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://inf02-3:5673'

queue.JMSMS=JMSMS

axis2.xml

<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"> 
    <parameter name="default" locked="false"> 
        <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter> 
        <parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter> 
        <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter> 
    </parameter> 
</transportSender>
2
There are a few configuration files you need to update. Looks like you want to use the WSO2 Message Broker. Have you set that up correctly. (docs.wso2.com/display/ESB480/Configure+with+WSO2+Message+Broker) Good article to follow. Also it would be good to see the contents of the jndi.properties fileC.Johnson
Yes. I used that so I could connect to the queue I mentioned in the article. That worked. It seems to be an issue around the java.naming.factory.initial parameter.macca18
Added jndi.properties file I am usingmacca18

2 Answers

2
votes

Reason for the error that you are getting "Connection Factory:[null]" is miss configuration in the ESB_HOME/repository/conf/jndi.properties.

Please recheck it and you can find a really good article on wso2 library - configuring wso2 esb with wso2 message broker

1
votes

I have another explanation for this problem. I came across the situation where I deployed my working stuff on a freshly set-up UAT machine. Immediately when the test started I started receiving the "Connection Factory:[null]" problem. I investigated hours on all configurations and at the end it turned out that I forgot to copy two *jar files into [ESB_HOME]\repository\components\lib

I hope that it helps.