openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r918110 - in /openjpa/branches/1.3.x/openjpa-persistence/src/main: java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java resources/org/apache/openjpa/persistence/localizer.properties
Date Tue, 02 Mar 2010 16:54:43 GMT
Author: dwoods
Date: Tue Mar  2 16:54:43 2010
New Revision: 918110

URL: http://svn.apache.org/viewvc?rev=918110&view=rev
Log:
OPENJPA-1546 OpenJPA doesn't work as internal JPA inside web applicaion in JBoss AS due to
PersistenceMetaDataFactory trying to parse directories as unparsed XML files.  Original patch
contributed by Dmitri Babaev.

Modified:
    openjpa/branches/1.3.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
    openjpa/branches/1.3.x/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties

Modified: openjpa/branches/1.3.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java?rev=918110&r1=918109&r2=918110&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
(original)
+++ openjpa/branches/1.3.x/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceMetaDataFactory.java
Tue Mar  2 16:54:43 2010
@@ -273,6 +273,13 @@
                 log.trace(
                     _loc.get("map-persistent-types-skipping-non-url", rsrc));
             return;
+        } else if (rsrc.toString().endsWith("/")) {
+            // OPENJPA-1546 If the rsrc URL is a directory it should not be
+            // added to the list of the unparsed XML files
+            if (log.isTraceEnabled())
+                log.trace(
+                    _loc.get("map-persistent-types-skipping-dir", rsrc));
+            return;
         }
 
         if (log.isTraceEnabled())
@@ -282,6 +289,7 @@
         if (_xml == null)
             _xml = new HashMap<URL, Set>();
         _xml.put((URL) rsrc, new HashSet(Arrays.asList(names)));
+
         if (_unparsed == null)
             _unparsed = new HashSet<URL>();
         _unparsed.add((URL) rsrc);

Modified: openjpa/branches/1.3.x/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties?rev=918110&r1=918109&r2=918110&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties
(original)
+++ openjpa/branches/1.3.x/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/localizer.properties
Tue Mar  2 16:54:43 2010
@@ -131,6 +131,8 @@
 map-persistent-types-skipping-class: Skipping persistent type location \
     association for location "{0}" since it is a class, and will not \
     need to be re-parsed later.
+map-persistent-types-skipping-dir: Skipping persistent type location \
+    association for location "{0}" since it is a directory.
 no-setter-for-getter: No setter was found for method {0} in type {1} while \
     searching for persistent properties. This method will be ignored. If you \
     intended for this to be persistent, please add a corresponding setter, \



Mime
View raw message