1 Reply Latest reply on Feb 13, 2004 7:54 AM by jbriscoe

    ExternalContext Problem

    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

        • 1. Re: ExternalContext Problem
          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