title: Configuring Datasource in Spring 3.0
body: <p>Hello guys I have configured a connection pool and JNDI resource in glassfish 2.1. I can get the Datasource via lookup method in my projects and everything works good. However I decided to try Spring framework and to use my existing connection pool. </p>
  
  <p>In the Spring context file I have the following:</p>
  
  <pre><code>&lt;jee:jndi-lookup id="dataSource" jndi-name="jdbc/name" /&gt;
  &lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate"&gt;
      &lt;constructor-arg ref="dataSource"/&gt;
  &lt;/bean&gt;
  &lt;bean id="dao" class="com.mycompany.mavenproject3.Dao"&gt;
      &lt;property name="simpleJdbcTemplate" ref="jdbcTemplate"/&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>When I deploy the project I get: </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is     required]</p>
  </blockquote>
  
  <p>Is there anything else I have to configure in that file or in any other file in order  to get the Datasource?</p>