11 Replies Latest reply on Apr 10, 2012 11:12 AM by rhauch

    Existing nodes not found after restart

    dimonv

      Hi all,

       

      I'm using a repository with org.modeshape.connector.disk.DiskSource as source in JBoss AS 7.1.1.Final. After startup and initialization I can create and store nodes, but after restart these nodes cannot be found anymore.

      I think it is a wrong behaviour (unless I'm doing something wrong)

      The configuration I'm using is pretty the same as in example http://docs.jboss.org/modeshape/latest/manuals/reference/html/disk-connector.html

       

      I know that DiskSource is quite new, but does anybody face the same issue?

       

      Thanks and regards

        • 1. Re: Existing nodes not found after restart
          rhauch

          Are you using ModeShape 2.8.0.Final, or an earlier version? Also, did you install it manually into AS7, or did you use one of the AS5 or AS6 kits? Finally, can you post your configuration file (obviously scrubbed of any non-sharable information)? In particular, I'm wondering whether you're configuring the Disk connector's "repositoryRootPath" to use a directory inside the AS7 installation location, and if so whether that directory's contents are changing upon startup.

           

          After starting up and creating content, can you see files and directories created under the "repositoryRootPath" directory? And do those exist after shutting down?

           

          Finally, when people are experiencing problems with a particular connector, we often recommend trying a different connector to see if the problem can be replicated. If so, it's probably not a problem in the connector.

           

          Best regards,

           

          Randall

          • 2. Re: Existing nodes not found after restart
            dimonv

            Hi Randall,

             

            2.8.0.Final is the version I'm using. I install it within my EAR.

             

             

             

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

            <!-- Windows Local Repository Configuration -->

            <configuration xmlns:mode="http://www.modeshape.org/1.0"

                xmlns:jcr="http://www.jcp.org/jcr/1.0">

                <mode:sources jcr:primaryType="nt:unstructured">

                    <mode:source jcr:name="mySource"

                        mode:classname="org.modeshape.connector.disk.DiskSource"

                        mode:description="The repository for our content"

                        mode:repositoryRootPath="${jboss.server.data.dir}/my-store"

                        mode:defaultWorkspaceName="dev" mode:creatingWorkspacesAllowed="false"

                        mode:rootNodeUuid="fd129c12-81a8-42ed-aa4b-820dba49e6f0"

                        mode:updatesAllowed="true">

                        <!-- If desired, specify a cache policy that caches items in memory for

                            5 minutes (300 s). This fragment can be left out if the connector should

                            not cache any content. -->

                        <mode:cachePolicy jcr:name="nodeCachePolicy"

                            mode:classname="org.modeshape.graph.connector.base.cache.InMemoryNodeCache$MapCachePolicy"

                            mode:timeToLive="300" />

                    </mode:source>

                </mode:sources>

                <mode:sequencers />

                <mode:repositories>

                    <mode:repository jcr:name="myRepo">

                        <!-- Specify the source that should be used for the repository -->

                        <mode:source>mySource</mode:source>

                        <!-- Define any custom node types. Importing CND files via JcrConfiguration

                            is equivalent to specifying here. -->

                        <jcr:nodeTypes mode:resource="/nodetypes.cnd" />

                        <mode:namespaces jcr:primaryType="mode:namespaces">

                            <org jcr:primaryType="mode:namespace" mode:uri="http://my.services/cim/1.0" />

                        </mode:namespaces>

                    </mode:repository>

                </mode:repositories>

            </configuration>

             

            I'm wondering whether you're configuring the Disk connector's "repositoryRootPath" to use a directory inside the AS7 installation location, and if so whether that directory's contents are changing upon startup.

            yes

             

            After starting up and creating content, can you see files and directories created under the "repositoryRootPath" directory? And do those exist after shutting down?

            yes, there are "dev" and "largeValues" directories under "repositoryRootPath" with hex-decimal-named sub-folders.

             

            The query I execute is:




            Query q = queryManager.createQuery("SELECT * FROM [" + jcrTypeName + "]", Query.JCR_SQL2);

             

            jcrTypeName is type node type of nodes I created and before restart the query returns result but after restart not.

             

            BTW on debuging in eclipse after restart if I choose jcrSession object in "Variables"-view, stringyfied view of it shows the indexed nodes like:

             

            /jet:mynodes/jet:mynode
            /jet:mynodes/jet:mynode[2]    
            /jet:mynodes/jet:mynode[3]
            

            with their attributes etc; that means for repo is not empty. BUT none of them is returned with query result

             

            Kind Regards,

            Dmitri

            • 3. Re: Existing nodes not found after restart
              rhauch

              Ah, so the when you say that "existing nodes are not found after restart", you really mean that the nodes do exist after restart and can be found via navigation (e.g., Session.getNode(...) method) but do not appear in query results.

               

              Is that correct?

              • 4. Re: Existing nodes not found after restart
                dimonv

                If the output I see on debugging in eclipse is produced by Session.getNode(...) then yes.

                • 5. Re: Existing nodes not found after restart
                  dimonv

                  Hi Randall,

                   

                   

                  Randall Hauch wrote:

                   

                  Finally, when people are experiencing problems with a particular connector, we often recommend trying a different connector to see if the problem can be replicated. If so, it's probably not a problem in the connector.

                  Could you suggest another source for testing?

                   

                  Thansk and regards

                  • 6. Re: Existing nodes not found after restart
                    rhauch

                    Probably the easiest to try the JPA conector using HSQLDB with a local file-based database. A sample configuration used in some integration tests can be found here.

                    • 7. Re: Existing nodes not found after restart
                      dimonv

                      I have already tried to configure JPA connector with the sample HSQL DS in JBoss 7.1.1, but didn't get it running: anyway EntityManager could not be created. The DiscSource seams to be the easiest one to configure. But it is dificult to prove if the problem occurs with the other connector like JPA.

                      • 8. Re: Existing nodes not found after restart
                        dimonv

                        Hi Randall,

                         

                        could you probably provide a sample EAR with the JPA-connector?

                         

                        Thanks

                        • 9. Re: Existing nodes not found after restart
                          rhauch

                          Using a different connector is probably not too important, since you clarified that the connector is storing the data properly but the problem is that your queries are not finding your data. So let's try to narrow down what's going wrong:

                           

                          Try issuing a query such as "SELECT * FROM [nt:base]", which is essentially selecting all nodes. You should get something back; if not, no nodes have been indexes. If you get some nodes, then some nodes are successfully being indexed, and either other nodes are failing to be indexed or your queries are incorrect.

                           

                          Check your configuration, which (as listed above) doesn't define where your indexes are to be stored. Without this, the indexes are stored in-memory, and have to be rebuilt every time ModeShape starts and any queries issued before the re-indexing is done will return incomplete results (as the indexes are incomplete before the re-indexing is done). See our documentation for how to set that up.

                          • 10. Re: Existing nodes not found after restart
                            dimonv

                            Hi Randall,

                             

                            it works!!!

                            After I've extended my repo config with the indexing.

                            I like modeshape!

                             

                            Many thanks and kind regards,

                            Dmitri

                            • 11. Re: Existing nodes not found after restart
                              rhauch

                              Dmitri Voronov wrote:

                               

                              it works!!! After I've extended my repo config with the indexing.

                              Good to hear! I wish I had noticed that earlier and saved you some time.