You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LocalDateTime is on the boot loader, the class loader that is the parent of all class loaders. Your agent is however loaded on the system loader. As a result, ContextThreadLocalUtil is not visible to LocalDateTime, yielding the error you see.
Either, you need to inject the util class(es) into the boot loader (Instrumentation allows you to append to that loader) and then you need to change the module import (also via Instrumentation), or, easier, you include all your code in the advice class. The code in the advice is copied into the target method such that no visibility restrictions apply.
Thank you very much for your reply. The current solution is to enhance all calls to LocalDateTime. now() in the project, which is a rather clumsy approach. However, we would like to explore the two methods you introduced in the future.
Thank you again! We are about to celebrate the Chinese New Year, which is a joyful holiday. Wishing you a happy Spring Festival!
help! Looking forward to your reply!
i want to advice java.time.LocalDateTime,and i use this code:
in the LocalDateTimeInterceptor ,the code is:
ContextThreadLocalUtil is a class that i write
and when i invoke LocalDateTime.now(), exception occurs:
The text was updated successfully, but these errors were encountered: