Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. Method.invoke() has thrown an IllegalAccessException
    Java Runtime
    11
    1
    13
  2. Reflection.ensureMemberAccess() has thrown an IllegalAccessException
    Java Runtime
    94
    100
    41

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
java.lang.IllegalAccessException: Class test1.TestRunMethod can not access a member of class test2.MyTargetClass with modifiers "public static"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
    at java.lang.reflect.Method.invoke(Method.java:578)

Solution

Alexander1 year ago

If you want to access functions/variables of a class from a different class they can't be private. The modifier private means that a function/variable can only be accessed from within the same class. Try the default, protected or public modifier.

External results for this pattern (10)

  1. maniappanvia GitHub4 weeks ago
    Unable to instantiate custom type: com.passbook.core.HstoreUserType
    Show stack trace
  2. natanikvia Google Groups1 month ago
    Error evaluating constraint 'list.empty' in [Rule "testRule" in rule.drl]
    Show stack trace
  3. kch...@twitter.com (JIRA)via Google Groups1 month ago
    io.jenkins.plugins.casc.impl.configurators.DescriptorConfigurator can not access a member of hudson.plugins.logparser.LogParserPublisher$DescriptorImpl with modifiers
    Show stack trace
  4. xxxLEOPARDxxxvia GitHub2 months ago
    Class funwayguy.epicsiegemod.ai.utils.CreeperHooks can not access a member of class net.minecraft.entity.monster.EntityCreeper with modifiers "private"
    Show stack trace
  5. Nethyavia GitHub2 months ago
    Class funwayguy.epicsiegemod.ai.utils.CreeperHooks can not access a member of class net.minecraft.entity.monster.EntityCreeper with modifiers "private"
    Show stack trace
  6. mdoganvia GitHub3 months ago
    Cannot access final java.lang.Package java.lang.ClassLoader.getDefinedPackage(java.lang.String)
    Show stack trace
  7. karol-202via GitHub3 months ago
    No message found for this stack trace.
    Show stack trace
  8. sobychackovia GitHub3 months ago
    Cannot setup StreamListener for public void wc.WordsConsumer.process(org.apache.kafka.streams.kstream.KStream); nested exception is java.lang.IllegalAccessException: Class org.springframework.cloud.stream.binder.kafka.streams.KafkaStreamsStreamListenerSetupMethodOrchestrator can not access a member of class wc.WordsConsumer with modifiers "public"
    Show stack trace
  9. 614984via Oracle Community3 months ago
    Class oracle.jbo.server.EntityDefImpl can not access a member of class top.oracle.apps.fnd.Test_01.Test_01EOImpl with modifiers "public"
    Show stack trace
  10. conanchenvia GitHub4 months ago
    Failed to execute CommandLineRunner
    Show stack trace