How to include xml in xml in fabric profile ?

Solution Verified - Updated -

Issue

  • How to keeping broker.xml untouched by changes regarding destinations to be created at the start of the broker.
  • By configuring a new custom profile and defined resource there. e.g. in broker.xml resource, we have mentioned other resource as below :
<!DOCTYPE beans [ 
<!ENTITY destinations SYSTEM "profile:destinations.xml"> 
]>
<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:amq="http://activemq.apache.org/schema/core"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="properties">
            <bean class="io.fabric8.mq.fabric.ConfigurationProperties"/>
        </property>
    </bean>

        <broker xmlns="http://activemq.apache.org/schema/core"
            brokerName="${broker-name}"
            dataDirectory="${data}"
            start="false" 
                        restartAllowed="false"
                        brokerId="${brokerId}"
                        persistent="${brokerPersistent}"
                        networkConnectorStartAsync="${networkConnectorStartAsync}">
        &destinations;

In the fabric logs we got the following exception:

2016-11-30 10:44:14,215 | WARN  | tp514786474-8285 | FileInfo                         | 276 - io.fabric8.fabric-git-hawtio - 1.2.0.redhat-621159 | Failed to parse the XML namespaces in /app/fabric/jboss-fuse-6.2.1.redhat-159/data/git/local/fabric/fabric/profiles/mq/broker/sbxAMcluster1.sbxAM01.profile/broker.xml due: Resource destinations.xml does not exist in the profile overlay.. This exception is ignored.
java.lang.IllegalStateException: Resource destinationsAM.xml does not exist in the profile overlay.
    at io.fabric8.api.gravia.IllegalStateAssertion.assertNotNull(IllegalStateAssertion.java:46)[141:io.fabric8.fabric-api:1.2.0.redhat-621159]
    at io.fabric8.service.ProfileUrlHandler$Connection.getInputStream(ProfileUrlHandler.java:114)[142:io.fabric8.fabric-core:1.2.0.redhat-621159]
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)[:]
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)[:]
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)[:]
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(Unknown Source)[:]
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)[:]
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)[:]
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)[:]
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)[:]

Environment

  • Red Hat JBoss Fuse
    • 6.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.