6 Replies Latest reply on Oct 12, 2004 7:13 PM by Matt Corey

    'env-entry'-like items in JNDI?

    Matt Corey Newbie

      Is there anyway to store a simple string in JNDI? I'd like to setup something that works similar to the env-entry that you find in web.xml and ejb-jar.xml, but that I can simly install in a JBoss installation, so that when I migrate an application from one environment to another, I don't have to change any of the deployment descriptors each time... I'm hoping this will make the transition more error-free and reliable...

      Thanks,
      M

        • 1. Re: 'env-entry'-like items in JNDI?
          Robert Szalai Newbie

          Hi!

          First of all, this question isn't related to JMX.

          I don't understand you... why you need to change anything
          in web.xml (or ejb.xml) when you install an application from
          one environment to another?

          robisz

          • 2. Re: 'env-entry'-like items in JNDI?
            Elias Ross Master


            If you have "global settings" it's probably better to have them exposed as MBeans rather than creating JNDI entries. JNDI is better for things like service objects or LDAP trees.

            • 3. Re: 'env-entry'-like items in JNDI?
              Matt Corey Newbie

              Well, there is no forum related to Naming, so I picked this forum -- perhaps 'Installation & Configuration" would have been more appropariate, but that's not a real good fit either...

              Anyway, I want to change a value in web.xml because right now that's the only (easy) way I know of to put a simple String value into JNDI -- I'm using the <env-entry> tag to hold an environment-specific value (in this case, it's a private url that we access in code)... this means that I have to change the value in the web.xml and/or ejb-jar.xml files when I deploy into different environments (from development to staging to hosting, for example)... I know this isn't ideal, but I don't know of any other way to do it -- would love some direction here...

              Any ideas?

              • 4. Re: 'env-entry'-like items in JNDI?
                Matt Corey Newbie

                 

                "genman" wrote:

                If you have "global settings" it's probably better to have them exposed as MBeans rather than creating JNDI entries. JNDI is better for things like service objects or LDAP trees.


                I chose to do it this way because the env-entry technique is standard J2EE functionality -- Using an MBean to simply makes a String object available on JNDI was my first instance, but I haven't been able to find one... Is there an MBean that will do this for me?

                Thanks,
                M

                • 5. Re: 'env-entry'-like items in JNDI?
                  Scott Stark Master

                  No, there is no current mbean for binding strings into JNDI so you will have to write your own mbean to do this.

                  • 6. Re: 'env-entry'-like items in JNDI?
                    Matt Corey Newbie

                    Thanks, Scott -- that's what I needed to know... I've since implemented my own...

                    M