Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-10428

Docs: Configuring paths for single file cache stores

XMLWordPrintable

      Embedded and server mode are using a different configuration for file-store

      embedded : infinispan-config*

              </xs:attribute>
              <xs:attribute name="relative-to" type="xs:string">
                <xs:annotation><xs:documentation>Unused XML attribute</xs:documentation></xs:annotation>
              </xs:attribute>
              <xs:attribute name="path" type="xs:string">
                <xs:annotation>
                  <xs:documentation>
                    The path within "relative-to" in which to store the cache state.
                    If undefined, the path defaults to the cache container name.
                  </xs:documentation>
                </xs:annotation>
              </xs:attribute>
            </xs:extension>
          </xs:complexContent>
        </xs:complexType>
      

      Here the relative-to is not used but referenced for path.
      But path is used relative to PWD if it is not an absolute one, also if defaults to 'Infinispan-SingleFileStore' if not set.

      For the server configuration it is

                      <xs:attribute name="relative-to" type="xs:string" default="jboss.server.data.dir">
                          <xs:annotation>
                              <xs:documentation>The base directory in which to store the cache state.</xs:documentation>
                          </xs:annotation>
                      </xs:attribute>
                      <xs:attribute name="path" type="xs:string">
                          <xs:annotation>
                              <xs:documentation>
                                  The path within "relative-to" in which to store the cache state.
                                  If undefined, the path defaults to the cache container name.
                              </xs:documentation>
                          </xs:annotation>
                      </xs:attribute>
      

      But relative-to is a reference to a path declaration like this

      <paths>
        <path name="my.dir" path="/MyCacheStore"/>
      </paths>
      ...
      <distributed-cache name="wolf">
        <persistence>
          <file-store shared="false" fetch-state="true" relative-to="my.dir"/>
        </persistence>
      </distributed-cache>
      

      If relative-to is set to a real path or env variable the server start will fail with

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.datagrid-infinispan.clustered.wolf.config: org.jboss.msc.service.StartException in service jboss.datagrid-infinispan.clustered.wolf.config: Failed to start service
      	...
      Caused by: java.lang.IllegalArgumentException: WFLYCTL0256: Could not find a path called '/MyCacheStore'
      	at org.jboss.as.controller.services.path.PathManagerService.resolveRelativePathEntry(PathManagerService.java:110)
      	at org.jboss.as.clustering.infinispan.subsystem.CacheConfigurationAdd$5.inject(CacheConfigurationAdd.java:765)
      	at org.jboss.as.clustering.infinispan.subsystem.CacheConfigurationAdd$5.inject(CacheConfigurationAdd.java:760)
      	at org.jboss.msc.inject.CastingInjector.inject(CastingInjector.java:58)
      	at org.jboss.msc.service.ServiceControllerImpl.inject(ServiceControllerImpl.java:1517)
      	at org.jboss.msc.service.ServiceControllerImpl.inject(ServiceControllerImpl.java:1503)
      	at org.jboss.msc.service.ServiceControllerImpl.access$2800(ServiceControllerImpl.java:55)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1699)
      	... 6 more
      

              dnaro@redhat.com Donald Naro
              rhn-support-wfink Wolf Fink
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: