2 Replies Latest reply on Feb 27, 2009 12:56 PM by cretz

    IllegalAccessError, EJB3, and JBoss 5

    cretz

      I have a local iface like so

      @Local
      public interface UserDao {
      
       public User authenticate(String username, String password);
      
      }
      


      And an implementation like so

      @Stateless(name = "UserDao")
      public class UserDaoImpl extends DaoBase implements UserDao {
      
       public User authenticate(String username, String password) {
       return get(User.class, "User.authenticate", username, password);
       }
      
      }
      


      and the DaoBase class like so

      public abstract class DaoBase {
       <U> U get(Class<U> clazz, String queryName, Object... params) {
       //does stuff here
       }
      }
      


      yet for some reason, when my EJB impl accesses a package private method on the super class, I get an exception:

      java.lang.IllegalAccessError: tried to access method [package].DaoBase.get(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; from class [package].UserDaoImpl
      


      The way it is executed is from a seam-based war (deployed in a different ear on the same app server). The reference to this SLSB is obtained over JNDI. The war has a client jar for the aforementioned EJB w/out the implementation.

      This worked on JBoss 4. Any idea what I am doing wrong on JBoss 5 to prevent package private super-class method access from my implementation?