You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Throw at build for resolvers that can't be called on their JDK dynamic proxy in 15.0.0 #868
Since #853, tools warns at build when a resolver is a JDK dynamic proxy (e.g. Spring AOP with proxyTargetClass = false) and a field resolves to a method or public field the proxy can't call. Spring4AopProxyHandler makes the scanner match fields against the target class, but the proxy only implements the target's interfaces, so every query of those fields fails:
object of type jdk.proxy2.$Proxy2 is not an instance of ProxiedQuery
For a public field it's Can not get final int field ProxiedQuery.count on jdk.proxy2.$Proxy2. For a field, the message says to add a getter as well, since class-based proxies don't pass field reads to the target either. The build logs this once per field:
Field 'Query.test' resolves to scenarios.ProxiedQuery.test, but the resolver is a jdk.proxy2.$Proxy2, which isn't a scenarios.ProxiedQuery, so every query of the field will fail. This happens with JDK dynamic proxies, which only implement interfaces. Use class-based proxies instead, e.g. proxyTargetClass = true in Spring.
A field that can never work should fail the build. But a schema whose broken field is never queried builds and runs fine today, so throwing has to wait for a major release.
What to change
replace the warning in SchemaClassScanner#warnIfNotCallableOnResolver with a FieldResolverError that keeps the same message
throw it even with allowUnimplementedResolvers or missingResolverDataFetcher set, since the resolver exists but can't be called
turn SchemaParserTest."parser handles spring AOP proxied resolvers by default", which only builds today, into a test for the error
Activity