Class McpServerComponentRegistrationException

All Implemented Interfaces:
Serializable

public class McpServerComponentRegistrationException extends McpServerException
Exception thrown when an error occurs during MCP server component registration.

This exception is used to indicate failures that occur while attempting to register MCP server components such as resources, prompts, tools, or completion handlers. Common scenarios where this exception may be thrown include:

  • Invalid method signatures for component handlers
  • Missing or incorrect annotations on component methods
  • Dependency injection failures during component creation
  • Configuration errors in component metadata
  • Reflection-related errors during component discovery

This exception extends McpServerException and is part of the MCP annotated framework's exception hierarchy, providing specific error information for component registration failures while maintaining compatibility with the general MCP server exception handling.

Author:
codeboyzhou
See Also:
  • Constructor Details

    • McpServerComponentRegistrationException

      public McpServerComponentRegistrationException(String message)
      Constructs a new McpServerComponentRegistrationException with the specified detail message.

      This constructor is typically used when the component registration failure can be described by a single error message without an underlying cause. The message should provide clear information about what went wrong during the registration process.

      Parameters:
      message - the detail message explaining the reason for the exception, may be null but should provide meaningful error information
    • McpServerComponentRegistrationException

      public McpServerComponentRegistrationException(String message, Throwable cause)
      Constructs a new McpServerComponentRegistrationException with the specified detail message and cause.

      This constructor is typically used when the component registration failure is caused by another exception. The cause exception is preserved and can be accessed later for detailed error analysis and debugging.

      Common causes include reflection exceptions, dependency injection failures, or validation errors during component creation. The message should provide context about the registration operation that failed.

      Parameters:
      message - the detail message explaining the reason for the exception, may be null but should provide meaningful error information
      cause - the underlying cause of the exception, may be null if the cause is unknown or not applicable