2 Replies Latest reply on Apr 7, 2007 6:16 PM by Chunyun Zhao

    Unable to access Identity Module MBeans directly in 2.6 Beta

    Chunyun Zhao Newbie

      I am working on upgrading our portal application from 2.4 to 2.6 Beta1, one issue I have is the following code no longer works:

      
       ...
       @Depends("portal:service=Module,type=User")
       private RoleModule roleModule;
       ...
      
      


      When I deploy the application, it complaints that portal:service=Module,type=User is not yet installed, although I could find the MBean in the JMX Console.

      Then I read the reference documentation, and it recommends accessing Identity Modules using JNDI or IdentitIdentityServiceController. As I want to avoid JNDI lookup code in my application, I chose to use IdentityServiceController:


      
       ...
       @Depends("portal:service=Module,type=IdentityServiceController")
       private IdentityServiceController identityServiceController;
       ...
      
       UserModule userModule = (UserModule)identityServiceController.getIdentityContext().getObject(IdentityContext.TYPE_USER_MODULE);
       ...
      
      


      Although it works fine now, but I do think it is kinda ugly. Is there any better to do this in JBoss Portal 2.6 Beta1.

      Thanks.