-
Bug
-
Resolution: Done
-
Major
-
7.3.0
-
Workaround Exists
-
At the beginning the camel context xml is as below, note the comment position.
<!-- try to set body here -->
<!-- here will set the message-->
The camel context xml is as below,
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="helloBean" class="com.mycompany.camel.spring.dm.HelloBean"> <property name="say" value="Hi from Camel"/> </bean> <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="timer:foo?period=5000"/> <!-- try to set body here --> <setBody> <method ref="helloBean" method="hello"></method> </setBody> <!-- here will set the message--> <log message="The message contains ${body}"/> </route> </camelContext> </beans>
I just clicked the "design view" and then "source view" several times, all the comments are put before <camelContext>.
==>
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <bean id="helloBean" class="com.mycompany.camel.spring.dm.HelloBean"> <property name="say" value="Hi from Camel"/> </bean> <!-- try to set body here --><!-- here will set the message--><camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="timer:foo?period=5000"/> <setBody> <method ref="helloBean" method="hello"></method> </setBody> <log message="The message contains ${body}"/> </route> </camelContext> </beans>