0 Replies Latest reply on Oct 16, 2014 6:17 AM by Yuriy Sam

    XML config.Lookup from jndi properties file

    Yuriy Sam Newbie

      Hi, I'm newbie in jboss/wildfly.

       

      I have a project on weblogic and I would like to migrate on Wildfly.

      In weblogic I use InitialContext as RefFSContextFactory.

      My config contains (for example):

       

      <foreign-jndi-provider>

          <name>cfg</name>

          <target>ServerName</target>

          <initial-context-factory>com.sun.jndi.fscontext.RefFSContextFactory</initial-context-factory>

          <provider-url>file:/....</provider-url>

          <foreign-jndi-link>

            <name>foo</name>

            <local-jndi-name>cfg/Config/foo</local-jndi-name>

            <remote-jndi-name>Config/foo</remote-jndi-name>

          </foreign-jndi-link>

        </foreign-jndi-provider>

       

      foo suppose to be Referenceable object.

       

      .bindings file

       

      Config/foo/ClassName=com....Foo

      Config/foo/FactoryName=com...FooFactory

      Config/foo/RefAddr/0/Type=bar1

      Config/foo/RefAddr/0/Encoding=String

      Config/foo/RefAddr/0/Content=bar1content

      Config/foo/RefAddr/1/Type=bar2

      Config/foo/RefAddr/1/Encoding=String

      Config/foo/RefAddr/1/Content=bar2content

       

      I cann't understand how can I organize such structure on wildfly.

       

      I tried to do something like:

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

                  <bindings>

                      <external-context name="java:global/cfg/Config" module="com.sun.jndi" class="javax.naming.InitialContext" cache="true">

                          <environment>

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

                              <property name="java.naming.provider.url" value="file:/..."/>

                          </environment>

                      </external-context>

                      <lookup name="java:/cfg/Config/foo" lookup="java:global/cfg"/>

                  </bindings>

              </subsystem>


      But I got just NamingContext and ConversionNotSupportedException: Failed to convert property value of type 'org.jboss.as.naming.NamingContext' to required type 'com...Foo'