4 Replies Latest reply on Dec 15, 2001 1:25 PM by 3004

    How to make jndi.properties work

    3004

      I create the following jndi.properties file in JAVAHOME\JRE\lib

      java.naming.factory.initial=weblogic.jndi.WLInitialContextFactoryjava.naming.provider.url=t3://localhost:7001

      When I try to make InitialContext with new InitialContext(), I got the Exception:

      javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
      . Root exception is java.lang.ClassNotFoundEx
      ception: weblogic/jndi/WLInitialContextFactory
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:195)
      at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
      at javax.naming.InitialContext.init(InitialContext.java:222)
      at javax.naming.InitialContext.<init>(InitialContext.java:178)
      at client.test.main(test.java:17)

      Please help.

      Cheng
        • 1. Re: How to make jndi.properties work
          3004
          You need WebLogic classes in your client classpath.

          Chengzhong Liao <cliao@exchange.pngcom.com> wrote:
          I create the following jndi.properties file in JAVAHOME\JRE\lib
          java.naming.factory.initial=weblogic.jndi.WLInitialContextFactoryjava.naming.provider.url=t3://localhost:7001
          When I try to make InitialContext with new InitialContext(), I got the Exception:
          javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
          Root exception is java.lang.ClassNotFoundEx
          ception: weblogic/jndi/WLInitialContextFactory
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:195)
          at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
          at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
          at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
          at javax.naming.InitialContext.init(InitialContext.java:222)
          at javax.naming.InitialContext.<init>(InitialContext.java:178)
          at client.test.main(test.java:17)
          Please help.
          Cheng
          --
          Dimitri
          • 2. Re: How to make jndi.properties work
            3004

            Dimitri,
            Thanks for your response.It still does not work
            even after I make all jar files of wlserver6.1 lib
            directory in my client classpath. It works When I use
            -D options.

            Thanks,
            Cheng


            Dimitri Rakitine <dr@dima.dhs.org> wrote:
            You need WebLogic classes in your client classpath.

            Chengzhong Liao <cliao@exchange.pngcom.com> wrote:
            I create the following jndi.properties file in JAVAHOME\JRE\lib
            java.naming.factory.initial=weblogic.jndi.WLInitialContextFactoryjava.naming.provider.url=t3://localhost:7001
            When I try to make InitialContext with new InitialContext(), I got
            the Exception:
            javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
            Root exception is java.lang.ClassNotFoundEx
            ception: weblogic/jndi/WLInitialContextFactory
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:195)
            at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
            at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
            at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
            at javax.naming.InitialContext.init(InitialContext.java:222)
            at javax.naming.InitialContext.<init>(InitialContext.java:178)
            at client.test.main(test.java:17)
            Please help.
            Cheng
            --
            Dimitri
            • 3. Re: How to make jndi.properties work
              3004

              Dimitri,
              Thanks for your response.It still does not work
              even after I make all jar files of wlserver6.1 lib
              directory in my client classpath. It works When I use
              -D options.

              Thanks,
              Cheng


              Dimitri Rakitine <dr@dima.dhs.org> wrote:
              You need WebLogic classes in your client classpath.

              Chengzhong Liao <cliao@exchange.pngcom.com> wrote:
              I create the following jndi.properties file in JAVAHOME\JRE\lib
              java.naming.factory.initial=weblogic.jndi.WLInitialContextFactoryjava.naming.provider.url=t3://localhost:7001
              When I try to make InitialContext with new InitialContext(), I got
              the Exception:
              javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
              Root exception is java.lang.ClassNotFoundEx
              ception: weblogic/jndi/WLInitialContextFactory
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:195)
              at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
              at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
              at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
              at javax.naming.InitialContext.init(InitialContext.java:222)
              at javax.naming.InitialContext.<init>(InitialContext.java:178)
              at client.test.main(test.java:17)
              Please help.
              Cheng
              --
              Dimitri
              • 4. Re: How to make jndi.properties work
                3004
                In article <3c168989$1@newsgroups.bea.com>, cliao@exchange.pngcom.com
                says...

                You also need the directory containing jndi.properties in your
                CLASSPATH.

                Regards,
                Bob

                >
                Dimitri,
                Thanks for your response.It still does not work
                even after I make all jar files of wlserver6.1 lib
                directory in my client classpath. It works When I use
                -D options.

                Thanks,
                Cheng


                Dimitri Rakitine <dr@dima.dhs.org> wrote:
                You need WebLogic classes in your client classpath.

                Chengzhong Liao <cliao@exchange.pngcom.com> wrote:
                I create the following jndi.properties file in JAVAHOME\JRE\lib
                java.naming.factory.initial=weblogic.jndi.WLInitialContextFactoryjava.naming.provider.url=t3://localhost:7001
                When I try to make InitialContext with new InitialContext(), I got
                the Exception:
                javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
                Root exception is java.lang.ClassNotFoundEx
                ception: weblogic/jndi/WLInitialContextFactory
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:195)
                at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
                at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
                at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
                at javax.naming.InitialContext.init(InitialContext.java:222)
                at javax.naming.InitialContext.<init>(InitialContext.java:178)
                at client.test.main(test.java:17)
                Please help.
                Cheng
                --
                Dimitri