简体   繁体   中英

{org.wso2.andes.client.AMQConnection} - Unable to connect to broker at After migrating to WSO2 API Manager 2.1.0

I migrated to API Manager 2.1.0 with Identity server as key manager 5.3.0. I followed the document https://docs.wso2.com/display/AM210/Upgrading+from+the+Previous+Release+when+WSO2+IS+is+the+Key+Manager I have custom domain name mapped to all url.

I have the below error in WSO2 API manager logs when i try to hit an API. How to debug this?which file should be the culprit? In earlier version , i faced this issue when i missed to update jndi.properties.But that is done properly here as below.

    # connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientid/carbon?brokerlist='tcp://mydevwso2.ca:5672'

connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/test?brokerlist='tcp://mydevwso2.ca:5672'

What could cause the below error?

 Caused by: org.wso2.andes.AMQConnectionFailureException: Could not open connection
    at org.wso2.andes.client.AMQConnection.<init>(AMQConnection.java:486)
    at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:351)
    ... 13 more
Caused by: org.wso2.andes.transport.TransportException: Could not open connection
    at org.wso2.andes.transport.network.mina.MinaNetworkTransport$IoConnectorCreator.connect(MinaNetworkTransport.java:216)
    at org.wso2.andes.transport.network.mina.MinaNetworkTransport.connect(MinaNetworkTransport.java:74)
    at org.wso2.andes.client.AMQConnectionDelegate_8_0.makeBrokerConnection(AMQConnectionDelegate_8_0.java:130)
    at org.wso2.andes.client.AMQConnection$2.run(AMQConnection.java:631)
    at org.wso2.andes.client.AMQConnection$2.run(AMQConnection.java:628)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.wso2.andes.client.AMQConnection.makeBrokerConnection(AMQConnection.java:628)
    at org.wso2.andes.client.AMQConnection.<init>(AMQConnection.java:409)
    ... 14 more
TID: [-1] [] [2017-11-14 14:12:08,925] ERROR {org.wso2.carbon.event.output.adapter.jms.internal.util.JMSMessageSender} -   {org.wso2.carbon.event.output.adapter.jms.internal.util.JMSMessageSender}
java.lang.NullPointerException
    at org.wso2.carbon.event.output.adapter.jms.internal.util.JMSMessageSender.send(JMSMessageSender.java:88)
    at org.wso2.carbon.event.output.adapter.jms.JMSEventAdapter$JMSSender.run(JMSEventAdapter.java:284)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
TID: [-1] [] [2017-11-14 14:12:22,207]  INFO {org.wso2.andes.client.AMQConnection} -  Unable to connect to broker at tcp://mydevwso2.ca:5672 {org.wso2.andes.client.AMQConnection}
org.wso2.andes.transport.TransportException: Could not open connection
    at org.wso2.andes.transport.network.mina.MinaNetworkTransport$IoConnectorCreator.connect(MinaNetworkTransport.java:216)
    at org.wso2.andes.transport.network.mina.MinaNetworkTransport.connect(MinaNetworkTransport.java:74)
    at org.wso2.andes.client.AMQConnectionDelegate_8_0.makeBrokerConnection(AMQConnectionDelegate_8_0.java:130)
    at org.wso2.andes.client.AMQConnection$2.run(AMQConnection.java:631)
    at org.wso2.andes.client.AMQConnection$2.run(AMQConnection.java:628)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.wso2.andes.client.AMQConnection.makeBrokerConnection(AMQConnection.java:628)
    at org.wso2.andes.client.AMQConnection.<init>(AMQConnection.java:409)

Check whether the super admin user credentials are correct in the jndi.properties file and also in the api-manager.xml file. In the api-manager.xml file, the relevant configuration can be seen similar to the below example (credentials can be different).

<JMSConnectionParameters>
    <transport.jms.ConnectionFactoryJNDIName>TopicConnectionFactory</transport.jms.ConnectionFactoryJNDIName>
    <transport.jms.DestinationType>topic</transport.jms.DestinationType>
    <java.naming.factory.initial>org.wso2.andes.jndi.PropertiesFileInitialContextFactory</java.naming.factory.initial>
    <connectionfactory.TopicConnectionFactory>amqp://admin:admin2@clientid/carbon?brokerlist='${jms.url}'</connectionfactory.TopicConnectionFactory>
</JMSConnectionParameters>

I could observe the same issue as you, resulting in:

org.wso2.andes.AMQConnectionFailureException: Could not open connection ..)

I was able to resolve by changing the above configurations to the correct super admin user credentials. The correct admin user credentials can be found from the <APIM_Home>/repository/conf/usr-mgt.xml file. An example configuration is as follows:

 <AdminUser>
     <UserName>admin</UserName>
     <Password>admin2</Password>
 </AdminUser>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM