11 Replies Latest reply on Jul 11, 2002 11:41 AM by manfred

    jndi entries outside of jar/war

    manfred

      Hi,

      Is it possible to add JNDI Entries without deploying an application ?

      I would like to have some String Values configured without packing it in jboss.xml inside my app.

      Using jboss3 there is not much of documentation available.
      Is there something like a

      jndi-service.xml or jndi.config ?

        • 1. Re: jndi entries outside of jar/war
          davidjencks

          Not that I know of. I once thought of writing an mbean to do something like this. I'd have one xml valued attribute containing a list of context/ type/ string representation triples and use the PropertyEditor support to construct the actual values. Subclass ServiceMBeanSupport and bind entries in the createService method, unbind them in destroyService. I think such a mbean could find a home in varia if you would like to contribute it.

          • 2. Re: jndi entries outside of jar/war
            sgturner

            David. What is the PropertyEditor you are referring to? Thanks

            • 3. Re: jndi entries outside of jar/war

              The PropertyEditor is part of the javabeans specification.

              The ServiceConfigurator automatically does
              property editing, e.g. turning a date in your xml into
              a java.util.Date

              Look here for more info...
              http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jboss-common/src/main/org/jboss/util/propertyeditor/
              http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jboss-system/src/main/org/jboss/system/ServiceConfigurator.java

              Regards,
              Adrian

              • 4. Re: jndi entries outside of jar/war
                manfred

                Ups,

                Ok, that would be a good solution. I considered
                using a separate war-file and a servlet based approach -
                but I could work myself through the jmx/mbean stuff.

                Hopefully I can find the code for the deploy-miracle in jboss. I would prefer to change jndi entries on runtime.

                The mbean should monitor the /deploy dir and reload changes on its xml-file ?

                • 5. Re: jndi entries outside of jar/war

                  You could write something similar to this.

                  http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jboss/src/main/org/jboss/naming/NamingAlias.java

                  You could then just drop *-service.xml in the deploy
                  directory for hot-deployment.

                  Regards,
                  Adrian

                  • 6. Re: jndi entries outside of jar/war
                    crackers

                    Yes, it is quite possible to use JNDI outside of a J2EE component. You just need to use the bind/unbind/rebind methods on the InitialContext object you get from JBoss (or any other app server).

                    • 7. Re: jndi entries outside of jar/war
                      manfred

                      Ok,

                      Its in the work. So far I have an mbean (in a jar) that is loading jndi entries from an separate -service.xml configuration, doing rebinds/unbind on start/stop.

                      I want to add creation of subcontexts soon.

                      I will try to download the newest jboss download since
                      I cannot find some of the files in
                      jboss-common/src/main/org/jboss/util/propertyeditor/
                      in my 3.0 distribution -
                      and integrating the propertyeditor stuff would enhance my implementation (though honestly strings are enough for my own requirements).

                      I can give the code back to jboss - any procedure for
                      this ?

                      Manfred.
                      http://www.regele.org

                      • 8. Re: jndi entries outside of jar/war
                        manfred

                        Ok,

                        Its in the work. So far I have an mbean (in a jar) that is loading jndi entries from an separate -service.xml configuration, doing rebinds/unbind on start/stop.

                        I want to add creation of subcontexts soon.

                        I will try to download the newest jboss download since
                        I cannot find some of the files in
                        jboss-common/src/main/org/jboss/util/propertyeditor/
                        in my 3.0 distribution -
                        and integrating the propertyeditor stuff would enhance my implementation (though honestly strings are enough for my own requirements).

                        I can give the code back to jboss - any procedure for
                        this ?


                        Manfred.
                        http://www.regele.org

                        • 9. Re: jndi entries outside of jar/war
                          manfred

                          Ok,

                          Its in the work. So far I have an mbean (in a jar) that is loading jndi entries from an separate -service.xml configuration, doing rebinds/unbind on start/stop.

                          I want to add creation of subcontexts soon.

                          I will try to download the newest jboss download since
                          I cannot find some of the files in
                          jboss-common/src/main/org/jboss/util/propertyeditor/
                          in my 3.0 distribution -
                          and integrating the propertyeditor stuff would enhance my implementation (though honestly strings are enough for my own requirements).

                          I can give the code back to jboss - any procedure for
                          this ?


                          Manfred.
                          http://www.regele.org

                          • 10. Re: jndi entries outside of jar/war
                            manfred

                            Ok,

                            Its in the work. So far I have an mbean (in a jar) that is loading jndi entries from an separate -service.xml configuration, doing rebinds/unbind on start/stop.

                            I want to add creation of subcontexts soon.

                            I will try to download the newest jboss download since
                            I cannot find some of the files in
                            jboss-common/src/main/org/jboss/util/propertyeditor/
                            in my 3.0 distribution -
                            and integrating the propertyeditor stuff would enhance my implementation (though honestly strings are enough for my own requirements).

                            I can give the code back to jboss - any procedure for
                            this ?


                            Manfred.
                            http://www.regele.org

                            • 11. Re: jndi entries outside of jar/war
                              manfred

                              Ok,

                              Its in the work. So far I have an mbean (in a jar) that is loading jndi entries from an separate -service.xml configuration, doing rebinds/unbind on start/stop.

                              I want to add creation of subcontexts soon.

                              I will try to download the newest jboss download since
                              I cannot find some of the files in
                              jboss-common/src/main/org/jboss/util/propertyeditor/
                              in my 3.0 distribution -
                              and integrating the propertyeditor stuff would enhance my implementation (though honestly strings are enough for my own requirements).

                              I can give the code back to jboss - any procedure for
                              this ?


                              Manfred.
                              http://www.regele.org