Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-8696

editing karaf camel route XML via hawtio console creates a broken XML with xmlns:xmlns

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • FIS 2.x-GA
    • FIS 2.0
    • FIS-Karaf
    • None
    • % %
    • FIS 2.0 R4

    Description

      Trying to edit Camel route of the karaf2-camel-amq quickstart via openshift seems to break the XML of the route.

      Before edit as seen in the console:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <routes xmlns="http://camel.apache.org/schema/spring" xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.5.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <route customId="true" id="generate-order">
              <from customId="true" id="route-timer" uri="timer:order?period=5000"/>
              <bean customId="true" id="route-generate-order" method="generateOrder" ref="orderGenerator"/>
              <setHeader customId="true" headerName="Exchange.FILE_NAME" id="route-header-file-name">
                  <method method="generateFileName" ref="orderGenerator"/>
              </setHeader>
              <to customId="true" id="route-to-jms-input" uri="file:work/jms/input"/>
          </route>
          <route customId="true" id="file-to-jms-route">
              <from customId="true" id="route-from-jms-input" uri="file:work/jms/input"/>
              <log customId="true" id="route-log-order" message="Receiving order ${file:name}"/>
              <to customId="true" id="route-to-incoming-orders" uri="activemq:incomingOrders"/>
          </route>
          <route customId="true" id="jms-cbr-route" streamCache="true">
              <from customId="true" id="route-from-incoming-orders" uri="activemq:incomingOrders"/>
              <choice customId="true" id="route-choice-country">
                  <when customId="true" id="route-when-uk">
                      <xpath>/order/customer/country = 'UK'</xpath>
                      <log customId="true" id="route-log-uk" message="Sending order ${file:name} to the UK"/>
                      <to customId="true" id="route-to-file-uk" uri="file:work/jms/output/uk"/>
                  </when>
                  <when customId="true" id="route-when-us">
                      <xpath>/order/customer/country = 'US'</xpath>
                      <log customId="true" id="route-log-us" message="Sending order ${file:name} to the US"/>
                      <to customId="true" id="route-to-file-us" uri="file:work/jms/output/us"/>
                  </when>
                  <otherwise customId="true" id="route-when-other-country">
                      <log customId="true" id="route-log-other" message="Sending order ${file:name} to another country"/>
                      <to customId="true" id="route-to-file-other" uri="file:work/jms/output/others"/>
                  </otherwise>
              </choice>
              <log customId="true" id="route-final-log" message="Done processing ${file:name}"/>
          </route>
      </routes>
      

      After doing an edit (e.g. changing the final log message) and reloading, the XML looks like this:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <routes xmlns="http://camel.apache.org/schema/spring" xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.5.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xmlns="http://camel.apache.org/schema/spring">
          <route customId="true" id="generate-order">
              <from customId="true" id="route-timer" uri="timer:order?period=5000"/>
              <bean customId="true" id="route-generate-order" method="generateOrder" ref="orderGenerator"/>
              <setHeader customId="true" headerName="Exchange.FILE_NAME" id="route-header-file-name">
                  <method method="generateFileName" ref="orderGenerator"/>
              </setHeader>
              <to customId="true" id="route-to-jms-input" uri="file:work/jms/input"/>
          </route>
          <route customId="true" id="file-to-jms-route">
              <from customId="true" id="route-from-jms-input" uri="file:work/jms/input"/>
              <log customId="true" id="route-log-order" message="Receiving order ${file:name}"/>
              <to customId="true" id="route-to-incoming-orders" uri="activemq:incomingOrders"/>
          </route>
          <route customId="true" id="jms-cbr-route" streamCache="true">
              <from customId="true" id="route-from-incoming-orders" uri="activemq:incomingOrders"/>
              <choice customId="true" id="route-choice-country">
                  <when customId="true" id="route-when-uk">
                      <xpath>/order/customer/country = 'UK'</xpath>
                      <log customId="true" id="route-log-uk" message="Sending order ${file:name} to the UK"/>
                      <to customId="true" id="route-to-file-uk" uri="file:work/jms/output/uk"/>
                  </when>
                  <when customId="true" id="route-when-us">
                      <xpath>/order/customer/country = 'US'</xpath>
                      <log customId="true" id="route-log-us" message="Sending order ${file:name} to the US"/>
                      <to customId="true" id="route-to-file-us" uri="file:work/jms/output/us"/>
                  </when>
                  <otherwise customId="true" id="route-when-other-country">
                      <log customId="true" id="route-log-other" message="Sending order ${file:name} to another country"/>
                      <to customId="true" id="route-to-file-other" uri="file:work/jms/output/others"/>
                  </otherwise>
              </choice>
              <log customId="true" id="route-final-log" message="Changed message, done processing ${file:name}"/>
          </route>
      </routes>
      

      (note the errornous xmlns:xmlns="http://camel.apache.org/schema/spring" attribute)

      The console then refuses to work with these camel routes,

      XML Parsing Error: reserved prefix (xmlns) must not be declared or undeclared
      Location: https://api.devel.xpaas:8443/console/java/camel/routes?con=karaf&main-tab=camel&sub-tab=camel-route-diagram&nid=root-org.apache.camel-com.redhat.xpaas.qe.karaf2-camel-amq-jms-example-context-routes
      Line Number 2, Column 1:
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              maschmid@redhat.com Marek Schmidt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: