2 Replies Latest reply on Oct 3, 2017 4:38 AM by yair.shkedi

    jndi binding in wildfly 10

    yair.shkedi

      Hi,

      I am trying to upgrade jboss 4.03 to wildfly 10.

      I have an issue with configure the jndi binding.

      in the previous version, I had jndi.properties with the follow parameters:

       

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      java.naming.provider.url=localhost:1099

       

      and now when I change to wildfly 10, the lookup doesn't find the EJB (throw javax.naming.NameNotFoundException).

      I know that it is releated that in wildfly 10, the binding in another way.

       

      I read on the internet, and I saw that should bind the jndi via the standalone.xml.

      for example:

      <subsystem xmlns="urn:jboss:domain:naming:2.0">

          <bindings>

              <simple name="java:global/a" value="100" type="int" />

              <simple name="java:global/jboss.org/docs/url" value="https://docs.jboss.org" type="java.net.URL" />

              <object-factory name="java:global/foo/bar/factory" module="org.foo.bar" class="org.foo.bar.ObjectFactory" />

              <external-context name="java:global/federation/ldap/example" class="javax.naming.directory.InitialDirContext" cache="true">

                  <environment>

                      <property name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory" />

                      <property name="java.naming.provider.url" value="ldap://ldap.example.com:389" />

                      <property name="java.naming.security.authentication" value="simple" />

                      <property name="java.naming.security.principal" value="uid=admin,ou=system" />

                      <property name="java.naming.security.credentials" value="secret" />

                  </environment>

              </external-context>

              <lookup name="java:global/c" lookup="java:global/b" />

          </bindings>

          <remote-naming/>

      </subsystem>

       

      But I don't understand where and how should I configure my parameters in the new wildfly.

       

      Thanks,