9 Replies Latest reply on Jan 3, 2013 3:28 AM by Nicklas Karlsson

    Getting proxy view for the class and getting class cast exception.

    Gaurav Gupta Newbie

      Hi i have interface and stateless bean implementing that interface:



      public interface IRBAC {


          public Hashtable<String, Hashtable<String, Boolean>> loadPermissionMap();


          public Collection<String> loadPublicResourceList();






      public class RBACHandler implements IRBAC {




          private EntityManager em;



          public static final String PERMISSION_MAP_NAME = "PermissionMap";



          public static final String PUBLIC_RESOURCE_MAP_NAME = "PublicResourceMap";



          @Out(required = false)

          List<Role> roleList;



          public Hashtable<String, Hashtable<String, Boolean>> loadPermissionMap() {


              return createdPermissionMap;



          public Collection<String> loadPublicResourceList() {


              return publicResourceList;




      public IRBAC getRBACHandler() {

              InitialContext context;

              try {

                 context = new InitialContext();

                  IRBAC rbac = (IRBAC ) context.lookup("java:global/protectoria/app.jar/RBACHandler");

                  return rbac;

              } catch (NamingException e) {

                  // e.printStackTrace();

                  logger.error("Lookup failed for class " + PERMISSION_LOOKUPHANDLER, e);

                  throw new RuntimeException(e);




      when i look up for context it returns:

      Proxy for view class: no.messageman.protectoria.core.security.IRBAC of EJB: RBACHandler

      and it simply gives class cast exception.

      in server.log i am getting:


      java.lang.ClassCastException: no.messageman.protectoria.core.utility.IRBAC$$$view61 cannot be cast to no.messageman.protectoria.core.utility.IRBAC



      can you please tell me how can i remove to overcome this issue?


      thanks in advamce.