-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HV-1950 Suppress java.lang.NoClassDefFoundError: com/sun/el/Expressio…
…nFactoryImpl It will mislead user that hibernate validator will rely on particular EL implementation.
- Loading branch information
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
* @author Kevin Pollet <[email protected]> (C) 2011 SERLI | ||
* @author Adam Stawicki | ||
* @author Guillaume Smet | ||
* @author Yanming Zhou | ||
*/ | ||
public class ResourceBundleMessageInterpolator extends AbstractMessageInterpolator { | ||
|
||
|
@@ -200,11 +201,16 @@ private static ExpressionFactory buildExpressionFactory() { | |
|
||
// Finally we try the CL of the EL implementation itself. This is necessary for OSGi now that the | ||
// implementation is separated from the API. | ||
run( SetContextClassLoader.action( ExpressionFactoryImpl.class.getClassLoader() ) ); | ||
if ( canLoadExpressionFactory() ) { | ||
ExpressionFactory expressionFactory = ELManager.getExpressionFactory(); | ||
LOG.debug( "Loaded expression factory via com.sun.el classloader" ); | ||
return expressionFactory; | ||
try { | ||
run( SetContextClassLoader.action( ExpressionFactoryImpl.class.getClassLoader() ) ); | ||
if ( canLoadExpressionFactory() ) { | ||
ExpressionFactory expressionFactory = ELManager.getExpressionFactory(); | ||
LOG.debug( "Loaded expression factory via com.sun.el classloader" ); | ||
return expressionFactory; | ||
} | ||
} | ||
catch (NoClassDefFoundError err) { | ||
// ignore | ||
} | ||
} | ||
catch (Throwable e) { | ||
|