tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1032856 - /openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
Date Tue, 09 Nov 2010 06:06:25 GMT
Author: dblevins
Date: Tue Nov  9 06:06:25 2010
New Revision: 1032856

URL: http://svn.apache.org/viewvc?rev=1032856&view=rev
Log:
OPENEJB-1371: Double encoding of persistence-unit root-url leads to issues in paths with spaces

Modified:
    openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java

Modified: openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1032856&r1=1032855&r2=1032856&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
(original)
+++ openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
Tue Nov  9 06:06:25 2010
@@ -92,9 +92,15 @@ public class ReadDescriptors implements 
         if (persistenceUrls != null) {
             for (URL persistenceUrl : persistenceUrls) {
 
-                final String path = URLs.toFilePath(persistenceUrl);
-                String moduleName = path.replaceFirst("/?META-INF/.*persistence.xml$", "/");
+                File file = URLs.toFile(persistenceUrl);
+                final String path = file.getAbsolutePath();
 
+                if (file.getName().endsWith("persistence.xml")) {
+                    file = file.getParentFile().getParentFile();
+                }
+                String moduleName = file.getAbsolutePath();
+                
+                System.out.println("FOO moduleName = " + moduleName);
                 try {
                     Persistence persistence = JaxbPersistenceFactory.getPersistence(persistenceUrl);
                     PersistenceModule persistenceModule = new PersistenceModule(moduleName,
persistence);



Mime
View raw message