4 Replies Latest reply on Mar 24, 2014 10:40 AM by Lars-Erik Helander

    In absence of an EAP kit for EAP 6.2

    Lars-Erik Helander Newbie

      If I understand it correctly it would be possible to create a web application that would create one or more repositories and then register these repositories in JNDI, so that other applications may access these repositories via JNDI lookup.

       

      Are there any examples of a web application that creates repositories an registers them in JNDI?

      If not, could someone describe the principal API calls required to achieve this registration?

      Where in the JNDI tree will the repositories be registered? Or could I select an arbitrary JNDI location?

       

      Would it be possible to use Modeshape 4 with EAP 6.2 or should I use Modeshape 3.7 ?

       

      Thanks

       

      Lars

        • 1. Re: In absence of an EAP kit for EAP 6.2
          Horia Chiorean Master

          In the absence of a kit which integrates directly with the EAP subsystem, you need to either use the JCA adapter or embed (start/stop the repository programmatically) ModeShape in your own webapp/EAR.

           

          That being said, whenever a repository starts up, it always attempts to register itself in JNDI (using a new InitialContext() without properties) under:

          a) java:jcr/local/<repositoryName> if the JSON configuration does not contain a "jndiName" attribute

          b) whatever the value of "jndiName" attribute is in the JSON configuration file.

           

          So in the context of EAP, this should (in theory) always bind a repository in JNDI. That being said, since it doesn't integrate directly with EAP's JNDI subsystem, there may be some quirks (for example the default namespace under which it's bound). You need to try this locally and figure out what the exact JNDI url is (the code is modeshape/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrRepository.java at modeshape-3.7.1.Final · ModeShape/modeshap…)

           

          ModeShape 4 will provide a kit for integrating with Wildfly 8.1.

          • 2. Re: In absence of an EAP kit for EAP 6.2
            Lars-Erik Helander Newbie

            Since JBoss EAP is not able to bind to the default modshape JNDI space that seemed to be my major problem. Once I set the jndiName in the repository configuration I got it to work. The folllowing jndiName value worked:  "java:global/jcr/<repo-name>".

             

            Is it possible for an application embedded modeshape repository to use inifinispan caches defined on the JBoss server (e.g. defined in standalone.xml) ? or do the infinispan caches have to be defined as part of the repository configuration.

             

            When I embed modeshape into my application shall I also embed the inifinispan jars or should the infinispan jars on the server "be used"?

            • 3. Re: In absence of an EAP kit for EAP 6.2
              Horia Chiorean Master

              Most likely EAP 6.2, like Wildfly 8.1, don't support custom namespaces, which is why "java:jcr" (the default) would not work.

               

              Once you "embed" Modeshape, you need to embed everything else as well: Infinispan/ JGroups / etc; you won't be able to interface with any of the EAP-defined subsystems.

              Jar wise, I don't think you have to embed anything (I'm using the embed term loosely here): if you install the ModeShape kit in EAP, your application should (in theory) work just by adding a jboss-deployment-descriptor.xml file where you list the modules you depend on (from EAP). You just need to manage the repository from your own code.

               

              However, if this doesn't work, then you need to add not only the ModeShape jars, but also the Infinispan, JGroups and all the other dependencies to your application.

              • 4. Re: In absence of an EAP kit for EAP 6.2
                Lars-Erik Helander Newbie

                Thanks, this is valuable information.