5 Replies Latest reply on Feb 13, 2004 7:54 AM by jbriscoe

    Cannot see external context in JNDI namespace

    Javi Newbie

      Hi there (and i hope this is the right forum for this),

      I am using JBoss 3.0.3. I have created an external JNDI context in the jboss-service.xml file with "JndiName" set to "external/fs" and "Properties" set to "external.fs.props". The external.fs.props file was placed in the /server/default/conf directory (the same as jboss-service.xml). My provider url is set to "file=///opt/jndiRoot". JBoss starts up with no errors but I cannot see the content (QCF created using JMSAdmin) underneath jndiRoot in the "Global JNDI Namespace":

      Global JNDI Namespace
      +- external (class: org.jnp.interfaces.NamingContext)
      | +- fs (proxy: $Proxy5 implements interface javax.naming.Context)


      Adding the same mbean code to jboss.jcml for JBoss 2.4.6 works ok i.e:
      +- external (class: org.jnp.interfaces.NamingContext)
      | +- fs (proxy: $Proxy1 implements interface javax.naming.Context)
      | | +- .bindings (class: java.io.File)
      | | +- QueueConnectionFactory (class: com.ibm.mq.jms.MQQueueConnectionFactory)



      Can anyone out there help me with this? Cheers,

      Javi

        • 1. Re: Cannot see external context in JNDI namespace
          Garry Tilitzky Newbie


          external/ldap/eDir
          eDir.properties
          javax.naming.ldap.InitialLdapContext
          true
          jboss:service=Naming



          This worked for me. I have the properties file in the same directory as the jboss-service.xml.

          • 2. Re: Cannot see external context in JNDI namespace
            Javi Newbie

            Thanks a lot. It did work for me too. I wasn't aware of these extra attributes.

            javi

            • 3. Re: Cannot see external context in JNDI namespace
              Javi Newbie

              Thanks a lot. It did work for me too. I wasn't aware of these extra attributes.

              javi

              • 4. Re: Cannot see external context in JNDI namespace
                jbriscoe Newbie

                I am trying to load a directory's contents into JNDI, not an LDAP directory.
                I'm using JBoss 3.2.2RC3

                My jboss-service.xml file looks like this:

                ---- Begin $JBOSS_HOME/server/default/deploy/jboss-service.xml

                mbean code="org.jboss.naming.ExternalContext" name="DefaultDomain:service=ExternalContext,jndiName=external/fs/TEMP"
                
                attribute name="JndiName" external/fs/TEMP
                attribute name="Properties" jacob_fs.properties
                attribute name="Properties" jacob_fs.properties
                attribute name="InitialContext" javax.naming.InitialContext
                
                

                ---- End $JBOSS_HOME/server/default/deploy/jboss-service.xml

                My properties file looks like this:

                ---- Begin $JBOSS_HOME/server/default/conf/jacob_fs.properties

                java.naming.factory.initial=com.sun.jndi.fscontext.FSContextFactory
                java.naming.provider.url=file:C:\TEMP
                

                ---- End $JBOSS_HOME/server/default/conf/jacob_fs.properties

                JBoss loads without any problems, it binds the name "external/fs/TEMP". What it does not do is recursively map the file "TEMP"'s contents, which is what I need to do.
                I've read several posts on this forum and the JBoss 2.4+ External JNDI and JNDI Viewing Docs and none have been completely helpfull. If somebody could please tell me what I'm doing wrong that would be greatly appreciated.


                Thanks in advance,
                Jacob

                • 5. Re: Cannot see external context in JNDI namespace
                  jbriscoe Newbie

                  After fighting with mounting a file system in JNDI with JBoss 3.2.2 I have finally solved the problem!
                  I was going about some things in the wrong way first off, I needed a SAR file for the new fs external context that I was creating. The SAR's layout looks like this...

                  $JBOSS_HOME/server/default/deploy/external-fs.sar
                  /fscontext.jar
                  /providerutil.jar
                  /META-INF
                  /META-INF/MANIFEST.MF
                  /META-INF/jboss-service.xml

                  That was my first problem that I solved, I was originally placing the jboss-service just in the deploy directory and putting the fscontext.jar & providerutil.jar in the server's lib directory.

                  The second problem was the content of the jboss-service.xml file. This is what my WORKING jboss-service.xml file looks like.

                  mbean code="org.jboss.naming.ExternalContext" name="jboss:service=ExternalContext,jndiName=external/fs"

                  attribute name="JndiName" external/fs

                  attribute name="Properties" java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
                  java.naming.provider.url=file:///TEMP

                  attribute name="InitialContext"
                  javax.naming.InitialContext
                  attribute name="RemoteAccess" false


                  -- End of File...

                  No documentation that I could find on this subject says that the properties attribute may be of actual Property type.
                  So all of that is working now. I deployed the .sar and everything works as planned.

                  I hope this helps somebody.

                  Jacob