IllegalStateException in ExposeInvocationInterceptor after upgrading to Spring 4.1.x

After upgrading to Spring 4.1.4 and Spring Data Jpa 1.7.1 (from 4.0.2 and 1.5.1 respectively), I started getting IllegalStateException from ExposeInvocationInterceptor # currentInvocation ()

At first I thought that this might be somehow related to the following fix https://jira.spring.io/browse/SPR-12351 , but I have the same exceptions as with Spring 4.1 0.1.

Any ideas what could be the problem?

The following is a trace fragment of the exception stack:

java.lang.IllegalStateException: No MethodInvocation found: Check that an AOP invocation is in progress, and that the ExposeInvocationInterceptor is upfront in the interceptor chain. Specifically, note that advices with order HIGHEST_PRECEDENCE will execute before ExposeInvocationInterceptor! at org.springframework.aop.interceptor.ExposeInvocationInterceptor.currentInvocation(ExposeInvocationInterceptor.java:73) at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$ThreadBoundTargetSource.createObject(CrudMethodMetadataPostProcessor.java:226) at org.springframework.aop.target.AbstractLazyCreationTargetSource.getTarget(AbstractLazyCreationTargetSource.java:86) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:187) at com.sun.proxy.$Proxy112.getLockModeType(Unknown Source) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findOne(SimpleJpaRepository.java:224) ... 
+5
source share

Source: https://habr.com/ru/post/1210413/


All Articles