java.lang.IllegalAccessException: Only certain classes can access this method.

Stack Overflow | Anand Rockzz | 5 months ago
  1. 0

    Slf4j Logback JUL performance

    codegur.com | 5 months ago
    java.lang.IllegalAccessException: Only certain classes can access this method.
  2. 0

    Logging in CLI Integration tests

    GitHub | 1 year ago | rnc
    java.lang.IllegalAccessException: Only certain classes can access this method.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Cannot access a public method via reflection (8.1SP2)

    Oracle Community | 1 decade ago | 666705
    java.lang.IllegalAccessException: Class ....utils.ReflectUtils can not access a member of class weblogic.servlet.internal.session.SessionData with modifiers "public" (ReflectUtils is our own reflection helper class that simply finds the right method and invokes it via reflection - it's well-used elsewhere without problems). I've not had a problem with reflection like this before - why would I not be able to invoke a public method? I modified ReflectUtils to explicitly set the method accessibility as follows, but still no joy: boolean access = method.isAccessible(); if (!access) method.setAccessible(true); Object ret = method.invoke(obj, methodArgs); I can only assume that Weblogic has placed some kind of security manager in the way - but then I'd expect a security exception not an illegal access. The customer is running 8.1SP2 with Sun JDK 1.4.1_05 in a clustered environment. The execution thread is running in an HttpSessionBindingListener.valueUnbound(HttpSessionBindingEvent) event handler, invoked as a result of weblogic invalidateAll:- <pre>(our_package).SessionData.valueUnbound(SessionData.java:135)
  5. 0

    DbUtils查询数据时出现这个问题:access to method denied

    GitHub | 1 year ago | sfsheng0322
    java.lang.IllegalAccessException: access to method denied

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalAccessException

      Only certain classes can access this method.

      at ch.qos.logback.classic.util.ContextSelectorStaticBinder.init()
    2. Logback Classic Module
      ContextSelectorStaticBinder.init
      1. ch.qos.logback.classic.util.ContextSelectorStaticBinder.init(ContextSelectorStaticBinder.java:59)
      1 frame
    3. SLF4J LOG4J-12 Binding
      StaticLoggerBinder.<clinit>
      1. org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:92)
      2. org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
      2 frames
    4. SLF4J API Module
      LoggerFactory.getLogger
      1. org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
      2. org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
      3. org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
      4. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
      5. org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
      5 frames
    5. eg.App2.somepkg
      App2sServletContextListener.<clinit>
      1. eg.App2.somepkg.App2sServletContextListener.<clinit>(App2sServletContextListener.java:31)
      1 frame
    6. Java RT
      Class.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      5. java.lang.Class.newInstance(Class.java:442)
      5 frames
    7. Atmosphere weblogic
      WebAppModule.start
      1. weblogic.servlet.internal.WebComponentContributor.getNewInstance(WebComponentContributor.java:252)
      2. weblogic.servlet.internal.WebComponentContributor.createInstance(WebComponentContributor.java:297)
      3. weblogic.servlet.internal.WebAppServletContext.createInstance(WebAppServletContext.java:4209)
      4. weblogic.servlet.internal.WebAppServletContext.createInstance(WebAppServletContext.java:4197)
      5. weblogic.servlet.internal.EventsManager.registerEventListener(EventsManager.java:538)
      6. weblogic.servlet.internal.EventsManager.registerEventListeners(EventsManager.java:139)
      7. weblogic.servlet.internal.EventsManager.registerEventListeners(EventsManager.java:97)
      8. weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1908)
      9. weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3063)
      10. weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1830)
      11. weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:875)
      11 frames
    8. weblogic.application.internal
      ExtensibleModuleWrapper$StartStateChange.next
      1. weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
      2. weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356)
      2 frames
    9. weblogic.application.utils
      StateMachineDriver.nextState
      1. weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
      1 frame
    10. weblogic.application.internal
      ModuleStateDriver$3.next
      1. weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138)
      2. weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
      3. weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:237)
      4. weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:232)
      4 frames
    11. weblogic.application.utils
      StateMachineDriver.nextState
      1. weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
      1 frame
    12. weblogic.application.internal
      BaseDeployment$2.next
      1. weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:82)
      2. weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:52)
      3. weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:753)
      3 frames
    13. weblogic.application.utils
      StateMachineDriver.nextState
      1. weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
      1 frame
    14. weblogic.application.internal
      DeploymentStateChecker.activate
      1. weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:263)
      2. weblogic.application.internal.EarDeployment.activate(EarDeployment.java:67)
      3. weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
      3 frames
    15. weblogic.deploy.internal
      BasicDeployment.activateFromServerLifecycle
      1. weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
      2. weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:265)
      3. weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:481)
      3 frames
    16. weblogic.management.deploy
      DeploymentServerService.start
      1. weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:53)
      2. weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:202)
      3. weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:52)
      4. weblogic.management.deploy.internal.ConfiguredDeployments$2.doItem(ConfiguredDeployments.java:592)
      5. weblogic.management.deploy.internal.parallel.BucketInvoker.invoke(BucketInvoker.java:138)
      6. weblogic.management.deploy.internal.ConfiguredDeployments.transitionAppsParallel(ConfiguredDeployments.java:600)
      7. weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:259)
      8. weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:155)
      9. weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:221)
      10. weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:130)
      10 frames
    17. weblogic.server
      AbstractServerService.postConstruct
      1. weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)
      1 frame
    18. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:498)
      3 frames
    19. HK2 Implementation Utilities
      ReflectionHelper.invoke
      1. org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1262)
      1 frame
    20. ServiceLocator Default Implementation
      SystemDescriptor.create
      1. org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:332)
      2. org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:374)
      3. org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
      3 frames
    21. Run Level Service
      RunLevelContext.findOrCreate
      1. org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:228)
      2. org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
      2 frames
    22. ServiceLocator Default Implementation
      SystemDescriptor.create
      1. org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2072)
      2. org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114)
      3. org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:698)
      4. org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78)
      5. org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:211)
      6. org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:234)
      7. org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:357)
      8. org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
      8 frames
    23. Run Level Service
      RunLevelContext.findOrCreate
      1. org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:228)
      2. org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
      2 frames
    24. ServiceLocator Default Implementation
      ServiceHandleImpl.getService
      1. org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2072)
      2. org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114)
      3. org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:88)
      3 frames
    25. Run Level Service
      CurrentTaskFuture$QueueRunner.run
      1. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
      2. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
      2 frames
    26. weblogic.work
      SelfTuningWorkManagerImpl$WorkAdapterImpl.run
      1. weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:643)
      1 frame
    27. weblogic.invocation
      ComponentInvocationContextManager.runAs
      1. weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
      2. weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
      2 frames
    28. weblogic.work
      ExecuteThread.run
      1. weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
      2. weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
      3. weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:617)
      4. weblogic.work.ExecuteThread.execute(ExecuteThread.java:397)
      5. weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
      5 frames