WSO2 unit testing Mock Service is not working - wso2

I`m using the 2SO2 integration studio version is 8.0.0.
I tried to write junit suite test for my app using mock-service for my endpoint.
But when I tried to run the test I got the next failed :
My mock-service is set up with port = 9090 ( i do not know it`s right or not, this port i found in documentation by wso2 : https://ei.docs.wso2.com/en/7.2.0/micro-integrator/develop/creating-unit-test-suite/):
Test is :
<unit-test>
<artifacts>
<test-artifact>
<artifact>/LmaAPIConfigs/src/main/synapse-config/api/LmaAPI.xml</artifact>
</test-artifact>
<supportive-artifacts/>
<registry-resources/>
<connector-resources/>
</artifacts>
<test-cases>
<test-case name="TestMock">
<input>
<request-path>/currency</request-path>
<request-method>POST</request-method>
<request-protocol>http</request-protocol>
<payload><![CDATA[{"currency": "USD"}]]></payload>
<properties>
<property name="Content-Type" scope="transport" value="application/json"/>
</properties>
</input>
<assertions>
<assertEquals>
<actual>$body</actual>
<expected><![CDATA[<jsonObject><r030>840</r030><txt>Долар США</txt><rate>36.5686</rate><cc>USD</cc><exchangedate>]]></expected>
<message>not equals</message>
</assertEquals>
<assertNotNull>
<actual>$body</actual>
<message>body is null</message>
</assertNotNull>
</assertions>
</test-case>
</test-cases>
<mock-services>
<mock-service>/LmaAPI/LmaAPIConfigs/test/resources/mock-services/Exchange.xml</mock-service>
</mock-services>
</unit-test>
The logs from wso2carbon.log file :
[2022-09-19 08:49:43,467] INFO {org.apache.synapse.unittest.UnitTestingExecutor} - Start processing test-case handler
[2022-09-19 08:49:43,467] INFO {org.apache.synapse.unittest.UnitTestingExecutor} - Unit testing agent checks transport Pass-through HTTP Listener port
[2022-09-19 08:49:43,487] INFO {org.apache.synapse.transport.passthru.core.PassThroughListeningIOReactorManager} - Pass-through EI_INTERNAL_HTTPS_INBOUND_ENDPOINT Listener started on 0:0:0:0:0:0:0:0:9164
[2022-09-19 08:49:43,495] INFO {org.apache.synapse.unittest.SynapseTestcaseDataReader} - Artifact data from descriptor data read successfully
[2022-09-19 08:49:43,495] INFO {org.apache.synapse.unittest.SynapseTestcaseDataReader} - Test case data from descriptor data read successfully
[2022-09-19 08:49:43,497] INFO {org.apache.synapse.unittest.SynapseTestcaseDataReader} - Mock service data from descriptor data read successfully
[2022-09-19 08:49:43,498] INFO {org.apache.synapse.unittest.ConfigModifier} - Mock service creator ready to start service for Exchange
[2022-09-19 08:49:43,530] INFO {org.apache.synapse.unittest.MockServiceCreator} - Mock service started for Exchange in - http://localhost:9090/get-nbu-exchange
[2022-09-19 08:49:43,530] INFO {org.apache.synapse.unittest.ConfigModifier} - Thread waiting for mock service(s) starting
[2022-09-19 08:49:43,609] ERROR {org.apache.synapse.unittest.UnitTestingExecutor} - Failed to get input stream from TCP connection java.io.EOFException
at java.base/java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2842)
at java.base/java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3337)
at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:925)
at java.base/java.io.ObjectInputStream.<init>(ObjectInputStream.java:368)
at org.apache.synapse.unittest.RequestHandler.readData(RequestHandler.java:112)
at org.apache.synapse.unittest.RequestHandler.run(RequestHandler.java:74)
at java.base/java.lang.Thread.run(Thread.java:834)
[2022-09-19 08:49:43,609] ERROR {org.apache.synapse.unittest.UnitTestingExecutor} - Error while reading data from received message java.lang.NullPointerException
at org.apache.synapse.unittest.SynapseTestcaseDataReader.readAndStoreArtifactData(SynapseTestcaseDataReader.java:148)
at org.apache.synapse.unittest.RequestHandler.preProcessingData(RequestHandler.java:137)
at org.apache.synapse.unittest.RequestHandler.run(RequestHandler.java:80)
at java.base/java.lang.Thread.run(Thread.java:834)
[2022-09-19 08:49:43,609] ERROR {org.apache.synapse.unittest.UnitTestingExecutor} - Reading Synapse testcase data failed
[2022-09-19 08:49:43,609] ERROR {org.apache.synapse.unittest.UnitTestingExecutor} - Error while running client request in test agent java.net.SocketException: Software caused connection abort: socket write error
at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1883)
at java.base/java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1792)
at java.base/java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1287)
at java.base/java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1232)
at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1428)
at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1179)
at java.base/java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1583)
at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:352)
at org.apache.synapse.unittest.RequestHandler.writeData(RequestHandler.java:238)
at org.apache.synapse.unittest.RequestHandler.run(RequestHandler.java:92)
at java.base/java.lang.Thread.run(Thread.java:834)
[2022-09-19 08:49:43,830] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58] REGISTERED
[2022-09-19 08:49:43,830] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58] BIND: localhost/127.0.0.1:9090
[2022-09-19 08:49:43,830] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58, L:/127.0.0.1:9090] ACTIVE
[2022-09-19 08:49:44,040] INFO {org.apache.synapse.unittest.ConfigModifier} - Mock service(s) are started with given ports
[2022-09-19 08:49:44,042] INFO {org.apache.synapse.unittest.UnitTestingExecutor} - Main test artifact deployment started
[2022-09-19 08:49:44,042] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58, L:/127.0.0.1:9090] READ: [id: 0x7fabaabd, L:/127.0.0.1:9090 - R:/127.0.0.1:61051]
[2022-09-19 08:49:44,042] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58, L:/127.0.0.1:9090] READ COMPLETE
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.api.API} - {api:LmaAPI} Initializing API: LmaAPI
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.core.axis2.Axis2SynapseEnvironment} - Continuation call is set to true
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.deployers.APIDeployer} - API named 'LmaAPI' has been deployed from file : LmaAPI
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.unittest.TestingAgent} - Primary test API artifact deployed successfully
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.unittest.UnitTestingExecutor} - Synapse testing agent ready to mediate test cases through deployments
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.unittest.TestingAgent} - 1 Test case(s) ready to execute
[2022-09-19 08:49:44,326] INFO {org.apache.synapse.unittest.UnitTestingExecutor} - Invoking URI - http://localhost:8290/lma/currency
[2022-09-19 08:49:44,467] INFO {org.apache.synapse.mediators.builtin.LogMediator} - {api:LmaAPI} uri.var.currency = USD
[2022-09-19 08:49:44,472] INFO {org.apache.synapse.mediators.builtin.LogMediator} - {api:LmaAPI} To: /lma/currency, MessageID: urn:uuid:898e7062-97b1-4179-a6d0-a3a63106455f, correlation_id: 898e7062-97b1-4179-a6d0-a3a63106455f, Direction: request, LmaAPI_currency = ERROR RESPONSE, Payload: {"currency": "USD"}
[2022-09-19 08:49:44,498] INFO {org.apache.synapse.unittest.Assertor} - Assert Equals - assert property for services started
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.unittest.Assertor} - Service Assert Expression - $body
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.unittest.Assertor} - Service mediated result for Actual - <jsonObject><currency>USD</currency></jsonObject>
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.unittest.Assertor} - Service Assert Expected - <jsonObject><r030>840</r030><txt>ДоларСША</txt><rate>36.5686</rate><cc>USD</cc></jsonObject>
[2022-09-19 08:49:44,514] ERROR {org.apache.synapse.unittest.Assertor} - Service assertEquals for $body expression failed with a message - not equals
[2022-09-19 08:49:44,514] ERROR {org.apache.synapse.unittest.Assertor} - Unit testing failed for the test case - TestMock
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.deployers.APIDeployer} - API named 'LmaAPI' has been undeployed
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.api.API} - {api:LmaAPI} Destroying API: LmaAPI
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.core.axis2.Axis2SynapseEnvironment} - Continuation call is set to false
[2022-09-19 08:49:44,514] INFO {org.apache.synapse.unittest.TestingAgent} - Undeployed all the deployed test and supportive artifacts
[2022-09-19 08:49:44,514] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58, L:/127.0.0.1:9090] INACTIVE
[2022-09-19 08:49:44,514] INFO {io.netty.handler.logging.LoggingHandler} - [id: 0x00a2ce58, L:/127.0.0.1:9090] UNREGISTERED
[2022-09-19 08:49:44,521] INFO {org.apache.synapse.commons.emulator.core.Emulator} - Emulator shutdown successfully.......
[2022-09-19 08:49:44,521] INFO {org.apache.synapse.unittest.UnitTestingExecutor} - End processing test-case handler
My synapse artefacts :
My API :
My EP :

