From 8fb7ca2b5b1777fcf96e123368ba3f4c31da6cb5 Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Wed, 11 Jun 2008 23:21:46 +0000 Subject: [PATCH] Backported r651121 to trunk. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@666891 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/conf/CacheMarshallerImpl.java | 4 ++-- .../openjpa/conf/MetaDataCacheMaintenance.java | 13 +++++++++---- .../org/apache/openjpa/conf/localizer.properties | 9 ++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java index 099f3691c..ed18cfc4b 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java @@ -89,11 +89,11 @@ public class CacheMarshallerImpl } catch (Exception e) { if (_consumeErrors) { if (_log.isWarnEnabled()) - _log.warn(_loc.get("cache-marshaller-load-exception", + _log.warn(_loc.get("cache-marshaller-load-exception-ignore", _inputURL), e); } else { throw new InternalException( - _loc.get("cache-marshaller-load-exception", + _loc.get("cache-marshaller-load-exception-fatal", _inputURL), e); } diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java index 1f6fa4088..6762bd961 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java @@ -28,6 +28,8 @@ import org.apache.openjpa.kernel.BrokerFactory; import org.apache.openjpa.kernel.Query; import org.apache.openjpa.lib.util.Options; import org.apache.openjpa.lib.log.Log; +import org.apache.openjpa.lib.conf.MapConfigurationProvider; +import org.apache.openjpa.lib.conf.ConfigurationProvider; import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.MetaDataRepository; import org.apache.openjpa.meta.QueryMetaData; @@ -52,13 +54,16 @@ public class MetaDataCacheMaintenance { boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath", true); - BrokerFactory factory = Bootstrap.newBrokerFactory(); + ConfigurationProvider cp = new MapConfigurationProvider(opts); + BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null); try { MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance( factory, devpath); - if (args.length != 1) + if (args.length != 1) { usage(); + return; + } if ("store".equals(args[0])) maint.store(); @@ -97,8 +102,8 @@ public class MetaDataCacheMaintenance { } private static int usage() { - System.err.println("Usage: java MetaDataCacheMaintenance " - + "[-scanDevPath t|f] store | dump"); + System.err.println("Usage: java MetaDataCacheMaintenance " + + "[-scanDevPath t|f] [- value] store | dump"); return -1; } diff --git a/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties b/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties index b300755dc..377f5e993 100644 --- a/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties +++ b/openjpa-kernel/src/main/resources/org/apache/openjpa/conf/localizer.properties @@ -556,9 +556,12 @@ diff-specs: Attempt to configure for multiple specifications. Was configured \ cache-marshaller-loaded: Loaded cached data of type {0} from file {1}. cache-marshaller-no-inputs: No InputURL or InputResource was specified for \ CacheMarshaller {0}. Cannot load data if no input was specified. -cache-marshaller-load-exception: An error occurred while loading cached data \ - from {0}. The exception is logged with this message; it will be consumed \ - and ignored. +cache-marshaller-load-exception-ignore: An error occurred while loading cached \ + data from {0}. The exception is logged with this message; it will be \ + consumed and ignored. +cache-marshaller-load-exception-fatal: An error occurred while loading cached \ + data from {0}. The exception is logged with this message; it will be \ + thrown. cache-marshaller-stored: Stored data of type {0} to file {1}. cache-marshaller-no-output-file: No OutputFile was specified for \ CacheMarshaller {0}. Cannot store data if no output was specified.