Troubleshooting WebSockets Connector - Mule 4

To troubleshoot Anypoint Connector for WebSockets (WebSockets Connector), become familiar with the information about enabling verbose logging and interpreting commonly thrown messages.

Enable Verbose Logging

To get a better understanding of why an application’s interaction with WebSockets Connector is failing, temporarily enable verbose logging for the connector.

Remember to always disable the enhanced verbosity after troubleshooting because it affects your Mule application performance.

To enable verbose logging in the configuration file:

  1. Access Anypoint Studio and navigate to the Package Explorer view.

  2. Open your application’s project name.

  3. Open the src/main/resources path folder.

  4. Open the log4j2.xml file inside the folder.

  5. Add an <AsyncLogger> tag inside the <Loggers> tag:

    				<AsyncLogger name="com.mulesoft.connectors.ws" level="DEBUG"/>
  6. Save your application changes.

  7. Click the project name in Package Explorer and then click Run > Run As > Mule Application.

Understand Common Throws

Here is a list of common throw messages and how to interpret them:


    The connection is no longer valid. Apply a reconnection policy if defined in the application setup.

    The maximum number of retries for the operation is reached.

    The WebSocket cannot be referenced because the WebSocket ID does not exist.

    The HTTP *Request* operation lacks basic authentication to send requests to the service, or the provided credentials are incorrect.

    The server refuses to give the requested resource because the client does not have access rights to the content.

    The server encountered a problem that prevented it from fulfilling the request.

    The WebSocket ID is null or blank.

    An error occurred while registering the WebSocket because the ID already exists.

    The server could not find the requested resource.

    The remote host closed the connection, which could be related to an SSL/TLS handshake issue. Check protocols, cipher suites, and certificate setup. Use -Djavax.net.debug=ssl for further debugging.

    The server is unable to manage the request because it is down for maintenance or overloaded.

    The authentication failed or has not yet been provided to get the requested response.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub
Submit your feedback!
Share your thoughts to help us build the best documentation experience for you!
Take our latest survey!