9 Replies Latest reply on Jan 28, 2013 4:58 AM by avis71

    JNDI binding in extension module READONLY exception

    hellen-z

      Hi,

      My component is deployed as an extension module. And I cannot use EJB annotation for resource injection since only web profile can be used.

       

      So I try to do binding calling

       

           new InitialContext().bind(....),

       

      and I got excetion

       

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

             at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:118) [jboss-as-naming-7.1.0.CR1.jar:7.1.0.CR1]

              at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:53) [jboss-as-naming-7.1.0.CR1.jar:7.1.0.CR1]

              at org.jboss.as.naming.NamingContext.bind(NamingContext.java:220) [jboss-as-naming-7.1.0.CR1.jar:7.1.0.CR1]

              at org.jboss.as.naming.InitialContext.bind(InitialContext.java:146) [jboss-as-naming-7.1.0.CR1.jar:7.1.0.CR1]

              at org.jboss.as.naming.NamingContext.bind(NamingContext.java:229) [jboss-as-naming-7.1.0.CR1.jar:7.1.0.CR1]

       

      Result is the same if I use either org.jboss.as.naming.InitialContext or javax.naming.InitialContext

       

      Could you give any suggestions what I need to to?

       

      Thanks very much!