adityamparikh opened a new pull request, #172: URL: https://github.com/apache/solr-mcp/pull/172
# Summary `./gradlew nativeTest -Pnative` fails on every branch and PR (e.g. [PR #159's run](https://github.com/apache/solr-mcp/actions/runs/29925649186): 68 test failures). All failures collapse to a single root cause during `ApplicationContext` refresh: ``` IllegalArgumentException: Required no-arg constructor not found in org.springaicommunity.mcp.context.DefaultMetaProvider at org.springaicommunity.mcp.MetaUtils.getMeta(MetaUtils.java:63) at org.springaicommunity.mcp.provider.resource.SyncStatelessMcpResourceProvider.lambda$getResourceSpecifications$2(...) ... Caused by: java.lang.NoSuchMethodException: org.springaicommunity.mcp.context.DefaultMetaProvider.<init>() ``` The context fails to load 8 times and the remaining ~60 tests cascade-fail on `ApplicationContext failure threshold (1) exceeded`. # Root cause Spring AI 1.1.6 introduced a `MetaUtils.getMeta()` call path in the sync resource providers that reflectively invokes the no-arg constructor of `DefaultMetaProvider` when building the `resourceSpecs` bean. Spring AOT does not generate a reflection hint for it, so the constructor is invisible in GraalVM's closed world. Because `resourceSpecs` is part of the real application context (not just tests), the native *server binary* is affected too — currently masked in CI because the docker integration tests fail earlier on an image-tag mismatch (companion PR: the companion tag-suffix PR (link added after creation)). # Changes 1. **`fix(native)`**: register `MemberCategory.INVOKE_DECLARED_CONSTRUCTORS` for `org.springaicommunity.mcp.context.DefaultMetaProvider` in `SolrNativeHints`, alongside the existing SolrJ and MCP response-record hints. `registerTypeIfPresent` keeps it a no-op if a future Spring AI release removes or relocates the class. 2. **`test(config)`**: `@DisabledInNativeImage` on `SolrConfigAuthTest`. It reflects into SolrJ's private `basicAuthAuthorizationStr` field, which is not registered for reflection in the closed world, so its 5 tests fail in nativeTest (they pass on the JVM, which fully covers the basic-auth wiring). This second gap is currently masked by the `DefaultMetaProvider` failure — fixing only that one would leave nativeTest red with these 5. # Verification (local, GraalVM CE 25 / macOS arm64) - Before: `nativeTest -Pnative` reproduces CI's failure (every `@SpringBootTest` fails on `DefaultMetaProvider`; with only the hint fix applied, 5 `SolrConfigAuthTest` failures remain). - After both commits: **`nativeTest -Pnative` → 213 tests successful, 0 failed** (136 skipped: the Mockito/`@DisabledInNativeImage` set). - `./gradlew spotlessCheck build` passes (JVM path unaffected). - Additionally verified the pair with the companion tag-suffix PR (link added after creation) end-to-end: `bootBuildImage -Pnative` + `dockerIntegrationTest -Pnative` → the native stdio image passes the MCP protocol suite (39 tests) and smoke tests. The http leg as well: `dockerIntegrationTest -Pnative -Pprofile=http` → `DockerImageHttpIntegrationTest` (6 tests) passes against `solr-mcp:1.0.0-SNAPSHOT-native-http`. # Merge order This PR and the companion tag-suffix PR (link added after creation) are independent to review but jointly required for a green `native.yml`: this one fixes the `nativeTest` job; the companion fixes the image tag the docker jobs resolve. Suggest merging this one first (its docker jobs will still be red on the pre-existing tag mismatch), then the companion turns the matrix fully green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
