1 Reply Latest reply on Jun 13, 2012 2:01 AM by jaikiran

    java.lang.IllegalStateException: ObjectFactoryBuilder already set

    gajendra083

      I was getting error : "javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.lms.ear.manage.war:main" from Service Module Loader"

       

      I solved this issue by adding jboss-as-naming-7.1.1.Final.jar into lib folder. I don't know whether this approach is right or not, I think this jar should been picked from modules.

       

      But after adding this jar I am getting error “java.lang.IllegalStateException: ObjectFactoryBuilder already set  javax.naming.spi.NamingManager.setObjectFactoryBuilder(NamingManager.java:94) [rt.jar:1.6.0_10-rc2]”

       

      kindly help



        • 1. Re: java.lang.IllegalStateException: ObjectFactoryBuilder already set
          jaikiran

          Gajendra Rathore wrote:

           

          I was getting error : "javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.lms.ear.manage.war:main" from Service Module Loader"

           

          Add a dependency on the org.jboss.remote-naming module in the META-INF/MANIFEST.MF of your war or in the jboss-deployment-structure.xml. See https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7 for details.

           

           

          Gajendra Rathore wrote:

           

           

          I solved this issue by adding jboss-as-naming-7.1.1.Final.jar into lib folder. I don't know whether this approach is right or not, I think this jar should been picked from modules.

          Don't do that. That's not the right way.