java.lang.IllegalAccessException: Class com.evermind.server.ejb.interceptor.joinpo int.EJBJoinPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterp riseBean with modifiers "public"

Spring JIRA | Yudong Wang | 1 decade ago
  1. 0

    We are using OC4J 10.1.3. I have a MDB extending from AbstractJmsMessageDrivenBean. At runtime once a while an exception is thrown. After examing the stacktrace I have the following conclusion and workaround. Cause: The OC4J mdb lifecycle 'manager' tries to call ejbRemove() by reflection. ejbRemove is a public method implemenetd in AbstractEnterpriseBean. AbstractEnterpriseBean is hower a friendly class. Calling the method directly is not a problem, calling it by reflection is not allowed according to Sun's implementation. Workaround: I have my MDB extend the ejbRemove() an call super.ejbRemove(). Proposed solution: If one can not change Sun's implementation, change AbstractEnterpriseBean to a public class. -------------------------------- stacktrace ----------------------------------- 06/07/13 15:34:24 javax.ejb.EJBException: Class com.evermind.server.ejb.interceptor.joinpoint.EJBJoi nPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterpriseBean w ith modifiers "public"; nested exception is: java.lang.IllegalAccessException: Class com.evermind.se rver.ejb.interceptor.joinpoint.EJBJoinPointImpl can not access a member of class org.springframework .ejb.support.AbstractEnterpriseBean with modifiers "public" 06/07/13 15:34:24 java.lang.IllegalAccessException: Class com.evermind.server.ejb.interceptor.joinpo int.EJBJoinPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterp riseBean with modifiers "public" 06/07/13 15:34:24 at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) 06/07/13 15:34:24 at java.lang.reflect.Method.invoke(Method.java:578) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJB JoinPointImpl.java:35) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(Invocat ionContextImpl.java:69) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInter ceptor.java:52) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(Invocat ionContextImpl.java:69) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.in voke(SetContextActionInterceptor.java:34) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(Invocat ionContextImpl.java:69) 06/07/13 15:34:24 at com.evermind.server.ejb.LifecycleManager$LifecycleCallback.invokeLifecycl eMethod(LifecycleManager.java:619) 06/07/13 15:34:24 at com.evermind.server.ejb.LifecycleManager$LifecycleCallback.invokeLifecycl eMethod(LifecycleManager.java:606) 06/07/13 15:34:24 at com.evermind.server.ejb.LifecycleManager.preDestroy(LifecycleManager.java :109) 06/07/13 15:34:24 at com.evermind.server.ejb.MessageDrivenBeanPool.destroyContextImpl(MessageD rivenBeanPool.java:51) 06/07/13 15:34:24 at com.evermind.server.ejb.BeanPool.destroyContext(BeanPool.java:449) 06/07/13 15:34:24 at com.evermind.server.ejb.BeanPool.expirePool(BeanPool.java:372) 06/07/13 15:34:24 at com.evermind.server.ejb.EJBTask.run(EJBTask.java:33) 06/07/13 15:34:24 at com.evermind.util.Task.schedule(Task.java:51) 06/07/13 15:34:24 at com.evermind.util.TaskManager.run(TaskManager.java:221) 06/07/13 15:34:24 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor .java:814) 06/07/13 15:34:24 at java.lang.Thread.run(Thread.java:595)

    Spring JIRA | 1 decade ago | Yudong Wang
    java.lang.IllegalAccessException: Class com.evermind.server.ejb.interceptor.joinpo int.EJBJoinPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterp riseBean with modifiers "public"
  2. 0

    We are using OC4J 10.1.3. I have a MDB extending from AbstractJmsMessageDrivenBean. At runtime once a while an exception is thrown. After examing the stacktrace I have the following conclusion and workaround. Cause: The OC4J mdb lifecycle 'manager' tries to call ejbRemove() by reflection. ejbRemove is a public method implemenetd in AbstractEnterpriseBean. AbstractEnterpriseBean is hower a friendly class. Calling the method directly is not a problem, calling it by reflection is not allowed according to Sun's implementation. Workaround: I have my MDB extend the ejbRemove() an call super.ejbRemove(). Proposed solution: If one can not change Sun's implementation, change AbstractEnterpriseBean to a public class. -------------------------------- stacktrace ----------------------------------- 06/07/13 15:34:24 javax.ejb.EJBException: Class com.evermind.server.ejb.interceptor.joinpoint.EJBJoi nPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterpriseBean w ith modifiers "public"; nested exception is: java.lang.IllegalAccessException: Class com.evermind.se rver.ejb.interceptor.joinpoint.EJBJoinPointImpl can not access a member of class org.springframework .ejb.support.AbstractEnterpriseBean with modifiers "public" 06/07/13 15:34:24 java.lang.IllegalAccessException: Class com.evermind.server.ejb.interceptor.joinpo int.EJBJoinPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterp riseBean with modifiers "public" 06/07/13 15:34:24 at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) 06/07/13 15:34:24 at java.lang.reflect.Method.invoke(Method.java:578) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJB JoinPointImpl.java:35) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(Invocat ionContextImpl.java:69) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInter ceptor.java:52) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(Invocat ionContextImpl.java:69) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.in voke(SetContextActionInterceptor.java:34) 06/07/13 15:34:24 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(Invocat ionContextImpl.java:69) 06/07/13 15:34:24 at com.evermind.server.ejb.LifecycleManager$LifecycleCallback.invokeLifecycl eMethod(LifecycleManager.java:619) 06/07/13 15:34:24 at com.evermind.server.ejb.LifecycleManager$LifecycleCallback.invokeLifecycl eMethod(LifecycleManager.java:606) 06/07/13 15:34:24 at com.evermind.server.ejb.LifecycleManager.preDestroy(LifecycleManager.java :109) 06/07/13 15:34:24 at com.evermind.server.ejb.MessageDrivenBeanPool.destroyContextImpl(MessageD rivenBeanPool.java:51) 06/07/13 15:34:24 at com.evermind.server.ejb.BeanPool.destroyContext(BeanPool.java:449) 06/07/13 15:34:24 at com.evermind.server.ejb.BeanPool.expirePool(BeanPool.java:372) 06/07/13 15:34:24 at com.evermind.server.ejb.EJBTask.run(EJBTask.java:33) 06/07/13 15:34:24 at com.evermind.util.Task.schedule(Task.java:51) 06/07/13 15:34:24 at com.evermind.util.TaskManager.run(TaskManager.java:221) 06/07/13 15:34:24 at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor .java:814) 06/07/13 15:34:24 at java.lang.Thread.run(Thread.java:595)

    Spring JIRA | 1 decade ago | Yudong Wang
    java.lang.IllegalAccessException: Class com.evermind.server.ejb.interceptor.joinpo int.EJBJoinPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterp riseBean with modifiers "public"
  3. 0

    JUnit Testing: invoking parent class protected method

    Stack Overflow | 4 years ago
    java.lang.IllegalAccessException: Class test.package.subpackage.ATest can not access a member of class package.subpackage.A with modifiers "protected"
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Web service client problems | Java.net

    java.net | 2 years ago
    java.lang.IllegalAccessException: Class com.sun.enterprise.util.Utility can not access a member of class ws.ClientDriver with modifiers "public static"
  6. 0

    3.2.2.2. IllegalAccessException - Doing what you should not

    jboss.org | 2 years ago
    java.lang.IllegalAccessException: Class org.jboss.book.jmx.ex0.ExIAEd can not access a member of class org.jboss.book.jmx.ex0.ExCtx with modifiers ""

    7 unregistered visitors
    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

      Class com.evermind.server.ejb.interceptor.joinpo int.EJBJoinPointImpl can not access a member of class org.springframework.ejb.support.AbstractEnterp riseBean with modifiers "public"

      at sun.reflect.Reflection.ensureMemberAccess()
    2. Java RT
      Method.invoke
      1. sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
      2. java.lang.reflect.Method.invoke(Method.java:578)
      2 frames
    3. com.evermind.server
      EJBTask.run
      1. com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
      2. com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
      3. com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
      4. com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
      5. com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:34)
      6. com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
      7. com.evermind.server.ejb.LifecycleManager$LifecycleCallback.invokeLifecycleMethod(LifecycleManager.java:619)
      8. com.evermind.server.ejb.LifecycleManager$LifecycleCallback.invokeLifecycleMethod(LifecycleManager.java:606)
      9. com.evermind.server.ejb.LifecycleManager.preDestroy(LifecycleManager.java:109)
      10. com.evermind.server.ejb.MessageDrivenBeanPool.destroyContextImpl(MessageDrivenBeanPool.java:51)
      11. com.evermind.server.ejb.BeanPool.destroyContext(BeanPool.java:449)
      12. com.evermind.server.ejb.BeanPool.expirePool(BeanPool.java:372)
      13. com.evermind.server.ejb.EJBTask.run(EJBTask.java:33)
      13 frames
    4. com.evermind.util
      TaskManager.run
      1. com.evermind.util.Task.schedule(Task.java:51)
      2. com.evermind.util.TaskManager.run(TaskManager.java:221)
      2 frames
    5. Dough Lea's util.concurrent package
      PooledExecutor$Worker.run
      1. EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
      1 frame
    6. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:595)
      1 frame