Skip to content

JDK12: java.lang.IllegalArgumentException: org.springframework.data.jpa.repository.support.CrudMethodMetadata referenced from a method is not visible from class loader #3097

@rovarghe

Description

@rovarghe

java.lang.IllegalArgumentException: org.springframework.data.jpa.repository.support.CrudMethodMetadata referenced from a method is not visible from class loader
at java.lang.reflect.Proxy$ProxyBuilder.ensureVisible(Proxy.java:883) ~[?:?]
at java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:721) ~[?:?]
at java.lang.reflect.Proxy$ProxyBuilder.(Proxy.java:648) ~[?:?]
at java.lang.reflect.Proxy.lambda$getProxyConstructor$1(Proxy.java:440) ~[?:?]
at jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329) ~[?:?]
at jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205) ~[?:?]
at java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:438) ~[?:?]
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037) ~[?:?]
at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:126) ~[spring-aop-5.3.24.jar:5.3.24]
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110) ~[spring-aop-5.3.24.jar:5.3.24]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor.getCrudMethodMetadata(CrudMethodMetadataPostProcessor.java:92) ~[spring-data-jpa-2.6.3.jar:2.6.3]
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getRepositoryFragments(JpaRepositoryFactory.java:243) ~[spring-data-jpa-2.6.3.jar:2.6.3]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepositoryComposition(RepositoryFactorySupport.java:435) ~[spring-data-commons-2.6.3.jar:2.6.3]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:300) ~[spring-data-commons-2.6.3.jar:2.6.3]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:251) ~[spring-data-commons-2.6.3.jar:2.6.3]

This happens when code executes

EntityManager sharedEmf = SharedEntityManagerCreator.createSharedEntityManager(emf);
RepositoryFactorySupport rfs = new JpaRepositoryFactory(sharedEmf);
rfs.getRepository(MyRepo.class);

from a thread in a Fork Join Pool

It does not happen on the main thread - or tomcat nio thread.
It does not duplicate with JDK8

Metadata

Metadata

Assignees

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