openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r888476 - in /openjpa/trunk/openjpa-kernel/src/main: java/org/apache/openjpa/meta/MetaDataRepository.java resources/org/apache/openjpa/meta/localizer.properties
Date Tue, 08 Dec 2009 16:38:21 GMT
Author: ppoddar
Date: Tue Dec  8 16:38:20 2009
New Revision: 888476

URL: http://svn.apache.org/viewvc?rev=888476&view=rev
Log:
Print class loader when metadata processing fails

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
    openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java?rev=888476&r1=888475&r2=888476&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataRepository.java
Tue Dec  8 16:38:20 2009
@@ -401,7 +401,7 @@
 
             // if cls is a generated interface, use the user interface
             // to locate metadata
-            if (cls != null && _implGen.isImplType(cls))
+            if (cls != null && _implGen != null && _implGen.isImplType(cls))
                 cls = _implGen.toManagedInterface(cls);
 
             ClassMetaData meta = getMetaDataInternal(cls, envLoader);
@@ -1473,9 +1473,9 @@
         } catch (Exception e) {
             if ((_validate & VALIDATE_RUNTIME) != 0) {
                 if (_log.isWarnEnabled())
-                    _log.warn(_loc.get("bad-discover-class", name));
+                    _log.warn(_loc.get("bad-discover-class", name, loader));
             } else if (_log.isInfoEnabled())
-                _log.info(_loc.get("bad-discover-class", name));
+                _log.info(_loc.get("bad-discover-class", name, loader));
             if (_log.isTraceEnabled())
                 _log.trace(e);
         } catch (NoSuchMethodError nsme) {
@@ -1487,9 +1487,9 @@
             // probably just means that the class is not yet enhanced.
             if ((_validate & VALIDATE_RUNTIME) != 0) {
                 if (_log.isWarnEnabled())
-                    _log.warn(_loc.get("bad-discover-class", name));
+                    _log.warn(_loc.get("bad-discover-class", name, loader));
             } else if (_log.isInfoEnabled())
-                _log.info(_loc.get("bad-discover-class", name));
+                _log.info(_loc.get("bad-discover-class", name, loader));
             if (_log.isTraceEnabled())
                 _log.trace(nsme);
         }
@@ -1657,9 +1657,14 @@
      * 
      */
     void registerAlias(Class<?> cls) {
+        registerAlias(PCRegistry.getTypeAlias(cls), cls);
+    }
+    
+    public void registerAlias(String alias, Class<?> cls) {
+        if (alias == null)
+            return;
         try {
             lock();
-            String alias = PCRegistry.getTypeAlias(cls);
             if (alias != null) {
                 List<Class<?>> classes = _aliases.get(alias);
                 if (classes == null)

Modified: openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties?rev=888476&r1=888475&r2=888476&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/resources/org/apache/openjpa/meta/localizer.properties
Tue Dec  8 16:38:20 2009
@@ -54,7 +54,7 @@
 unmanaged-sup-field: Superclass field "{0}" is mapped in the metadata for \
 	subclass "{1}", but is not a persistent field.
 bad-discover-class: The class "{0}" listed in the openjpa.MetaDataFactory \
-	configuration property could not be loaded; ignoring.
+	configuration property could not be loaded by {1}; ignoring.
 bad-lrs-concrete: Large result set fields must be of type java.util.Collection \
 	or java.util.Map.  No concrete classes or other interfaces are allowed. \
 	Remove the "lrs" extension from field "{0}" or change it to one of \



Mime
View raw message