Skip to content

how to resolve java.lang.IllegalAccessError ? #13039

Answered by laurit
chenlujjj asked this question in Q&A
Discussion options

You must be logged in to vote

Copy the body of the advice method into an util class (for example JsonRpcSingletons would work) and call that method from the advice. Byte-buddy inline advice copies the body of the advice method into the instrumented method. You should avoid doing anything too complicated in the advice method and if complicated stuff is needed do it in a helper class. The exception is basically telling you that the instrumented method can't access an anonymous inner class from the advice class (that is your InvocationHandler implementation).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@chenlujjj
Comment options

@chenlujjj
Comment options

Answer selected by chenlujjj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants