title: Conflicting persistence unit definitions
body: <p>Spring 3.1.1
  Maven 3.0.4
  JPA
  Eclipse wtp indigo</p>
  
  <p>Hello,
  I am getting the following exception on server startup. I have just one persistence.xml in my project. Any ideas? Thanks Eric</p>
  
  <blockquote>
    <p>Caused by: java.lang.IllegalStateException: Conflicting persistence unit definitions for name 'cassandra_pu': file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cassandra/WEB-INF/classes/, file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cassandra/WEB-INF/classes/
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:362)
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:326)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:235)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 62 more</p>
  </blockquote>
  
  <p>My context file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"  
          xmlns:mvc="http://www.springframework.org/schema/mvc"  
          xmlns:context="http://www.springframework.org/schema/context"  
          xmlns:tx="http://www.springframework.org/schema/tx"  
          xmlns:p="http://www.springframework.org/schema/p"  
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
          xsi:schemaLocation="http://www.springframework.org/schema/beans  
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
          http://www.springframework.org/schema/context  
          http://www.springframework.org/schema/context/spring-context-3.0.xsd  
          http://www.springframework.org/schema/mvc  
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd  
          http://www.springframework.org/schema/tx   
          http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"&gt;  
  
      &lt;context:component-scan base-package="hamacher.cassandra.controller" /&gt;  
      &lt;context:component-scan base-package="hamacher.cassandra.dao" /&gt;  
      &lt;context:component-scan base-package="hamacher.cassandra.service" /&gt;  
      &lt;context:annotation-config /&gt;  
  
  
  
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;  
          &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt;  
          &lt;property name="suffix" value=".jsp"/&gt;  
      &lt;/bean&gt;  
  
    &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;    
      &lt;property name="packagesToScan" value="hamacher.cassandra.entity"/&gt;   
        &lt;property name="persistenceUnitName" value="cassandra_pu"/&gt;  
    &lt;/bean&gt;    
  
  
      &lt;tx:annotation-driven /&gt;  
  &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;  
          &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;  
  &lt;/bean&gt;  
  
  
  &lt;/beans&gt;  
  </code></pre>
  
  <p>My persistence.xml file is in META-INF where it should be:</p>
  
  <pre><code>   &lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence  
          http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"  
          version="2.0"&gt;  
          &lt;persistence-unit name="cassandra_pu"&gt;  
              &lt;provider&gt;com.impetus.kundera.KunderaPersistence&lt;/provider&gt;       
              &lt;properties&gt;            
                  &lt;property name="kundera.nodes" value="localhost"/&gt;  
                  &lt;property name="kundera.port" value="9160"/&gt;  
                  &lt;property name="kundera.keyspace" value="KunderaExamples"/&gt;  
                  &lt;property name="kundera.dialect" value="cassandra"/&gt;  
                  &lt;property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.pelops.PelopsClientFactory" /&gt;  
                  &lt;property name="kundera.cache.provider.class" value="com.impetus.kundera.cache.ehcache.EhCacheProvider"/&gt;  
                  &lt;property name="kundera.cache.config.resource" value="/ehcache-test.xml"/&gt;                  
              &lt;/properties&gt;       
          &lt;/persistence-unit&gt;  
      &lt;/persistence&gt;  
  </code></pre>