3 Replies Latest reply on Jun 29, 2012 11:04 AM by rhauch

    Why I can't register a repository in JNDI  with a name like java:global/myrepo

    emiste

      Hi ,

       

      Why I can't registed a repository ,started by my web application, in JNDI using a name like java:global/myrepo ? But the name java:app/myrepo is accepted.

       

      Best regards

        • 1. Re: Why I can't register a repository in JNDI  with a name like java:global/myrepo
          rhauch

          I assume that you're attempting to register the repository within the repository configuration (e.g., the "jndi-name" attribute in the "repository" element in a configuration file, such as "standalone-modeshape.xml"). IIUC, you can't use "java:app/myrepo" because ModeShape's subsystem (which is running in the heart of AS7, outside of any application scope) cannot register something into JNDI using an applications scope (as there is none). However, "java:global/myrepo" works, because the subsystem certainly has access to the global JNDI namespace. See the AS7 JNDI Reference for background.

          • 2. Re: Why I can't register a repository in JNDI  with a name like java:global/myrepo
            emiste

            Actually my case is different I started a repository within an EJB using this configuration :

            {

                "name" : "repo",

                "jndiName" : "java:global/repo",

                "workspaces" : {

                    "predefined" : ["otherWorkspace"],

                    "default" : "default",

                    "allowCreation" : true

                },

                "security" : {

                    "anonymous" : {

                        "roles" : ["readonly","readwrite","admin"],

                        "useOnFailedLogin" : false

                    }

                }

            }

            I did the test another time and I found that is working and I can actually register the repository using java:global/myrepo name . I think I did something wrong in my first test .

             

            Best regards

            • 3. Re: Why I can't register a repository in JNDI  with a name like java:global/myrepo
              rhauch

              Ah, registering a repository within an EJB should work, and I'm glad it does.