1 Reply Latest reply on Jul 27, 2012 4:59 AM by mrctrevisan

    Guvnor/Tomcat/Mysql - dueling repository.xml's

    mcfeber

      [I posted this on the Drools discussion, but perhaps this is the correct list instead?]

       

      I am fairly new to Drools/Guvnor.  I am using guvnor 5.4.0. Final installed on Tomcat 7.0.27.  Following the instructions in the documentation, I

      1) Defined/downloaded the a repository.xml pointing to a mysql instance using the Administration -> Repository Configuration wizard.

      2) Stopped Tomcat, removed the $CATALINA_HOME/bin/repository.xml and repository directory

      3) Copied the new repository.xml to $CATALINA_HOME/bin

      4) Started Tomcat

      5) Using guvnor, my assets were created/stored in the mysql db

      6) Stopped Tomcat

      7) Started Tomcat

      8) Guvnor wrote a new repository.xml into $CATALINA_HOME (NOT $$CATALINA_HOME/bin which still contained the db version created in step 1.) and had 'forgotten' about the assets created in step 5.

      9) Stopped Tomcat

      10) Replaced the $CATALINA_HOME/repository.xml with a copy of the $CATALINA_HOME/bin/repository.xml.

      11) Started Tomcat

      12) Guvnor started using the mysql instance again and 'remembered' the assets from step 5

       

      Now there are two repository.xml files in $CATALINA_HOME and $CATALINA_HOME/bin.  This should not be necessary re the documentation.

       

      Why did it create a new repository/repository.xml in $CATALINA_HOME after a Tomcat restart?

      Which repository.xml is it really using now?

      How can I convince it to only use one of them?

       

      [Also of note: the workspace.xml files in $CATALINA_HOME/repository/workspaces/default and $CATALINA_HOME/bin/repository/workspaces/default are identical after step 11.]

       

      Thanks,

         Mark

        • 1. Re: Guvnor/Tomcat/Mysql - dueling repository.xml's
          mrctrevisan

          It MAY be due to the fact that the working directory ($wd) on which Tomcat is running is $CATALINA_HOME.

          this might be the case if you run tomcat by issuing the shell command from $CATALINA_HOME (something like "cd $CATALINA_HOME; ./bin/startup.sh").

           

          Since in my opinion it's not straightforward to depend on the working directory to locate my working datastore, I solved the problem editing  WEB-INF/components.xml in the drools-guvnor.war archive, uncommenting the "repository.root.directory" property (as suggested for production environments):

           

          <!-- JackRabbit  -->

          <property name="properties">

          <key>org.drools.repository.configurator</key><value>org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator</value>

          <!--  the root directory for the repo storage the directory must exist. -->

          <key>repository.root.directory</key><value>/opt/myDirectory</value>

          </property>

           

          See also: http://www.integratingstuff.com/2011/01/28/setting-up-drools-guvnor/

           

          Hope this helps. Cheers,

           

            Marco