title: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException
body: <p>This is my OffersDao class </p>
  
  <pre><code>package com.spring.dao;
  
  import java.sql.*;
  
  import javax.sql.DataSource;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
  import org.springframework.stereotype.Component;
  
  @Component
  public class OffersDao {
  
  
  private NamedParameterJdbcTemplate jdbc;
  
      @Autowired
      public void setDataSource(DataSource jdbc) {
          this.jdbc=new NamedParameterJdbcTemplate(jdbc);
      }
  }
  </code></pre>
  
  <p>When I am not autowiring the below part ,my app is working fine otherwise it is giving me above stated error </p>
  
  <p>This is my spring context xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jee="http://www.springframework.org/schema/jee"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.3.xsd
          http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd"&gt;
  
  
      &lt;context:annotation-config&gt;&lt;/context:annotation-config&gt;
      &lt;context:component-scan base-package="com.spring.dao"&gt;&lt;/context:component-scan&gt;
  
      &lt;jee:jndi-lookup jndi-name="jdbc/TestDB" id="dataSource"
          expected-type="javax.sql.DataSource"&gt;
      &lt;/jee:jndi-lookup&gt;
  
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>If anyone can tell me why this is happening.
  Moreover its a Maven Project.</p>