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 5ef37c7a9..040656ac0 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 @@ -3639,6 +3639,10 @@ public class PCEnhancer { if (args.length == 0) { log.info(_loc.get("running-all-classes")); classes = repos.getPersistentTypeNames(true, loader); + if (classes == null) { + log.warn(_loc.get("no-class-to-enhance")); + return false; + } } else { ClassArgParser cap = conf.getMetaDataRepositoryInstance(). getMetaDataFactory().newClassArgParser(); @@ -3647,7 +3651,7 @@ public class PCEnhancer { for (int i = 0; i < args.length; i++) classes.addAll(Arrays.asList(cap.parseTypes(args[i]))); } - + Project project = new Project(); BCClass bc; PCEnhancer enhancer; 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 c20aeb60a..e2d44ded9 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 @@ -30,6 +30,7 @@ running-all-classes: No targets were given. Running on all classes in your \ persistent classes list, or all metadata files in classpath directories if \ you have not listed your persistent classes. Use -help to display tool \ usage information. +no-class-to-enhance: Found no class to enhance. detach-custom-ser: Type "{0}" is set to detach on serialize, but implements \ a custom readObject and/or writeObject method. You cannot use custom \ serialization with detachment.