openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: svn commit: r1176527 - in /openjpa/branches/1.0.x/openjpa-lib/src/main: java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java resources/org/apache/openjpa/lib/meta/localizer.properties
Date Wed, 28 Sep 2011 19:24:01 GMT
+                        if (_log != null && _log.isTraceEnabled()) {
+
 _log.trace(_loc.get("restore-contextclassloader-failed"));

Shouldn't you also trace the unexpected exception? If this does really
happen, we'll want to know why it failed.

Thanks,
Rick

On Tue, Sep 27, 2011 at 2:00 PM, <jgrassel@apache.org> wrote:

> Author: jgrassel
> Date: Tue Sep 27 19:00:33 2011
> New Revision: 1176527
>
> URL: http://svn.apache.org/viewvc?rev=1176527&view=rev
> Log:
> Revert 'OPENJPA-1993:Deadlock Potential with ORM XML Processing' revision
> 1160278
>
> Modified:
>
>  openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
>
>  openjpa/branches/1.0.x/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties
>
> Modified:
> openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
> URL:
> http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java?rev=1176527&r1=1176526&r2=1176527&view=diff
>
> ==============================================================================
> ---
> openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
> (original)
> +++
> openjpa/branches/1.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLMetaDataParser.java
> Tue Sep 27 19:00:33 2011
> @@ -361,19 +361,14 @@ public abstract class XMLMetaDataParser
>             _sourceName = sourceName;
>             SAXParser parser = null;
>             ClassLoader oldLoader = null;
> -            ClassLoader overrideLoader = null;
> -
> +
>             try {
>                 if (_overrideContextClassloader == true) {
> +
>                     oldLoader = (ClassLoader)
> AccessController.doPrivileged(
>                         J2DoPrivHelper.getContextClassLoaderAction());
> -
> -                    overrideLoader =
> XMLMetaDataParser.class.getClassLoader();
> -
>  AccessController.doPrivileged(J2DoPrivHelper.setContextClassLoaderAction(overrideLoader));
> -
> -                    if (_log != null && _log.isTraceEnabled()) {
> -
>  _log.trace(_loc.get("override-contextclassloader-begin", oldLoader,
> overrideLoader));
> -                    }
> +
>  AccessController.doPrivileged(J2DoPrivHelper.setContextClassLoaderAction(
> +                        XMLMetaDataParser.class.getClassLoader()));
>                 }
>
>                 parser = XMLFactory.getSAXParser(validating, true);
> @@ -407,18 +402,16 @@ public abstract class XMLMetaDataParser
>                 JavaVersions.initCause(ioe, se);
>                 throw ioe;
>             } finally {
> -                if (_overrideContextClassloader == true) {
> +                if (_overrideContextClassloader == true && oldLoader !=
> null) {
>                     // Restore the old ContextClassloader
>                     try {
> -                        if (_log != null && _log.isTraceEnabled()) {
> -
>  _log.trace(_loc.get("override-contextclassloader-end", overrideLoader,
> oldLoader));
> -                        }
>
> AccessController.doPrivileged(J2DoPrivHelper.setContextClassLoaderAction(oldLoader));
>                     } catch (Throwable t) {
> -                        if (_log != null && _log.isWarnEnabled()) {
> -
>  _log.warn(_loc.get("restore-contextclassloader-failed"));
> +                        if (_log != null && _log.isTraceEnabled()) {
> +
>  _log.trace(_loc.get("restore-contextclassloader-failed"));
>                         }
> -                    }
> +                    }
> +
>                 }
>             }
>         } finally {
>
> Modified:
> openjpa/branches/1.0.x/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties
> URL:
> http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties?rev=1176527&r1=1176526&r2=1176527&view=diff
>
> ==============================================================================
> ---
> openjpa/branches/1.0.x/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties
> (original)
> +++
> openjpa/branches/1.0.x/openjpa-lib/src/main/resources/org/apache/openjpa/lib/meta/localizer.properties
> Tue Sep 27 19:00:33 2011
> @@ -25,10 +25,6 @@ cant-diff-elems: Unable to differentiate
>        elements for class arg parsing.  No element can be a complete prefix
> of \
>        another.
>  class-arg: Error extracting class information from "{0}".
> -override-contextclassloader-begin: Overriding thread context classloader \
> -    from "{0}" to "{1}".
> -override-contextclassloader-end: Restoring thread context classloader \
> -    from "{0}" to "{1}".
>  restore-contextclassloader-failed: An error occurred restoring the
> Thread's \
>     context classloader.
>  parse-error: An error was encountered while parsing element "{0}".  Make
> sure \
>
>
>


-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message