[jboss-cvs] JBossAS SVN: r78333 - projects/jpa/trunk/sandbox/src/main/java/org/jboss/jpa/sandbox/remote.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 10 06:52:48 EDT 2008


Author: wolfc
Date: 2008-09-10 06:52:48 -0400 (Wed, 10 Sep 2008)
New Revision: 78333

Modified:
   projects/jpa/trunk/sandbox/src/main/java/org/jboss/jpa/sandbox/remote/RemotelyInjectEntityManagerFactory.java
Log:
Ignore multiple persistence units, use the first one encountered

Modified: projects/jpa/trunk/sandbox/src/main/java/org/jboss/jpa/sandbox/remote/RemotelyInjectEntityManagerFactory.java
===================================================================
--- projects/jpa/trunk/sandbox/src/main/java/org/jboss/jpa/sandbox/remote/RemotelyInjectEntityManagerFactory.java	2008-09-10 10:52:23 UTC (rev 78332)
+++ projects/jpa/trunk/sandbox/src/main/java/org/jboss/jpa/sandbox/remote/RemotelyInjectEntityManagerFactory.java	2008-09-10 10:52:48 UTC (rev 78333)
@@ -219,8 +219,10 @@
       Enumeration<URL> e = Thread.currentThread().getContextClassLoader().getResources("META-INF/persistence.xml");
       while(e.hasMoreElements())
          list.add(e.nextElement());
+//      if(list.size() > 1)
+//         throw new RuntimeException("Can't handle more than 1 persistence unit on the class path, found " + list);
       if(list.size() > 1)
-         throw new RuntimeException("Can't handle more than 1 persistence unit on the class path");
+         log.warn("Found multiple persistence units on the classpath, will use the first one of " + list);
       if(list.size() == 0)
          throw new IllegalStateException("Can't find META-INF/persistence.xml");
       URL url = list.get(0);




More information about the jboss-cvs-commits mailing list