Mock Service port is simply a port you want your Mock service to start on, this can be any arbitrary port that is not occupied by any other service. So in your case, if any other service is not using the port 9090 you can use this. As you can see here in the code, a new Emulator will be started with this port and the context you are providing to facilitate mocking.
When you create a Mock service, you will be mocking an Endpoint. So I assume you already have an Endpoint Defined, and trying to mock this. If that's the case you need to add that Endpoint to the <supportive-artifacts/> section, in your Test Suite. Something like the below.
<supportive-artifacts>
<artifact>PATH_TO_ENDPOINT</artifact>
</supportive-artifacts>
I'm not exactly sure why you are getting a Received status code - 202 as the response. But it typically means your integration is unable to run.(Probably due to the missing endpoint). Also, it's important to note that all the detailed logs will be logged on the server side. So you won't be able to figure out what's happening by just looking at the Maven log. For example, as you can see here the server should log a message when your mock service is started. So make sure you check the server-side logs to identify any issues. If you are just executing from Integration Studio, the logs are located at <INTEGRATION_STUDIO_HOME>/runtime/microesb/repository/logs/wso2carbon.log

Integration Studio 8.0.0 was having some bugs related to the unit testing and mock services. AFAIK the issue you observed (Receiving a 202 status code) and the one #ycr have mentioned (Missing endpoint config in the <supportive-artifacts/> [1]) have been fixed in the latest Integration Studio 8.1.0.
Can you try this in the latest updated Integration Studio 8.1.0 pack? You can download the latest version from the official website. Please refer Get the latest updates to install the latest updates to Integration Studio.

Related

what is the reason for wso2 api manger 3.2.0 'JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started' error?

When I start WSO2 API Manager (3.2.0), I face this error. What is the solution?
[2022-12-05 16:00:02,145] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2022-12-05 16:00:02,144] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2022-12-05 16:00:02,143] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2022-12-05 16:00:02,150] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2022-12-05 16:00:02,149] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2022-12-05 16:00:02,158] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds
[2022-12-05 16:00:02,159] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds
[2022-12-05 16:00:02,174] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds
[2022-12-05 16:00:02,175] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds
[2022-12-05 16:00:02,163] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds

[Wso2][Stream Processor][Dashbord] Running dashbord and worker in same machine

I try to run Worker and dashbord in same machine.
the first tools is running coorectly, but when i start the second the error has been raised :
[2018-03-07 09:59:43,546] INFO
{org.wso2.msf4j.internal.websocket.EndpointsRegistryImpl} - Endpoint
Registered : /server-stats/{type}
[2018-03-07 09:59:43,636] INFO {org.wso2.carbon.data.provider.DataProviderAPI} - Data Provider
Service Component is activated
[2018-03-07 09:59:44,909] INFO {org.wso2.msf4j.internal.websocket.WebSocketServerSC} - All required
capabilities are available of WebSocket service component is
available.
[2018-03-07 09:59:45,049] INFO {org.wso2.msf4j.internal.MicroservicesServerSC} - All microservices
are available
[2018-03-07 09:59:45,346] INFO {org.wso2.transport.http.netty.listener.ServerConnectorBootstrap$HTTPServerConnector}
- HTTP(S) Interface starting on host 0.0.0.0 and port 9643
[2018-03-07 09:59:45,939] INFO {org.wso2.carbon.metrics.core.config.model.JmxReporterConfig} -
Creating JMX reporter for Metrics with domain
'org.wso2.carbon.metrics'
[2018-03-07 09:59:45,954] INFO {org.wso2.carbon.metrics.core.reporter.impl.AbstractReporter} -
Started JMX reporter for Metrics
[2018-03-07 09:59:45,954] INFO {org.wso2.msf4j.analytics.metrics.MetricsComponent} - Metrics
Component is activated
[2018-03-07 09:59:45,970] INFO {org.wso2.carbon.databridge.agent.internal.DataAgentDS} - Successfully
deployed Agent Server
[2018-03-07 09:59:52,914] ERROR {org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager}
- Runtime Exception occurred while calling onAllRequiredCapabilitiesAvailable of component
carbon-datasource-service
com.zaxxer.hikari.pool.PoolInitializationException: Exception during
pool initialization: Connection is broken:
"java.net.SocketTimeoutException: connect timed out:
169.254.235.125:59336" [90067-196]
at com.zaxxer.hikari.pool.HikariPool.initializeConnections(HikariPool.java:581)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:152)
at com.zaxxer.hikari.HikariDataSource.(HikariDataSource.java:73)
at org.wso2.carbon.datasource.rdbms.hikari.HikariRDBMSDataSource.getDataSource(HikariRDBMSDataSource.java:56)
at org.wso2.carbon.datasource.rdbms.hikari.HikariDataSourceReader.createDataSource(HikariDataSourceReader.java:74)
at org.wso2.carbon.datasource.core.DataSourceBuilder.buildDataSourceObject(DataSourceBuilder.java:79)
at org.wso2.carbon.datasource.core.DataSourceBuilder.buildDataSourceObject(DataSourceBuilder.java:60)
at org.wso2.carbon.datasource.core.DataSourceBuilder.buildCarbonDataSource(DataSourceBuilder.java:44)
at org.wso2.carbon.datasource.core.DataSourceManager.initDataSources(DataSourceManager.java:153)
at org.wso2.carbon.datasource.core.internal.DataSourceListenerComponent.onAllRequiredCapabilitiesAvailable(DataSourceListenerComponent.java:125)
at org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager.lambda$notifySatisfiableComponents$7(StartupComponentManager.java:266)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager.notifySatisfiableComponents(StartupComponentManager.java:252)
at org.wso2.carbon.kernel.internal.startupresolver.StartupOrderResolver$1.run(StartupOrderResolver.java:204)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.SocketTimeoutException: connect timed out:
169.254.235.125:59336" [90067-196]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:457)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:367)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:116)
at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:100)
at org.h2.Driver.connect(Driver.java:69)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101)
at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:496)
at com.zaxxer.hikari.pool.HikariPool.initializeConnections(HikariPool.java:565)
... 15 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.h2.util.NetUtils.createSocket(NetUtils.java:103)
at org.h2.util.NetUtils.createSocket(NetUtils.java:83)
at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:115)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:453)
... 23 more
can you please advise?
Thanks.
Can you share the WSO2 SP version you were using when you got this exception?
Also please check whether the AUTO_SERVER=TRUE
config is avaiable in the jdbc url of WSO2_METRICS_DB datasource configuration, which can be found in
{WSO2_SP_HOME}/conf/worker/deployment.yaml
eg :
jdbcUrl: 'jdbc:h2:${sys:carbon.home}/wso2/dashboard/database/metrics;AUTO_SERVER=TRUE'
I configured all datasource in mysql, and i can running all SP componnent.
the issue is related to H2 datasase, that not allowed to share connection with default configuration.
i will check default H2 connection parametrs, and test again.

