2 Replies Latest reply on Apr 6, 2014 1:01 AM by Gorgi Terziev

    Start ModeShape Explorer web app

    Gorgi Terziev Newbie

      Hi,

       

      I am aware that similar question was posted, but the details of the resolution were not posted.

       

      I have successfully connected with a Modeshape repository via junit test. I basically used the code from Modeshape-examples\modeshape-spring-example:

      @RunWith(SpringJUnit4ClassRunner.class)

      @ContextConfiguration(locations = { "classpath:applicationContext-modeshape.xml"} )

      public class ModeShapeRepositoryTest {

       

        @Autowired

        private Session session;

       

          @Test

          public void shouldRunApplication() throws Exception {

       

              System.out.println( session.getRepository() );

              System.out.println( session.getWorkspace().getName() );

          }

      }

       

      I'd like to be able to connect to the same repository via Modeshape jcr explorer web app to visualize the repository structure.

      1. I defined resource in META-INF/context.xml

      <Context>

       

        <Resource name="jcr/bbsrepo"

                auth="Container"

                factory="org.modeshape.jcr.JndiRepositoryFactory"

                repositoryName="Bluebeanstalk Repository"

                configFile="absolute_file_path_to_modeshape_config_file.json" />  

       

      </Context>

       

      2. I added in Modeshape Explorer's web.xml

       

      <web-app...

       

        <resource-ref>

          <description>BB Repository</description>

          <res-ref-name>jcr/bbsrepo</res-ref-name>

          <res-type>javax.jcr.Repository</res-type>

          <res-auth>Container</res-auth>

        </resource-ref>

      </web-app>

       

      But I keep getting error message:

        No repository 'jcr/bbsrepo' was found. or Name [jcr/bbsrepo] is not bound in this Context. Unable to find [jcr].

       

      I 'd be grateful if someone can provide help how to properly access Modeshape repository via JNDI using the web explorer app.

       

       

      Thanks,

      Gorgi

        • 1. Re: Start ModeShape Explorer web app
          Oleg Kulikov Newbie

          Gorgi, you don't need to modify web-xml. You can just specify repository jndi name in login dialog.

           

          --Oleg

          1 of 1 people found this helpful
          • 2. Re: Start ModeShape Explorer web app
            Gorgi Terziev Newbie

            Thanks Oleg.

             

            Here are the steps the worked for me on Tomcat:

            1. Define JNDI resource in META-INF/context.xml 

            <Context>

             

              <Resource name="jcr/bbsrepo"

                      auth="Container"

                      factory="org.modeshape.jcr.JndiRepositoryFactory"

                      repositoryName="bbsrepo"

                      configFile="absolute_file_path_to_modeshape_config_file.json" /> 

             

            </Context>

             

              2. set the value of the jndiName parameter in  modeshape configuration file

            "jndiName" : "java:comp/env/jcr/bbsrepo",

             

              3.  Specify the full JNDI name in Web Explorer

            Repository name: java:comp/env/jcr/bbsrepo

             

            Regards,

            Gorgi