3 Replies Latest reply on Jan 5, 2016 5:03 AM by hchiorean

    Wildfly Modeshape Subsystem - Is it possible to load CND relative to ${jboss.server.config.dir} or load as WAR Resource?

    frank.mehlhose

      Hi,

       

      I'm using Wildfly 9.1.0-Final with Modeshape Subsystem 4.4.0-Final. We plan to run our application in Wildfly Domain Mode with up to 4 Server Instances.

       

      Is it possible to configure the Path to a Content Node Definition in Wildfly Modeshape Subsystem as relative Path?

       

      The following entry in standalone.xml leads to "WFLYCTL0264: node-types may not be ModelType.EXPRESSION":

      <node-types>
          <node-type>${jboss.server.config.dir}/modeshape/content-node-definition.cnd</node-type>
      </node-types>
      

       

      The following is possible for initial-content in standalone.xml:

      <workspace name="my-workspace">
          <initial-content>${jboss.server.config.dir}/modeshape/my-initial-content.xml</initial-content>
      </workspace>
      

       

      Is it possible to provide the CND File as Resource in a WAR File and configure Modeshape in the standalone.xml to load it from WAR Classpath?

       

      With kind Regards

        • 1. Re: Wildfly Modeshape Subsystem - Is it possible to load CND relative to ${jboss.server.config.dir} or load as WAR Resource?
          hchiorean
          Is it possible to configure the Path to a Content Node Definition in Wildfly Modeshape Subsystem as relative Path?

          You can configure it as a relative path, but it will be relative to the current server running directory (which most likely is the /bin folder). If instead you mean "is it possible to use environment variables" (like in your example), then no, it's not possible atm. However it wouldn't be difficult to add support for this, so feel free to log an enhancement request.

           

          Is it possible to provide the CND File as Resource in a WAR File and configure Modeshape in the standalone.xml to load it from WAR Classpath?

          No, this would be more complicated to do than the above. At the moment the initial content files are loaded essentially by the CL which loads the main ModeShape module. This CL is not exposed afaik. to the CL which loads custom deployed WARs in the server so there would be no visibility. To support this we would have to most likely add a "module" attribute to the "initial-content" element where one would have to add the name of the webapp.  Again, feel free to log another enhancement request.

          • 2. Re: Wildfly Modeshape Subsystem - Is it possible to load CND relative to ${jboss.server.config.dir} or load as WAR Resource?
            frank.mehlhose

            Thank you for you quick reply.

             

            I have some additional questions regarding the usage of the Modeshape Subsystem in Wildfly Domain Mode.

             

            Our target is to setup a Wildfly domain with 4 server instances in one server group. On this server group we want to deploy a Web Application (WAR) which is using the Modeshape Subsystem.

             

            My current understanding is that we need to configure a server profile (e.g. "my-server-profile") in domain.xml and I need to map this profile to a server group (e.g. "my-server-group").

            On the domain slaves in the host.xml we configure server instances and map those instances to our "server-group".

            If I want to provide a Path to the Initial Content File and a the Path to the Content Node Definition for the server instances in this cluster, I need to configure both Paths in the server profile in the domain.xml.

            This profile ("my-server-profile") is then applied to the corresponding Wildfly server instances on the domain slaves.

             

            But I also need to provide the Files for those Paths. Do we need to provide the Initial Content File and the Content Node Definition File on each domain slave or is it enough to put them on the domain controller?

             

            Is it possible to provide the Files for Initial Content and Content Node Definition on the Domain Controller and let the Domain Controller distribute those files to the slaves?

            We can define system properties for server groups in the domain.xml.

             

            Or do we need to manually distribute those files to the domain slaves with the corresponding server instances? This somewhat counters the value of the domain management from a central domain controller.

            Maybe the core question is: If a Wildfly Subsystem needs configuration files, is it possible to distribute those configuration files from the domain controller to the slaves?

             

            With kind regards

            Frank Mehlhose

            • 3. Re: Wildfly Modeshape Subsystem - Is it possible to load CND relative to ${jboss.server.config.dir} or load as WAR Resource?
              hchiorean

              From a repository perspective, the configuration should be the same (containing the same elements) on each of cluster nodes where the repository runs. So with the current configuration, you need to replicate the CND file(s) across all of the server nodes where the repository is configured.

               

              As far as distributing files across slaves from the controller, I'm not familiar with the peculiarities of Wildfly domain mode configuration, so part of the question would probably be better targeted towards the WF community.