Change default port 5672 for WSO2-API Manager

We already have Active MQ running on the server. As a result we are getting port conflict when running WSO2. Where can we change the port to avoid this conflict.
So far we have done the following:
1. Searched for references for port 5672 under /repository/conf and changed 5672 to 5673. Files changed included broker and jndi.
Looks like the conflict is resolved but some services are still trying to connect to port 5672. I have not been able to find where to change this.
[2017-02-03 08:37:36,342] INFO - QpidServiceComponent WSO2 Message Broker is started.
[2017-02-03 08:37:36,374] INFO - JMSConnectionFactory JMS ConnectionFactory : Siddhi-JMS-Consumer initialized
[2017-02-03 08:37:36,379] INFO - JMSTransportHandler Starting jms topic consumer thread...
[2017-02-03 08:37:36,800] INFO - PassThroughHttpListener Starting Pass-through HTTP Listener...
[2017-02-03 08:37:36,811] INFO - PassThroughListeningIOReactorManager Pass-through HTTP Listener started on 0:0:0:0:0:0:0:0:8280
[2017-02-03 08:37:36,815] INFO - PassThroughHttpSSLListener Starting Pass-through HTTPS Listener...
[2017-02-03 08:37:36,825] INFO - PassThroughListeningIOReactorManager Pass-through HTTPS Listener started on 0:0:0:0:0:0:0:0:8243
[2017-02-03 08:37:37,669] INFO - AMQConnection Unable to connect to broker at tcp://172.17.51.124:5672
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)
at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:351)
at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:40)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSUtils.createConnection(JMSUtils.java:387)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSListener.checkJMSConnection(JMSListener.java:137)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSListener.start(JMSListener.java:79)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSListener.run(JMSListener.java:186)
at java.lang.Thread.run(Thread.java:745)
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)
at org.wso2.andes.client.AMQConnectionFactory.createConnection(AMQConnectionFactory.java:40)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSUtils.createConnection(JMSUtils.java:387)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSListener.checkJMSConnection(JMSListener.java:137)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSListener.start(JMSListener.java:79)
at org.wso2.carbon.apimgt.jms.listener.utils.JMSListener.run(JMSListener.java:186)
at java.lang.Thread.run(Thread.java:745)
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)
... 7 more
[2017-02-03 08:37:37,750] ERROR - JMSListener Unable to continue server startup as it seems the JMS Provider is not yet started. Please start the JMS provider now.
[2017-02-03 08:37:37,756] ERROR - JMSListener Connection attempt : 1 for JMS Provider failed. Next retry in 20 seconds
[2017-02-03 08:37:39,373] INFO - CarbonEventManagementService Starting polling event receivers
[2017-02-03 08:37:43,411] INFO - ThriftDataReceiver Thrift Server started at 0.0.0.0
[2017-02-03 08:37:43,451] INFO - ThriftDataReceiver Thrift SSL port : 7711
[2017-02-03 08:37:43,468] INFO - ThriftDataReceiver Thrift port : 7611
We resolved this by using port offsets. No need to manually change ports.
https://docs.wso2.com/display/AM200/Changing+the+Default+Ports+with+Offset

