3 Replies Latest reply on Mar 5, 2013 1:47 AM by nickarls

    java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only

    vismay2011

      Hi ,

      I am using 'jboss-as-7.1.1.Final'  build,  an having a SAR file containing an MBean which tires to register an object into JNDI tree. while doing so its throws UnsupportedOperationException.

       

      CODE

       

      InitialContext rootCtx = new InitialContext();

      Name fullName = rootCtx.getNameParser("").parse(jndiName);

      NonSerializableFactory.rebind(fullName, this, true);

       

      ERROR:

      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.unbind(WritableServiceBasedNamingStore.java:98)

                at org.jboss.as.naming.WritableServiceBasedNamingStore.rebind(WritableServiceBasedNamingStore.java:85)

                at org.jboss.as.naming.NamingContext.rebind(NamingContext.java:237)

                at org.jboss.as.naming.InitialContext.rebind(InitialContext.java:178)

       

      I googled around and found its a bug .

      https://issues.jboss.org/browse/AS7-5584

       

      can anyone let me know which jars need to be updated to avail this fix?   I had also read , before binding or rebinding call ,  one can call WritableServiceBasedNamingStore.pushOwner()

      as a workaround..what are the parameters I have to pass to this PushOwner I am not sure.. any examples aroud this?

       

       

      thanks in advance

      -Vism