Skip to content

no default JsonSchemaValidatorSupplier or default McpJsonMapper in mcp-json project #574

@scottslewis

Description

@scottslewis

As per bug #562 I'm also getting these exceptions when running the latest 0.14.0 in repo (not deployed yet).

java.lang.IllegalStateException: No default JsonSchemaValidatorSupplier implementation found
at io.modelcontextprotocol.json.schema.JsonSchemaInternal.lambda$createDefaultValidator$2(JsonSchemaInternal.java:66)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at io.modelcontextprotocol.json.schema.JsonSchemaInternal.createDefaultValidator(JsonSchemaInternal.java:61)
at io.modelcontextprotocol.json.schema.JsonSchemaInternal.getDefaultValidator(JsonSchemaInternal.java:30)
at io.modelcontextprotocol.json.schema.JsonSchemaValidator.getDefault(JsonSchemaValidator.java:61)
at io.modelcontextprotocol.server.McpServer$SingleSessionAsyncSpecification.build(McpServer.java:232)
at ...

and

java.lang.IllegalStateException: No default McpJsonMapper implementation found
at io.modelcontextprotocol.json.McpJsonInternal.lambda$createDefaultMapper$2(McpJsonInternal.java:67)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at io.modelcontextprotocol.json.McpJsonInternal.createDefaultMapper(McpJsonInternal.java:62)
at io.modelcontextprotocol.json.McpJsonInternal.getDefaultMapper(McpJsonInternal.java:30)
at io.modelcontextprotocol.json.McpJsonMapper.getDefault(McpJsonMapper.java:97)
at io.modelcontextprotocol.server.McpServer$SingleSessionSyncSpecification.build(McpServer.java:818)
at ...

This problem does not appear to me to be an OSGi problem as when I look in the mcp-json project there does not appear to be any META-INF/services/* files. I can see that the ServiceLoader is used in io.modelcontextprotocol.json.schema.JsonSchemaInternal line 41, and in io.modelcontextprotocol.json.McpJsonInternal line 45, so I suspect that the META-INF/services/* files in mcp-json were accidently not checked in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions