0 Replies Latest reply on Jun 23, 2015 1:31 AM by mkarteek

    Modifying Roles for EJB Class and Methods in JBoss Container

    mkarteek

      I am trying to modify the roles for an  EJB class in jboss container after ear file deployment. Getting the below exception while trying to update the role.

       

      Code Snippet :

      MBeanServerConnection connection = jmxConnector.getMBeanServerConnection(); 

      ObjectName objectName = new ObjectName("boss.as:deployment.....");

      Attribute atr = new Attribute("runAsRole","abc");

      connection.setAttribute(objectName, atr);

       

       

      Exception:

      Exception in thread "main" javax.management.InvalidAttributeValueException: "JBAS014639: Attribute run-as-role is not writable"

        at org.jboss.as.jmx.model.ModelControllerMBeanHelper.setAttribute(ModelControllerMBeanHelper.java:328)

        at org.jboss.as.jmx.model.ModelControllerMBeanHelper.setAttribute(ModelControllerMBeanHelper.java:267)

        at org.jboss.as.jmx.model.ModelControllerMBeanServerPlugin.setAttribute(ModelControllerMBeanServerPlugin.java:220)

        at org.jboss.as.jmx.PluggableMBeanServerImpl.setAttribute(PluggableMBeanServerImpl.java:1017)

        at org.jboss.as.jmx.BlockingNotificationMBeanServer.setAttribute(BlockingNotificationMBeanServer.java:158)

        at org.jboss.remotingjmx.protocol.v2.ServerProxy$SetAttributeHandler.handle(ServerProxy.java:1152)

        at org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153)

        at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:75)

        at org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:70)

        at java.security.AccessController.doPrivileged(Native Method)

       

      Please suggest a solution to update roles for EJB class in JBoss container.

       

      Thanks in advance .

       

      Regards,

      M Karteek