title: How to bind an object to JNDI in Jboss 7 from MBean? (Naming context is read-only)
body: <p>When binding object to JNDI from MBean (legacy code to jboss 7.1) i am getting following exception:</p>
  
  <pre><code>Caused by: java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only
      at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:126)
      at org.jboss.as.naming.WritableServiceBasedNamingStore.createSubcontext(WritableServiceBasedNamingStore.java:116)
      at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:338)
      at org.jboss.as.naming.InitialContext.createSubcontext(InitialContext.java:229)
      at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:346)
      at javax.naming.InitialContext.createSubcontext(InitialContext.java:464) [classes.jar:1.6.0_33]
      at org.jboss.as.naming.util.NamingUtils.createSubcontext(NamingUtils.java:63)
      at org.jboss.as.naming.util.NamingUtils.rebind(NamingUtils.java:239)
      at org.jboss.as.naming.util.NamingUtils.rebind(NamingUtils.java:225)
      at com.cdate.hypertable.commons.pool.mgmt.HyperClientConfigMgmt.rebind(HyperClientConfigMgmt.java:79)
  </code></pre>
  
  <p>How can i bind object to JNDI from MBean?
  Is it possible to run binding code from MBean in secured context with some "owner"?</p>