Class McpServerComponentRegistrationException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionConstructs a newMcpServerComponentRegistrationExceptionwith the specified detail message.McpServerComponentRegistrationException(String message, Throwable cause) Constructs a newMcpServerComponentRegistrationExceptionwith the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
McpServerComponentRegistrationException
Constructs a newMcpServerComponentRegistrationExceptionwith 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
Constructs a newMcpServerComponentRegistrationExceptionwith 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 informationcause- the underlying cause of the exception, may be null if the cause is unknown or not applicable
-