Announcement Announcement Module
Collapse
No announcement yet.
id attribute not allowed on transformer inside chain Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • id attribute not allowed on transformer inside chain

    Hi, I'm trying to set a bean id on a transformer and service activator that I have configured in a chain (see below for an example). However when I set the ID I get the following error (both compile & runtime):

    Code:
    cvc-complex-type.3.2.2: Attribute 'id' is not allowed to appear in element 'int:transformer'.	spring-integration.xml	/esb_proto_svcs/src/main/webapp/WEB-INF	line 78	XML Problem
    I'm really just wanting to get nice bean names for JMX so they don't all just say "handler". If there is a clean way to do that then I'm totally open to not setting the bean ID.

    I have a maven project with Spring 3.0.6 and integration 2.2.0.
    • spring core, beans, context, aop, asm, expression, jms, oxm, retry, tx, web all 3.0.6
    • spring security core, config, & web all 3.0.6
    • spring integration core, jms, jmx, xml all 2.2.0
    • spring-xml 2.1.1 brought in my spring-integration-xml

    Then my spring-integration.xml file has the following namespaces:
    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    	xmlns:int="http://www.springframework.org/schema/integration"
    	xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:task="http://www.springframework.org/schema/task"
    	xmlns:jee="http://www.springframework.org/schema/jee"
    	xmlns:int-xml="http://www.springframework.org/schema/integration/xml"
    	xmlns:int-jmx="http://www.springframework.org/schema/integration/jmx"
    	xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
    		http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
    		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
    		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
    		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/integration/xml http://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd
    		http://www.springframework.org/schema/integration/jmx http://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    Then I have the following chain:

    Code:
    	<!-- Main chain for processing a detector registration message -->
    	<int:chain id="detectorRegistrationChain" input-channel="detectorRegistrationXmlChannel">
    		<!-- Unmarshal XML to stubs then stubs to domain object -->
    		<int:transformer id="test" ref="detectorRegistrationUnmarshaller"/>
    		<int:transformer ref="detectorBuilder" method="toDetector"/>
    
    		<!-- Invoke business service -->
    		<int:service-activator ref="detectorRegistrationService" method="registerDetector"/>
    		
    		<!-- Marshalls domain object to stubs then to XML then finally to string (need to see if this is really ok?) -->
    		<int:transformer ref="detectorBuilder" method="fromValidatedDetector"/>
    		<int:transformer ref="detectorRegistrationMarshaller"/>
    		<int:transformer ref="toStringTransformer"/>	
    	</int:chain>
    Thanks,

    John

  • #2
    Currently, it is not allowed; we have an open JIRA issue to relax this restriction...

    https://jira.springsource.org/browse/INT-2755

    Vote it up!

    Comment


    • #3
      Hi, John!

      I'm glad to hear, that not only I am, who is interested in this solution
      So, I hope, I'll take care of it soon.

      BTW, can you explain a bit more what do you want to achive?
      I'm really just wanting to get nice bean names for JMX so they don't all just say "handler".
      Cheers,
      Artem

      Comment

      Working...
      X