From a92418ddd6d486cff60d3c377dda16149ca2297c Mon Sep 17 00:00:00 2001 From: Michael Dick Date: Fri, 28 Sep 2007 17:13:41 +0000 Subject: [PATCH] OPENJPA-388 git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@580426 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/ant/MappingToolTask.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java index 6706229a5..196033656 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/MappingToolTask.java @@ -176,7 +176,10 @@ public class MappingToolTask if (MappingTool.ACTION_IMPORT.equals(flags.action)) assertFiles(files); - ClassLoader loader = getClassLoader(); + ClassLoader loader = + (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper + .newTemporaryClassLoaderAction(getClassLoader())); + if (flags.meta && MappingTool.ACTION_ADD.equals(flags.action)) flags.metaDataFile = Files.getFile(file, loader); else @@ -190,7 +193,7 @@ public class MappingToolTask J2DoPrivHelper.getClassLoaderAction(MappingTool.class))); JDBCConfiguration conf = (JDBCConfiguration) getConfiguration(); conf.setClassResolver(resolver); - + if (!MappingTool.run(conf, files, flags, loader)) throw new BuildException(_loc.get("bad-conf", "MappingToolTask") .getMessage());