title: No unique bean of type [javax.persistence.EntityManager] is defined
body: <p>I am using JUnit 4 to test Dao Access with Spring (annotations) and JPA (hibernate). The datasource is configured through JNDI(Weblogic) with an ORacle(Backend). This persistence is configured with just the name and a RESOURCE_LOCAL transaction-type</p>
  
  <p>The application context file contains notations for annotations, JPA config, transactions, and default package and configuration for annotation detection.
  I am using Junit4 like so:</p>
  
  <hr>
  
  <p><b>ApplicationContext</b>
  <br>
  <code>
  
  
      </p>
  
  <pre><code>&lt;bean id="entityManagerFactory"  
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;  
       &lt;property name="persistenceUnitName" value="workRequest"/&gt;  
       &lt;property name="dataSource" ref="dataSource" /&gt;  
       &lt;property name="jpaVendorAdapter"&gt;  
           &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;  
               &lt;property name="databasePlatform" value="${database.target}"/&gt;  
               &lt;property name="showSql" value="${database.showSql}" /&gt;  
               &lt;property name="generateDdl" value="${database.generateDdl}" /&gt;  
           &lt;/bean&gt;  
       &lt;/property&gt;  
  &lt;/bean&gt;  
  
  &lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;property name="jndiName"&gt;
          &lt;value&gt;workRequest&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="jndiEnvironment"&gt;
          &lt;props&gt;
              &lt;prop key="java.naming.factory.initial"&gt;weblogic.jndi.WLInitialContextFactory&lt;/prop&gt;
              &lt;prop key="java.naming.provider.url"&gt;t3://localhost:7001&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/&gt;
  
  &lt;bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt;
  </code></pre>
  
  <p></code></p>
  
  <hr>
  
  <p><b>JUnit TestCase</b></p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = { "classpath:applicationContext.xml" })
  public class AssignmentDaoTest {
        private AssignmentDao assignmentDao;
        @Test
        public void readAll() {
              assertNotNull("assignmentDao cannot be null", assignmentDao);
              List&lt;Assignment&gt; assignments = assignmentDao.findAll();
              assertNotNull("There are no assignments yet", assignments);
        }
  } 
  </code></pre>
  
  <p><br>
  regardless of what changes I make I get: 
  <br>
  <code>
  <br>
  <b>No unique bean of type [javax.persistence.EntityManager] is defined</b>
  </code></p>
  
  <p>Any hint on what this could be. I am running the tests inside eclipse.</p>