Search code examples
javajpaopenejb

JPA/Hibernate : @PersistenceContext unitName has multiple matches error


I am working on a project and so far it went quite well until I have checked out the latest changes from another team, to work on a most up to date files ( do not concentrate on that one ). I am working using Tomcat OpenEJB 3.1, JPA and Hibernate 3.2.6. What is the problem, after the deployment of application it gets stuck on :

2010-10-27 12:31:45,202 - INFO  - Adjusting PersistenceUnit RateQuesto-core <non-jta-data-source> to Resource ID 'jdbc/net.barano.rav.usage.DBNonJta' from 'null'
2010-10-27 12:31:45,202 - INFO  - Configuring PersistenceUnit(name=security_core, provider=org.hibernate.ejb.HibernatePersistence)
2010-10-27 12:31:45,202 - INFO  - Adjusting PersistenceUnit security_core <non-jta-data-source> to Resource ID 'jdbc/net.barano.rav.usage.DBNonJta' from 'null'
2010-10-27 12:31:45,233 - ERROR - FAIL ... Rikko.net.barano.rav.c_service.foo.KeyQuesto:    @PersistenceContext unitName has multiple matches: unitName "Rikko" has 16 possible matches.
2010-10-27 12:31:45,233 - ERROR - FAIL ... Rikko.net.barano.rav.c_service.foo.CommonFooQuesto:  @PersistenceContext unitName has multiple matches: unitName "Rikko" has 16 possible matches.
2010-10-27 12:31:45,233 - ERROR - FAIL ... Rikko.net.barano.rav.c_service.foo.internal.CommonFooQueries:    @PersistenceContext unitName has multiple matches: unitName "Rikko" has 16 possible matches.
2010-10-27 12:31:45,233 - ERROR - FAIL ... Rikko.net.barano.rav.c_service.foo.internal.KeyNameQueries:  @PersistenceContext unitName has multiple matches: unitName "Rikko" has 16 possible matches.
2010-10-27 12:31:45,233 - ERROR - FAIL ... Rikko.net.barano.rav.c_service.foo.internal.InternalAttach:  @PersistenceContext unitName has multiple matches: unitName "Rikko" has 16 possible matches.
2010-10-27 12:31:45,233 - ERROR - Invalid EjbModule(path=D:\PR_dev\workspaces v3.2.1\usage 5.4\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\rav-usage-admin\WEB-INF\lib\rav-cc-Rikkos-core-5.3.003.jar)
2010-10-27 12:31:45,233 - ERROR - FAIL ... security_core.net.barano.rav.c_service.security.authentication.LogonQuesto:  @PersistenceContext unitName has multiple matches: unitName "security_core" has 16 possible matches.
2010-10-27 12:31:45,233 - ERROR - Invalid EjbModule(path=D:\PR_dev\workspaces v3.2.1\usage 5.4\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\rav-usage-admin\WEB-INF\lib\rav-cc-security-core-5.3.003.jar)
2010-10-27 12:31:45,233 - ERROR - FAIL ... TuruHierarchyQuestoBLBenno:  @PersistenceContext unitName has multiple matches: unitName "rav-usage-core" has 16 possible matches.

I have double cheked all the basic settings and none were changed. Did anyone meet with this kind of problems ?

I will appreciate any support in this topic.

Thanks


Solution

  • I'd guess that your have your persistence.xml 16 times on your classpath. Clean the redundant ones.