On Spring Boot 3.1.0 using Java 17 cannot use interfaces extending Specification. If I put @Spec annotations right next to a Specification parameter in the controller - works fine.
java.lang.IllegalArgumentException: com.example.domain.AccountSpec referenced from a method is not visible from class loader
at java.base/java.lang.reflect.Proxy$ProxyBuilder.ensureVisible(Proxy.java:883) ~[na:na]
at java.base/java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:721) ~[na:na]
at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:648) ~[na:na]
at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:656) ~[na:na]
at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:429) ~[na:na]
at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329) ~[na:na]
at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205) ~[na:na]
at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:427) ~[na:na]
at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[na:na]
at net.kaczmarzyk.spring.data.jpa.web.EnhancerUtil.wrapWithIfaceImplementation(EnhancerUtil.java:34) ~[specification-arg-resolver-3.0.0.jar:na]
at net.kaczmarzyk.spring.data.jpa.web.SpecificationFactory.createSpecificationDependingOn(SpecificationFactory.java:73) ~[specification-arg-resolver-3.0.0.jar:na]
at net.kaczmarzyk.spring.data.jpa.web.SpecificationArgumentResolver.resolveArgument(SpecificationArgumentResolver.java:85) ~[specification-arg-resolver-3.0.0.jar:na]
at
On Spring Boot 3.1.0 using Java 17 cannot use interfaces extending
Specification
. If I put@Spec
annotations right next to aSpecification
parameter in the controller - works fine.Any clues or ideas?