5 Replies Latest reply on Feb 21, 2013 11:24 AM by chrishiner

    Create profile via CLI

    chrishiner

      I'm trying to create a new profile via the CLI, but I'm getting an error message:

       

      [domain@localhost:9999 /] /profile=dummy:add()

      {

          "outcome" => "failed",

          "failure-description" => {"domain-failure-description" => "Failed to persist configuration change: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to marshal configuration"},

          "rolled-back" => true

      }

       

      [domain@localhost:9999 /] /profile=dummy:add(includes=ha)

      {

          "outcome" => "failed",

          "failure-description" => {"domain-failure-description" => "Failed to persist configuration change: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to marshal configuration"},

          "rolled-back" => true

      }

       

      I can create new profiles by editing the config.xml file but I'd like to create them via the CLI. 

      I've tried it with nightly builds 1531 and 1594 and get the same result with both.

       

      Is this a known issue, or am I doing something wrong?

        • 1. Re: Create profile via CLI
          jaikiran

          It throws

          [Host Controller] Caused by: java.lang.IllegalArgumentException

          [Host Controller]     at org.jboss.dmr.ModelValue.getKeys(ModelValue.java:124) [jboss-dmr-1.0.0.Final.jar:1.0.0.Final]

          [Host Controller]     at org.jboss.dmr.ModelNode.keys(ModelNode.java:1085) [jboss-dmr-1.0.0.Final.jar:1.0.0.Final]

          [Host Controller]     at org.jboss.as.controller.parsing.DomainXml.writeProfile(DomainXml.java:502) [jboss-as-controller-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]

          trying to get the subsystems for the profile. Looks like a bug.

          1 of 1 people found this helpful
          • 2. Re: Create profile via CLI
            chrishiner

            AS7-1801 created.

            • 3. Re: Create profile via CLI
              chrishiner

              From http://community.jboss.org/thread/172245, workaround using a batch:

              batch

              /profile=exampleprofile:add()

              /profile=exampleprofile/subsystem=ee:add()

              run-batch

              • 4. Re: Create profile via CLI
                mustaq.pradhan

                Is there a way to create a profile based on another existing profile, something like /profile=dummy:add(includes=ha)? [as on your post]

                I get "Operation 'add' does not expect any property."

                • 5. Re: Create profile via CLI
                  chrishiner

                  There used to be an option to do that but it looks like it disappeared from the XML schema between jboss-as-config_1_0.xsd and jboss-as-config_1_1.xsd.

                  It had some limitations, such as you couldn't override subsystem configurations from the included profile.

                   

                  I just create the entire profile and related server configuration programmatically through the CLI from scratch for each deployment.