Search code examples
jbosspuppetjboss-eap-6augeas

How to intepret or analyze the Augeas error for domain.xml of Jboss EAP


I have tried to add a new attribute in the extensions element in domain.xml ( Jboss EAP ).

<domain xmlns="urn:jboss:domain:1.4">
    <extensions>
        <extension module="org.jboss.as.clustering.infinispan"/>
        <extension module="org.jboss.as.clustering.jgroups"/>
        <extension module="org.jboss.as.cmp"/>
        <extension module="org.jboss.as.configadmin"/>
        <extension module="org.jboss.as.connector"/>
        <extension module="org.jboss.as.ee"/>
        <extension module="org.jboss.as.ejb3"/>
        <extension module="org.jboss.as.jacorb"/>
        <extension module="org.jboss.as.jaxr"/>
        <extension module="org.jboss.as.jaxrs"/>
        <extension module="org.jboss.as.jdr"/>
        <extension module="org.jboss.as.jmx"/>
        <extension module="org.jboss.as.jpa"/>
        <extension module="org.jboss.as.jsf"/>
        <extension module="org.jboss.as.jsr77"/>
        <extension module="org.jboss.as.logging"/>
        <extension module="org.jboss.as.mail"/>
        <extension module="org.jboss.as.messaging"/>
        <extension module="org.jboss.as.modcluster"/>
        <extension module="org.jboss.as.naming"/>
        <extension module="org.jboss.as.pojo"/>
        <extension module="org.jboss.as.remoting"/>
        <extension module="org.jboss.as.sar"/>
        <extension module="org.jboss.as.security"/>
        <extension module="org.jboss.as.threads"/>
        <extension module="org.jboss.as.transactions"/>
        <extension module="org.jboss.as.web"/>
        <extension module="org.jboss.as.webservices"/>
        <extension module="org.jboss.as.weld"/>
    </extensions>
</domain>

Below are my commands what I have tried with. Please let me know whether I have done anything wrong.

set /augeas/load/xml/lens "Xml.lns" 
set /augeas/load/xml/incl "/opt/domain.xml"
load
set /files/opt/domain.xml/domain/extensions/#attribute/name = "arunraj"
save

I am getting the following error. Please guide me how to analyze or degug it.

/augeas/files/opt/PuppetRepo/domain.xml/error/message = "Failed to match \n { /#attribute/ }?({ /#text/ = /(\\]\\]\\][^]\001-\004<>][^]\001-\004<]\\]|(\\][^]\001-\004<]|[^]\001-\004<][^]\001-\004<])[^]\001-\004<]\\]|[^]\001-\004<]\\])(\\]\\][^]\001-\004<>][^]\001-\004<]\\]|[^]\001-\004<][^]\001-\004<]\\])(\\]\\]([^]\001-\004<>][^]\001-\004<]|)|[^]\001-\004<][^]\001-\004<]|)|\\]\\]\\]([^]\001-\004<>][^]\001-\004<]|)|(\\][^]\001-\004<]|[^]\001-\004<][^]\001-\004<])[^]\001-\004<]|\\]|[^]\001-\004<]/ } | { /#comment/ = /([^\001-\004-]|-[^\001-\004-])/ } | <> | { /[:A-Z_a-z][.0-:A-Z_a-z-]/ = /#empty/ } | { /#pi/ })\n with tree\n { \"#text\" = \"\n \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"extension\" = \"#empty\" } { \"#text\" = \" \" } { \"#attribute\" }"


Solution

  • The #attribute node you are trying to add must come before the extension nodes. You need to use insert for that:

    augtool> ins #attribute before /files/tmp/domain.xml/domain/extensions/*[1]
    augtool> set /files/tmp/domain.xml/domain/extensions/#attribute[1]/name "arunraj"