catch (ClassNotFoundException cnfe )
{
String err = "The specified class for ResourceManager (" + rm
+ ") does not exist or is not accessible to the current classloader.";
log.error(err);
throw new VelocityException(err, cnfe);
}
catch (InstantiationException ie)
{
throw new VelocityException("Could not instantiate class '" + rm + "'", ie);
}
catch (IllegalAccessException ae)
{
throw new VelocityException("Cannot access class '" + rm + "'", ae);
}
if (!(o instanceof ResourceManager))
{
String err = "The specified class for ResourceManager (" + rm
+ ") does not implement " + ResourceManager.class.getName()
+ "; Velocity is not initialized correctly.";
log.error(err);
throw new VelocityException(err);
}
resourceManager = (ResourceManager) o;
resourceManager.initialize(this);
}
else
{
/*
* someone screwed up. Lets not fool around...
*/
String err = "It appears that no class was specified as the"
+ " ResourceManager. Please ensure that all configuration"
+ " information is correct.";
log.error(err);
throw new VelocityException( err );
}
}