TOMEE-1580 correct computing of jarFilesUrl
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java b/container/openejb-core/src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java
index 5883af4..c849ad6 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/persistence/PersistenceUnitInfoImpl.java
@@ -250,11 +250,17 @@
 
         this.persistenceUnitRootUrl = toUrl(root);
         try {
+            if (!jarFiles.isEmpty()) {
+                final File tmpRoot;
+                if (root.getName().endsWith(".jar")) {
+                    tmpRoot = root.getParentFile(); // lib for a war, / of the ear otherwise, no sense in other cases
+                } else {
+                    tmpRoot = root;
+                }
 
-            for (final String path : jarFiles) {
-                File file = new File(root, path);
-                file = file.getCanonicalFile();
-                jarFileUrls.add(toUrl(file));
+                for (final String path : jarFiles) {
+                    jarFileUrls.add(toUrl(new File(tmpRoot, path).getCanonicalFile()));
+                }
             }
         } catch (final IOException e) {
             throw new IllegalStateException(e);