Microsoft Service Bus Connector Troubleshooting | MuleSoft Documentation
# Microsoft Service Bus Connector Troubleshooting
## Timeout Error
If the Mule app includes the **Listener** source, you might receive an error like this:
`javax.jms.JMSException: The operation did not complete within the allocated time 00:00:14.9951934 for object connection`
If you receive this error when starting the app or calling an operation, check whether the Service Bus server has the `Redirect` feature enabled. If so, disable this feature by following the steps documented in the Known Issues section on this page: AMQP Java clients (and all non .NET clients) cannot send or receive to/from Service Bus.
## Failed Connectivity Test
If a connectivity test fails during application startup and you see the following statement in the stack trace, configure a reconnection strategy for the connector:
```
org.mule.runtime.api.connection.ConnectionException: SSL certificate error
 org.mule.runtime.api.connection.ConnectionException: SSL certificate error
 Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 99.99.99.99 found
 Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 99.99.99.99 found
 Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 99.99.99.99 found
 	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
 	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
 	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
 	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310)
 	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1639)
 	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223)
 	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
 	at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
 	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
 	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
 	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
 	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
 	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
 	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
 	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1340)
 	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1315)
 	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264)
 	at com.mulesoft.connectors.microsoft.servicebus.extension.internal.connection.provider.WindowsConnectionProvider.doRequestToSTS(WindowsConnectionProvider.java:179)
 	at com.mulesoft.connectors.microsoft.servicebus.extension.internal.connection.provider.WindowsConnectionProvider.getSASToken(WindowsConnectionProvider.java:163)
 	at com.mulesoft.connectors.microsoft.servicebus.extension.internal.connection.provider.WindowsConnectionProvider.createRestFacade(WindowsConnectionProvider.java:200)
 	at com.mulesoft.connectors.microsoft.servicebus.extension.internal.connection.provider.WindowsConnectionProvider.connect(WindowsConnectionProvider.java:133)
 	at com.mulesoft.connectors.microsoft.servicebus.extension.internal.connection.provider.WindowsConnectionProvider.connect(WindowsConnectionProvider.java:67)
 	at org.mule.runtime.module.extension.internal.runtime.config.ClassLoaderConnectionProviderWrapper.connect(ClassLoaderConnectionProviderWrapper.java:60)
 	at org.mule.runtime.core.internal.connection.ConnectionUtils.connect(ConnectionUtils.java:49)
 	at org.mule.runtime.core.internal.connection.AbstractConnectionProviderWrapper.connect(AbstractConnectionProviderWrapper.java:64)
 	at org.mule.runtime.core.internal.connection.ErrorTypeHandlerConnectionProviderWrapper.connect(ErrorTypeHandlerConnectionProviderWrapper.java:64)
 	at org.mule.runtime.core.internal.connection.ConnectionUtils.connect(ConnectionUtils.java:49)
 	at org.mule.runtime.core.internal.connection.AbstractConnectionProviderWrapper.connect(AbstractConnectionProviderWrapper.java:64)
 	at org.mule.runtime.core.internal.connection.DefaultConnectionProviderWrapper.connect(DefaultConnectionProviderWrapper.java:52)
 	at org.mule.runtime.core.internal.connection.CachedConnectionManagementStrategy.createConnection(CachedConnectionManagementStrategy.java:95)
 	at org.mule.runtime.core.api.util.func.CheckedSupplier.get(CheckedSupplier.java:25)
 	at org.mule.runtime.api.util.LazyValue.get(LazyValue.java:77)
 	at org.mule.runtime.core.internal.connection.CachedConnectionManagementStrategy.getConnectionHandler(CachedConnectionManagementStrategy.java:63)
 	at org.mule.runtime.core.internal.connection.DefaultConnectionManager.getConnection(DefaultConnectionManager.java:241)
 	at org.mule.runtime.core.internal.connection.DefaultConnectionManager.lambda$testConnectivity$1(DefaultConnectionManager.java:160)
 	at org.mule.runtime.core.internal.connection.DefaultConnectionManager.doTestConnectivity(DefaultConnectionManager.java:176)
 	at org.mule.runtime.core.internal.connection.DefaultConnectionManager.testConnectivity(DefaultConnectionManager.java:152)
 	at org.mule.runtime.core.internal.connection.DelegateConnectionManagerAdapter$EagerConnectionManagerAdapter.testConnectivity(DelegateConnectionManagerAdapter.java:176)
 	at org.mule.runtime.core.internal.connection.DelegateConnectionManagerAdapter.testConnectivity(DelegateConnectionManagerAdapter.java:98)
 	at org.mule.runtime.module.extension.api.tooling.ExtensionConnectivityTestingStrategy.testConnectivity(ExtensionConnectivityTestingStrategy.java:82)
 	at org.mule.runtime.core.internal.connectivity.DefaultConnectivityTestingService.testConnection(DefaultConnectivityTestingService.java:88)
 	at org.mule.runtime.config.internal.LazyConnectivityTestingService.testConnection(LazyConnectivityTestingService.java:57)
 	at com.mulesoft.agent.services.tooling.MuleAgentConnectivityTestingService.testConnection(MuleAgentConnectivityTestingService.java:77)
 	at com.mulesoft.agent.external.handlers.tooling.ToolingRequestHandler.lambda$applicationTestConnection$19(ToolingRequestHandler.java:482)
 	at com.mulesoft.agent.util.ResponseHelper.response(ResponseHelper.java:88)
 	at com.mulesoft.agent.external.handlers.tooling.ToolingRequestHandler.applicationTestConnection(ToolingRequestHandler.java:481)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 	at java.lang.reflect.Method.invoke(Method.java:498)
 	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
 	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387)
 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331)
 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103)
 	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
 	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
 	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
 	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
 	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
 	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
 	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:876)
 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
 	at com.mulesoft.agent.rest.RequestLoggingFilter.doFilter(RequestLoggingFilter.java:95)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
 	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
 	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
 	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
 	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
 	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
 	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:876)
 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
 	at com.mulesoft.agent.rest.RequestLoggingFilter.doFilter(RequestLoggingFilter.java:95)
 	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
 	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
 	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
 	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1711)
 	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1347)
 	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1678)
 	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1249)
 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
 	at org.eclipse.jetty.server.Server.handle(Server.java:505)
 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
 	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132)
 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:781)
 	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:917)
 	at java.lang.Thread.run(Thread.java:748)
 Caused by: java.security.cert.CertificateException: No subject alternative names matching IP address 99.99.99.99 found
 	at sun.security.util.HostnameChecker.matchIP(HostnameChecker.java:168)
 	at sun.security.util.HostnameChecker.match(HostnameChecker.java:94)
 	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:462)
 	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:442)
 	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:209)
 	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
 	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621)
 	... 98 more----
```
You need to setup the TlsContext to setup a trust store with the flag insecure to "true" For the Windows Connection Provider:
```
<servicebus:config name="Microsoft_Service_Bus_Config" doc:name="Microsoft Service Bus Config">
		<servicebus:windows-connection namespace="$namespace" username="$username" password="$password" fqdn="$fqdn" >
			<tls:context >
				<tls:trust-store insecure="true" />
			</tls:context>
		</servicebus:windows-connection>
	</servicebus:config>
```

For the Username Connection Provider:
```
<servicebus:config name="Username" doc:name="Microsoft Service Bus Config" doc:id="1392344d-9e91-4c51-847c-cb14496a5d63" >
		<servicebus:username-password-connection >
			<tls:context >
				<tls:trust-store insecure="true" />
			</tls:context>
		</servicebus:username-password-connection>
	</servicebus:config>
```

For the Shared Access Signature provider Connection Provider:
```
<servicebus:config name="SampleSharedAccess" doc:name="Microsoft Service Bus Config" doc:id="dca6896c-bab7-4f00-b8a3-0ea4a6efa732" >
  <servicebus:shared-access-signature-connection >
    <tls:context >
      <tls:trust-store insecure="true" />
    </tls:context>
  </servicebus:shared-access-signature-connection>
</servicebus:config>
```

## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center
  *