title: Spring Integration Bean error
body: <p>So I have this code, what I'm trying to do is to receive stamp orders from the front end of the web app. After I received the stamp orders. I'll split the orders into single stamp orders then filter them to approved and disapproved stamp orders. After filtering them, I'll send an email to the recipient about their stamp orders.</p>
  
  <p>Here is my StampOrder.java</p>
  
  <pre><code>private BigInteger refId;
  private TaxpayerInfo taxpayerInfo;
  private StampPrintingStatus stampStatus;
  private Date transDate;
  private int transType;
  private int paymentRefNo;
  private BigDecimal totalPrintingCost;
  private BigDecimal totalEtEmt;
  private String apoPurchaseOrder;
  private Market market;
  private Users user;
  private List&lt;StampOrderDetails&gt; listOfStampOrder;
  
  
  public StampOrder(){
  
  }
  
  
  public StampOrder(BigInteger refId, TaxpayerInfo taxpayerInfo,
          StampPrintingStatus stampStatus, Date transDate, int transType,
          int paymentRefNo, BigDecimal totalPrintingCost,
          BigDecimal totalEtEmt, String apoPurchaseOrder, Market market,
          Users user, List&lt;StampOrderDetails&gt; listOfStampOrder) {
      this.refId = refId;
      this.taxpayerInfo = taxpayerInfo;
      this.stampStatus = stampStatus;
      this.transDate = transDate;
      this.transType = transType;
      this.paymentRefNo = paymentRefNo;
      this.totalPrintingCost = totalPrintingCost;
      this.totalEtEmt = totalEtEmt;
      this.apoPurchaseOrder = apoPurchaseOrder;
      this.market = market;
      this.user = user;
      this.listOfStampOrder = listOfStampOrder;
  }
  
  public boolean isApproved(){
      if(stampStatus.getStatusId()==3){
          return true;
      }else{
          return false;
      }
  }
  
  public BigInteger getRefId() {
      return refId;
  }
  public void setRefId(BigInteger refId) {
      this.refId = refId;
  }
  public TaxpayerInfo getTaxpayerInfo() {
      return taxpayerInfo;
  }
  public void setTaxpayerInfo(TaxpayerInfo taxpayerInfo) {
      this.taxpayerInfo = taxpayerInfo;
  }
  public StampPrintingStatus getStampStatus() {
      return stampStatus;
  }
  public void setStampStatus(StampPrintingStatus stampStatus) {
      this.stampStatus = stampStatus;
  }
  public Date getTransDate() {
      return transDate;
  }
  public void setTransDate(Date transDate) {
      this.transDate = transDate;
  }
  public int getTransType() {
      return transType;
  }
  public void setTransType(int transType) {
      this.transType = transType;
  }
  public int getPaymentRefNo() {
      return paymentRefNo;
  }
  public void setPaymentRefNo(int paymentRefNo) {
      this.paymentRefNo = paymentRefNo;
  }
  public BigDecimal getTotalPrintingCost() {
      return totalPrintingCost;
  }
  public void setTotalPrintingCost(BigDecimal totalPrintingCost) {
      this.totalPrintingCost = totalPrintingCost;
  }
  public BigDecimal getTotalEtEmt() {
      return totalEtEmt;
  }
  public void setTotalEtEmt(BigDecimal totalEtEmt) {
      this.totalEtEmt = totalEtEmt;
  }
  public String getApoPurchaseOrder() {
      return apoPurchaseOrder;
  }
  public void setApoPurchaseOrder(String apoPurchaseOrder) {
      this.apoPurchaseOrder = apoPurchaseOrder;
  }
  
  public Market getMarket() {
      return market;
  }
  public void setMarket(Market market) {
      this.market = market;
  }
  public Users getUser() {
      return user;
  }
  public void setUser(Users user) {
      this.user = user;
  }
  public List&lt;StampOrderDetails&gt; getListOfStampOrder() {
      return listOfStampOrder;
  }
  public void setListOfStampOrder(List&lt;StampOrderDetails&gt; listOfStampOrder) {
      this.listOfStampOrder = listOfStampOrder;
  }
  @Override
  public String toString() {
      return "StampOrder [refId=" + refId + ", taxpayerInfo=" + taxpayerInfo
              + ", stampStatus=" + stampStatus + ", transDate=" + transDate
              + ", transType=" + transType + ", paymentRefNo=" + paymentRefNo
              + ", totalPrintingCost=" + totalPrintingCost + ", totalEtEmt="
              + totalEtEmt + ", apoPurchaseOrder=" + apoPurchaseOrder
              + ", market=" + market + ", user=" + user
              + ", listOfStampOrder=" + listOfStampOrder + "]";
  }
  </code></pre>
  
  <p>Here is my spring integration schema xml</p>
  
  <pre><code>&lt;context:component-scan base-package="com.irsis.integration.mail" /&gt;
  
  &lt;!-- logger --&gt;
  &lt;int:logging-channel-adapter id="logger"
      log-full-message="true" level="INFO" /&gt;
  
  &lt;!-- gateway --&gt;
  &lt;int:channel id="newStampAuthChannel" /&gt;
  
  &lt;!-- Gateway Java --&gt;
  
  &lt;int:gateway id="stampAuthGateway"
      service-interface="com.irsis.integration.mail.StampAuthGateway"&gt;
      &lt;int:method name="receivedStampsAuth" request-channel="newStampAuthChannel" /&gt;
  &lt;/int:gateway&gt;
  
  &lt;!-- Splitter = Multiple Orders To Single Orders // Creates new Channel 
      for Single Orders --&gt;
  
  &lt;int:splitter input-channel="newStampAuthChannel"
      output-channel="singleStampAuthChannel" /&gt;
  
  &lt;int:channel id="singleStampAuthChannel" /&gt;
  
  &lt;!-- Filter = Filter ORders to approved or disapproved// Creates new Channel 
      for both --&gt;
  
  &lt;int:filter input-channel="singleStampAuthChannel"
      output-channel="filteredStampAuthChannel" ref="stampAuthFilter" /&gt;
  
  &lt;int:channel id="filteredStampAuthChannel"/&gt;
  
  
  &lt;!-- Router  --&gt;
  
  
  &lt;int:recipient-list-router input-channel="filteredStampAuthChannel"&gt;
      &lt;int:recipient channel="ApprovedOrderCreator"
          selector-expression="payload.approved" /&gt;
      &lt;int:recipient channel="RejectedOrderCreator"
          selector-expression="!payload.approved" /&gt;
  &lt;/int:recipient-list-router&gt;
  
  &lt;int:channel id="ApprovedOrderCreator" /&gt;
  &lt;int:channel id="RejectedOrderCreator" /&gt;
  
  
  &lt;!-- TRANSFORMERS OBJECTS IN DISGUISE --&gt;
  &lt;int:transformer input-channel="ApprovedOrderCreator"
      output-channel="sendChannel" ref="ApprovedOrderCreator" /&gt;
  
  &lt;int:transformer input-channel="RejectedOrderCreator"
      output-channel="sendChannel" ref="RejectedOrderCreator" /&gt;
  
  &lt;int:channel id="sendChannel"&gt;
      &lt;int:queue capacity="1000" /&gt;
  &lt;/int:channel&gt;
  
  &lt;!-- Service Activator --&gt;
  &lt;int:service-activator input-channel='sendChannel'
      ref='sendMailChannel' method="sendOrder"&gt;
  &lt;/int:service-activator&gt;
  
  &lt;import resource="classpath:/spring/application-context.xml"/&gt;
  &lt;bean id="orderJob" class="com.irsis.integration.mail.OrderJob" /&gt;
      &lt;/beans&gt;
  </code></pre>
  
  <p>The stampAuthGateway.java</p>
  
  <pre><code>public interface StampAuthGateway {
  void receivedStampsAuth(List&lt;StampOrder&gt; order);}
  </code></pre>
  
  <p>The stampAuthFilter.java </p>
  
  <pre><code>@Component
  public class StampAuthFilter {
  
  @Filter
  public boolean accept(Message&lt;StampOrder&gt; message){
      System.out.println("Filter Passed");
      StampOrder order = message.getPayload();
      boolean isApproved = order.getStampStatus().getStatusId() == 3;
      return isApproved;
  }
  }
  </code></pre>
  
  <p>The acceptCreatedOrders.java transformer</p>
  
  <pre><code>@Component
  @Service("ApprovedOrderCreator")
  @Transactional
  public class ApprovedOrderCreator  {
  
  
      @Transformer
      public List&lt;StampOrder&gt; createOrder(Message&lt;StampOrder&gt; message) {
          System.out.println("Accept Transformer Pass");
          StampOrder order = message.getPayload();
          List&lt;StampOrder&gt; saList = new ArrayList&lt;&gt;();
          if (order.getStampStatus().getStatusId() == 3) {
              saList.add(order);
          }
          return saList;
      }}
  </code></pre>
  
  <p>the rejectOrderCreator.java transformer has the same code has above but with this condition </p>
  
  <pre><code>if(order.getStampStatus.getStatusId!=3)
  </code></pre>
  
  <p>the sendMailChannel.java service activator</p>
  
  <pre><code>    @Autowired
  SendMailService sms;
  
  @ServiceActivator
  public void sendOrder(Message&lt;StampOrder&gt; message){
      StampOrder order = message.getPayload();
      if(order.getStampStatus().getStatusId()==3){
      sms.SendNotification(4, order.getTaxpayerInfo().getTinContactEAdd(), "blah");
      }else{
          sms.SendNotification(5, order.getTaxpayerInfo().getTinContactEAdd(), "blah");
      }
  </code></pre>
  
  <p>the stampOrderCreator interface</p>
  
  <pre><code>public interface StampOrderCreator {
  List&lt;StampOrder&gt; createOrder(Message&lt;StampOrder&gt; message);
  }
  </code></pre>
  
  <p>the orderJob.java</p>
  
  <pre><code>@Autowired
  StampAuthGateway stampAuthGateway;
  
  @Scheduled(fixedRate = 4000)
  public void scheduledStampOrderHandling() {
      StampOrderGenerator sgo = new StampOrderGenerator();
      List&lt;StampOrder&gt; orderList = sgo.generateStampOrder();
  
      stampAuthGateway.receivedStampsAuth(orderList);
  
  }
  </code></pre>
  
  <p>and the integration config xml</p>
  
  <pre><code>    &lt;import resource="classpath:/integration/mi-batch-config.xml"/&gt;
  &lt;import resource="classpath:/spring/application-context.xml"/&gt;
  
  &lt;context:component-scan base-package="com.irsis.integration.mail" /&gt;
  
  &lt;task:executor id="executor" pool-size="10"/&gt;
  &lt;task:scheduler id="scheduler" pool-size="10"/&gt;
  &lt;task:annotation-driven executor="executor" scheduler="scheduler"/&gt;
  </code></pre>
  
  <p>and when i'm running it here is the exception message that im getting</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.ConsumerEndpointFactoryBean#3': Cannot resolve reference to bean 'org.springframework.integration.config.TransformerFactoryBean#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.config.TransformerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Found ambiguous parameter type [interface org.springframework.integration.core.MessageHandler] for method match: [public void org.springframework.integration.context.IntegrationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException, public void org.springframework.integration.channel.AbstractMessageChannel.addInterceptor(org.springframework.integration.channel.ChannelInterceptor), public boolean org.springframework.integration.channel.AbstractSubscribableChannel.unsubscribe(org.springframework.integration.core.MessageHandler), public void org.springframework.integration.channel.AbstractMessageChannel.setConversionService(org.springframework.core.convert.ConversionService), public void org.springframework.integration.channel.AbstractMessageChannel.setInterceptors(java.util.List), public void org.springframework.integration.channel.DirectChannel.setMaxSubscribers(int), public void org.springframework.integration.context.IntegrationObjectSupport.setComponentName(java.lang.String), public java.lang.String org.springframework.integration.context.IntegrationObjectSupport.getApplicationContextId(), public void org.springframework.integration.channel.AbstractMessageChannel.setShouldTrack(boolean), public final void org.springframework.integration.context.IntegrationObjectSupport.setBeanFactory(org.springframework.beans.factory.BeanFactory), public void org.springframework.integration.channel.AbstractMessageChannel.setDatatypes(java.lang.Class[])]
  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329)
  at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1417)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1158)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
  at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
  at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
  at com.irsis.integration.test.BatchIntegrationTest.main(BatchIntegrationTest.java:14)
  </code></pre>
  
  <p>Sorry for the poor formatting was In a hurry posting this. Hope someone can help me.</p>
  
  <p>Thank you,
  Jet</p>