Camel
  1. Camel
  2. CAMEL-390

if folks overload xmlns to use camel, then define beans with <bean ...> Camel should generate an error with a useful error message

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Activity

      Hide
      Hadrian Zbarcea added a comment -

      I am not sure this is a valid issue yet. I suspect the xml is not correct but I only have briefly looked into it. If I understand correctly this is related to the use of refs.

      It's ok for the xml doc to have one default namespace and than one element (<camelContext>) to redefine the default namespace to be something else. However, since we are dealing with qnames, the camelContext element should define a different namespace mapping (and a prefix) for the default namespace of the document (the spring namespace) and use that to qualify the element it refs, so that resolution can happen.

      But then again, I may have misunderstood the issue completely. I'll look into it soon though.

      Show
      Hadrian Zbarcea added a comment - I am not sure this is a valid issue yet. I suspect the xml is not correct but I only have briefly looked into it. If I understand correctly this is related to the use of refs. It's ok for the xml doc to have one default namespace and than one element (<camelContext>) to redefine the default namespace to be something else. However, since we are dealing with qnames, the camelContext element should define a different namespace mapping (and a prefix) for the default namespace of the document (the spring namespace) and use that to qualify the element it refs, so that resolution can happen. But then again, I may have misunderstood the issue completely. I'll look into it soon though.
      Hide
      james strachan added a comment -

      I think this bug was raised to try help folks figure out issues caused by the xmlns being redeclared. e.g. something like this

      <?xml version="1.0" encoding="UTF-8"?> 
      <beans xmlns="http://www.springframework.org/schema/beans" 
              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-2.5.xsd
             http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> 
      
              <camelContext id="camel" useJmx="false" mbeanServer="mbeanServer" 
                      xmlns="http://activemq.apache.org/camel/schema/spring"> 
                      <package>org.apache.camel.example.spring</package> 
              </camelContext> 
      
              <!-- DOES THIS FAIL? -->
              <bean id="foo" class="whatnot"/>
      </beans>
      

      I can't remember if the xmlns redeclaration of the default namespace on the <camelContext/> disappears again after the </camelContext>. Does something like the above work? If not can we generate some kinda useful error message somehow?

      Show
      james strachan added a comment - I think this bug was raised to try help folks figure out issues caused by the xmlns being redeclared. e.g. something like this <?xml version= "1.0" encoding= "UTF-8" ?> <beans xmlns= "http: //www.springframework.org/schema/beans" 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-2.5.xsd http: //activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd"> <camelContext id= "camel" useJmx= " false " mbeanServer= "mbeanServer" xmlns= "http: //activemq.apache.org/camel/schema/spring" > < package >org.apache.camel.example.spring</ package > </camelContext> <!-- DOES THIS FAIL? --> <bean id= "foo" class= "whatnot" /> </beans> I can't remember if the xmlns redeclaration of the default namespace on the <camelContext/> disappears again after the </camelContext>. Does something like the above work? If not can we generate some kinda useful error message somehow?
      Hide
      Hadrian Zbarcea added a comment - - edited

      Isn't camel-example-spring doing exactly this successfully?

      The only difference is the beanServer="mbeanServer" missing. And there is obviously no element with the id:

      {http://activemq.apache.org/camel/schema/spring}

      mbeanServer".

      Show
      Hadrian Zbarcea added a comment - - edited Isn't camel-example-spring doing exactly this successfully? The only difference is the beanServer="mbeanServer" missing. And there is obviously no element with the id: {http://activemq.apache.org/camel/schema/spring} mbeanServer".
      Hide
      james strachan added a comment -

      you're right. I wonder if I was thinking of nested <bean> elements within the <camelContext/> - can't remember

      lets just close this issue for now

      Show
      james strachan added a comment - you're right. I wonder if I was thinking of nested <bean> elements within the <camelContext/> - can't remember lets just close this issue for now
      Hide
      james strachan added a comment -

      not an issue AFAIK

      Show
      james strachan added a comment - not an issue AFAIK
      Hide
      Claus Ibsen added a comment -

      Closing all 1.5.0 issues

      Show
      Claus Ibsen added a comment - Closing all 1.5.0 issues

        People

        • Assignee:
          Hadrian Zbarcea
          Reporter:
          james strachan
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development