Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11856

WildFlyInitialContext is not working and throw a NoInitialContextException for a lookup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 17.0.0.Alpha1, 17.0.0.Final
    • None
    • EJB
    • None

      As per documentation (https://github.com/wildfly/wildfly-naming-client#usage)
      the standard discovery can be bypassed with
      InitialContext ctx = new WildFlyInitialContext();
      Blah blah = (Blah) ctx.lookup("foo:blah");

      But this aproach will fail with the following Exception:
      Exception in thread "main" javax.naming.NoInitialContextException
      at org.wildfly.naming.client.WildFlyInitialContext.getDefaultInitCtx(WildFlyInitialContext.java:65)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:350)
      at javax.naming.InitialContext.lookup(InitialContext.java:417)
      at org.jboss.wfink.eap71.playground.client.SimpleWildFlyInitialContextClient.main(SimpleWildFlyInitialContextClient.java:41)

              tadamski@redhat.com Tomasz Adamski
              tadamski@redhat.com Tomasz Adamski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: