From bc7da9765803de2193c5dbb26184981952faf5d5 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Tue, 1 Dec 2009 21:46:29 +0000 Subject: [PATCH] Print class loader when metadata processing fails. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@885955 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/openjpa/jdbc/meta/MappingTool.java | 2 +- .../org/apache/openjpa/jdbc/meta/localizer.properties | 2 +- .../main/java/org/apache/openjpa/enhance/PCEnhancer.java | 6 +++--- .../org/apache/openjpa/enhance/localizer.properties | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java index d9ac176dc..db47db0d7 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java @@ -679,7 +679,7 @@ public class MappingTool if (!validate || cls.isInterface() || repos.getPersistenceAware(cls) != null) return null; - throw new MetaDataException(_loc.get("no-meta", cls)); + throw new MetaDataException(_loc.get("no-meta", cls, cls.getClassLoader())); } /** diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/localizer.properties b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/localizer.properties index 841df94af..d74dfca82 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/localizer.properties +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/localizer.properties @@ -305,7 +305,7 @@ bad-drop: Some of the following mappings may not have been dropped: {0}. \ Undropped mappings will not affect the system. no-drop-meta: The schema for type "{0}" may not be dropped, because its \ mapping could not be parsed. -no-meta: Type "{0}" does not have persistence metadata. +no-meta: Type "{0}" loaded by {1} does not have persistence metadata. bad-bk-file: Could not create a backup file for "{0}". running-all-classes: No targets were given. Running on all classes listed in \ your configuration, or all persistent classes in the classpath if no \ diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java b/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java index 68a0d04a5..845be63ca 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java @@ -503,12 +503,12 @@ public class PCEnhancer { for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].getName().equals(PCTYPE.getName())) { if (_log.isInfoEnabled()) - _log.info(_loc.get("pc-type", _managedType.getType())); + _log.info(_loc.get("pc-type", _managedType.getType(), _managedType.getType().getClassLoader())); return ENHANCE_NONE; } } if (_log.isInfoEnabled()) - _log.info(_loc.get("enhance-start", _managedType.getType())); + _log.info(_loc.get("enhance-start", _managedType.getType(), _managedType.getType().getClassLoader())); configureBCs(); @@ -537,7 +537,7 @@ public class PCEnhancer { } if (_log.isWarnEnabled()) - _log.warn(_loc.get("pers-aware", _managedType.getType())); + _log.warn(_loc.get("pers-aware", _managedType.getType(), _managedType.getType().getClassLoader())); return ENHANCE_AWARE; } catch (OpenJPAException ke) { throw ke; diff --git a/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties b/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties index 6b72c1599..1c73518e9 100644 --- a/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties +++ b/openjpa-kernel/src/main/resources/org/apache/openjpa/enhance/localizer.properties @@ -39,7 +39,7 @@ detach-custom-ser: Type "{0}" is set to detach on serialize, but implements \ detach-custom-extern: Type "{0}" is set to detach on serialize, but implements \ a custom readExternal and/or writeExternal method. You cannot use custom \ serialization with detachment. -enhance-start: Enhancing type "{0}". +enhance-start: Enhancing type "{0}" loaded by {1}. runtime-optimization-disabled: This configuration disallows runtime \ optimization, but the following listed types were not enhanced at build \ time or at class load time with a javaagent: "{0}". @@ -54,8 +54,8 @@ enhance-and-subclass-no-redef-start: Creating subclass for "{0}". \ eagerly instead. redefine-types: Redefining {0} using Java 5 type redefinition. retransform-types: Redefining {0} using Java 6 type retransformation. -pc-type: Type "{0}" is already persistence capable; skipping. -pers-aware: Type "{0}" has no metadata; enhancing as persistence aware. \ +pc-type: Type "{0}" loaded by {1} is already persistence capable; skipping. +pers-aware: Type "{0}" loaded by {1} has no metadata; enhancing as persistence aware. \ If you intended for "{0}" to be persistence-capable, then this means that \ OpenJPA could not find any metadata for "{0}". This can happen if the \ directory containing your metadata is not in your CLASSPATH, or if your \