I am trying to create a Spring aspect around method, but it is not getting called.
In my GeoLocationUpdateService.java:
@Autowired
private GeocoderService geocoderService;
...
geocoderService.findGeoLocation(...)
In com.myCompany.app.service.util.GeocoderService.java:
@Service
@CacheConfig(cacheNames = {"geoLocation"})
public class GeocoderService {
public GeoLocation findGeoLocation(GeoMap geoMap, String address, String postalCode, String countryCode) {...}
}
In my com.myCompany.app.service.util.GeocoderServiceAspect.java:
@Aspect
@Component
public class GeocoderServiceAspect {
@Around("execution(* com.myCompany.app.service.util.GeocoderService.findGeoLocation(..))")
public GeoLocation findGeoLocation(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {...}
}
And in my WebMvcConfig.java:
@Configuration
@EnableSpringDataWebSupport
@EnableAspectJAutoProxy(proxyTargetClass = true)
@ComponentScan(basePackages = {"com.myCompany.app.*.web", "com.myCompany.app.service.util.*"})
@EnableAsync
public class WebMvcConfig extends WebMvcConfigurationSupport {...}
I put a breakpoint in GeocoderServiceAspect.java, but it did not break. It went into GeocoderService.java's findGeoLocation method.
The GeocoderServiceAspect.java's findGeoLocation method is not called.