MNG-3388: DefaultPluginManager needs to catch LinkageError

o added another catch
o based on r619408

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@619410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vincent Siveton 2008-02-07 13:41:13 +00:00
parent 738cb3016b
commit 621d238877
1 changed files with 42 additions and 2 deletions

View File

@ -581,8 +581,8 @@ public class DefaultPluginManager
if ( getLogger().isFatalErrorEnabled() )
{
getLogger().fatalError(
mojo.getClass().getName() + "#execute() caused a linkage error "
+ "and may be out-of-date. Check the realms:" );
mojo.getClass().getName() + "#execute() caused a linkage error ("
+ e.getClass().getName() + ") and may be out-of-date. Check the realms:" );
StringBuffer sb = new StringBuffer();
sb.append( "Plugin realm = " + pluginRealm.getId() ).append( '\n' );
@ -1290,6 +1290,46 @@ public class DefaultPluginManager
"Unable to retrieve component configurator for plugin configuration",
e );
}
catch ( LinkageError e )
{
if ( getLogger().isFatalErrorEnabled() )
{
getLogger().fatalError(
configurator.getClass().getName() + "#configureComponent(...) caused a linkage error ("
+ e.getClass().getName() + ") and may be out-of-date. Check the realms:" );
ClassRealm pluginRealm = mojoDescriptor.getPluginDescriptor().getClassRealm();
StringBuffer sb = new StringBuffer();
sb.append( "Plugin realm = " + pluginRealm.getId() ).append( '\n' );
for ( int i = 0; i < pluginRealm.getURLs().length; i++ )
{
sb.append( "urls[" + i + "] = " + pluginRealm.getURLs()[i] );
if ( i != ( pluginRealm.getURLs().length - 1 ) )
{
sb.append( '\n' );
}
}
getLogger().fatalError( sb.toString() );
ClassRealm containerRealm = container.getContainerRealm();
sb = new StringBuffer();
sb.append( "Container realm = " + containerRealm.getId() ).append( '\n' );
for ( int i = 0; i < containerRealm.getURLs().length; i++ )
{
sb.append( "urls[" + i + "] = " + containerRealm.getURLs()[i] );
if ( i != ( containerRealm.getURLs().length - 1 ) )
{
sb.append( '\n' );
}
}
getLogger().fatalError( sb.toString() );
}
throw new PluginConfigurationException(
mojoDescriptor.getPluginDescriptor(),
e.getClass().getName() + ": " + e.getMessage(),
new ComponentConfigurationException( e ) );
}
finally
{
if ( configurator != null )