Hi, Looks like Spring itself wraps result into proxy. If you could provide a reproducer it will help to find a reason faster.
2018-08-07 21:09 GMT+03:00 daya airody <[email protected]>: > Values retrieved from cache are wrapped with JdkDynamicAopProxy. This > throws > below NPEs > > ----------- > java.lang.NullPointerException: null > at > org.springframework.aop.framework.AdvisedSupport. > getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:481) > at > org.springframework.aop.framework.JdkDynamicAopProxy. > invoke(JdkDynamicAopProxy.java:197) > at com.sun.proxy.$Proxy255.getEmailAddress(Unknown Source) > at > com.partnertap.analytics.controller.AdminCannedController.getAllReps( > AdminCannedController.java:51) > > --------------------------- > I don't understand why cached values should be wrapped with proxies. > JdkDynamicAopProxy uses methodCache, which is null when the value is > retrieved from the cache. > > This is where I am caching the java method > -------------------- > @CacheResult(cacheName = "cannedReports") > public List<ReportsRepDetailsInterface> getAllReps(@CacheKey > String > managerId) { > --------------------- > In the object calling above method, I am trying to print, but getting NPE > instead. > > -------------------------------- > List<ReportsRepDetailsInterface> allReps = > reportsService.getAllReps(managerId); > for (ReportsRepDetailsInterface repDetail : allReps) { > logger.info("email->", repDetail.getEmailAddress()); > } > --------------------- > > please help. > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > -- Best regards, Ivan Pavlukhin
