4 Replies Latest reply on Jun 10, 2013 3:39 AM by nl

    Initial content not working?




      just had a quick check on the new version and noticed that a new repository is not sourced with the initial content file.




      "name" : "repository",

          "jndiName" : "jcr/Test Repository",

          "transactionMode" : "none",

          "monitoring" : {

              "enabled" : false


      "workspaces" : {

              "default" : "default",      

              "allowCreation" : true,

              "initialContent" : {

                  "default" : "modeshape-initial-content-files.xml"





      with xml file



      <?xml version="1.0" encoding="UTF-8"?>

      <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dmsmix="http://www.mycompany.com/dms/mix/1.0">

          <files jcr:mixinTypes="dmsmix:publishArea" jcr:primaryType="nt:folder" dmsmix:autoremove="false" />

          <rules jcr:mixinTypes="dmsmix:adminArea" jcr:primaryType="nt:folder" dmsmix:autoremove="false" />




      Stepping through the code with a debugger I noticed that the ininital import is not performed because the workspace change is not empty(?). The following code in WorkspaceCache.java fails:





           * Checks if this ws cache is empty. An empty cache is considered when the only node key under root is the system key.


           * @return {@code true} if the system key is the only key under root, {@code false} other wise.


          public boolean isEmpty() {

              CachedNode root = getNode(getRootKey());

              // expect there to be 1 child under root - the system key

              return root.getChildReferences(this).size() == 1;       <-- in my case it is 0.




      Any help on this?


      Thanks, Niels

        • 1. Re: Initial content not working?

          Hi Niels,


          If the ws cache is empty, that means the repository hasn't successfully started up (it hasn't been successfully initialized, as the system area is always created first, hence the == 1 check).

          We have several unit tests that validate the initial content behavior, so I suspect that something else is wrong here.


          Are there any other warning/errors in the startup logs ? Do this still occur if you remove the "transactionMode" attribute ?



          • 2. Re: Initial content not working?

            Just one warning


            WARN  [main] org.infinispan.transaction.lookup.GenericTransactionManagerLookup: ISPN000104: Falling back to DummyTransactionManager from Infinispan



            But indeed, if I remove the transactionMode attribute the issue is gone.



            • 3. Re: Initial content not working?

              I've opened https://issues.jboss.org/browse/MODE-1959. In the meantime, you can simply omit the "transactionMode" attribute, even if you're not using transactions.

              1 of 1 people found this helpful
              • 4. Re: Initial content not working?