java.lang.IllegalAccessException: Class org.jboss.ejb3.EJBContainer can not access a member of class

Solution Verified - Updated -

Issue

  • I have upgradied from EAP 4 to EAP 5, and I am trying to call an EJB from with JBoss and receiving the below error.

    ...
    
    Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: Class org.jboss.ejb3.EJBContainer can not access a member of class org.jboss.examples.ExampleEjb with modifiers ""
         at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:852)
         at org.jboss.ejb3.stateless.StatelessContainer.createBeanContext(StatelessContainer.java:122)
         at org.jboss.ejb3.pool.AbstractPool.createBeanContext(AbstractPool.java:105)
         at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:79)
         at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:56)
         at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:51)
         at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:52)
         at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:92)
         at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
         at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
         ... 46 more
    Caused by: java.lang.IllegalAccessException: Class org.jboss.ejb3.EJBContainer can not access a member of class org.jboss.examples.ExampleEjb with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:844)
         ... 56 more
    

Environment

  • JBoss Enterprise Application Platform (EAP) 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content