Spark application with Jetty embedded server is not logging bubbled exceptions

It's a really basic setup, I am using slf4j-simple
I have the following route:
get("/fail", (req, res) -> {
throw new RuntimeException("fail");
}
);
As expected, it throws 500 internal error.
However, the logs show nothing about this. How can I get these bubbled exceptions to log?
These are the only logs I see:
[Thread-0] INFO org.eclipse.jetty.util.log - Logging initialized #164ms
[Thread-0] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - == Spark has ignited ...
[Thread-0] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - >> Listening on 0.0.0.0:4567
[Thread-0] INFO org.eclipse.jetty.server.Server - jetty-9.3.z-SNAPSHOT
[Thread-0] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector#35eae602{HTTP/1.1,[http/1.1]}{0.0.0.0:4567}
[Thread-0] INFO org.eclipse.jetty.server.Server - Started #259ms
You may implement your log operation inside the Exception Mapper.

WSO2 - IBM MQ - javax.naming.NamingException: Unable to communicate with the queue manager while looking up object

Facing the following issue while trying to connect WSO2 ESB proxy services to queues (newly created) configured in IBM MQ.
The strange part is, able to connect to queues which were already existing in the same Queue Manager, successfully.
TID: [0] [ESB] [2016-01-14 12:05:12,705] INFO {org.apache.axis2.transport.jms.JMSListener} - Connection attempt: 1 for JMS Provider for service: UOFSInterface was successful! {org.apache.axis2.transport.jms.JMSListener}
TID: [0] [ESB] [2016-01-14 12:05:12,712] INFO {org.apache.axis2.transport.jms.ServiceTaskManager} - Task manager for service : UOFSPickedInterface [re-]initialized {org.apache.axis2.transport.jms.ServiceTaskManager}
TID: [0] [ESB] [2016-01-14 12:05:12,829] WARN {org.apache.axis2.transport.jms.JMSUtils} - Cannot locate destination : UOFS.ESB.IN {org.apache.axis2.transport.jms.JMSUtils}
javax.naming.NamingException: Unable to communicate with the queue manager while looking up object UOFS.ESB.IN
at com.ibm.mq.jms.context.MQContext.lookup(MQContext.java:947)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:583)
at org.apache.axis2.transport.jms.JMSUtils.lookupDestination(JMSUtils.java:789)
at org.apache.axis2.transport.jms.ServiceTaskManager.getDestination(ServiceTaskManager.java:950)
at org.apache.axis2.transport.jms.ServiceTaskManager.access$2700(ServiceTaskManager.java:50)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.createConsumer(ServiceTaskManager.java:905)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.getMessageConsumer(ServiceTaskManager.java:766)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.receiveMessage(ServiceTaskManager.java:516)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:428)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
TID: [0] [ESB] [2016-01-14 12:05:12,833] ERROR {org.apache.axis2.transport.jms.ServiceTaskManager} - Error creating JMS consumer for service : UOFSInterface. JMSWMQ2008: Failed to open MQ queue 'UOFS.ESB.IN'. {org.apache.axis2.transport.jms.ServiceTaskManager}
The MQ client user profile used by the client system (WSO2) didn´t have the appropriate "authorities" like PUT, SET etc., to drop messages into the queue.
The issue was resolved once the profile was given appropriate authorities to PUT, SET & BROWSE on the MQ queue object.