4 Replies Latest reply on May 24, 2010 12:24 PM by Andreas Drobisch

    Configuring JNDI in Glassfish

    Andreas Drobisch Newbie

      Hello everyone,

      I am trying to setup Modeshape as Custom JNDI-Resource in Glassfish v3.

      During the test of the configuration, I am getting a The configurationFileInputStream argument may not be null error, so I think my value for the configFile property. I tried an absolute path and ab instance-relavtive path, but I am still getting the error.

       

      Whats I am supposed to put into that property?

        • 1. Re: Configuring JNDI in Glassfish
          Brian Carothers Apprentice

          That property is supposed to contain a file that's accessible from the classpath.  That is, it has to point to a resource, not a file.  I've created MODE-736 to fix this behavior.  I'm not completely sure what the correct fix is though.  Here are some options that I see:

           

           

          1.  Change the name of the property to configResource (and fix the docs as needed)

          2.  Make the JndiRepositoryFactory treat that as a file name and load the config from the filesystem rather than through the classloader

          3.  Make the JndiRepositoryFactory first try to load the configuration from the file system.  If that fails, try to load the configuration from the classloader

          4.  Have two properties on the JndiRepositoryFactory, one that loads through the classloader and one that loads from the filesystem.

           

          What do you think?

          • 2. Re: Configuring JNDI in Glassfish
            Andreas Drobisch Newbie

            I think option 2 or 4 would be convenient (I prefer option 4). JackRabbit ist also handling the configuration via file name and this way you could setup the modeshape instance a bit faster.

            • 3. Re: Configuring JNDI in Glassfish
              Brian Carothers Apprentice

              I split the difference and went with option 3

               

              The patch is committed to trunk, if you don't mind building from there.  I'd really appreciate it if you could post the config that you used to get this up with GlassFish.  We could add it to the docs if you did.

               

              Thanks for catching this issue!  Please let us know if you run into anything else.

              • 4. Re: Configuring JNDI in Glassfish
                Andreas Drobisch Newbie

                I tested it now with 1.2 final and its working as expected! Thanks for the fix!  I will update this topic asap with my current configuration.