0

I extended a class dynamically using ASM. I used defineClass method without ProtectionDomain argument.When I try to use that class in other class, I am getting java.lang.NoClassDefFound Error. How can I store or retrieve class definition which is defined runtime using ASM ?

3
  • 2
    If you want help fixing your code, your best bet is to post the problematic code as a minimal reproducible example with a good description of what/where it goes wrong. Without any code, your question becomes far too broad. Commented Jul 2, 2018 at 6:36
  • This isnt what was intended in your question .. You must put the exact requirements and problem which you were facing for. You intended to ask for noClassDefFoundError for which a solution was provided. Commented Jul 3, 2018 at 14:13
  • Will be more specific with my question next time. Your code snippet helped me immensely to resolve my problem. Thanks Commented Jul 5, 2018 at 13:09

1 Answer 1

0

Instead of creating DynamicClassLoader Instance each time, storing it in class level static variable solves this issue. Each time new class loader was being created so previously created class wasn't found.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.