private void loadMapper(Configuration configuration, String mapperName) {
InputStream input = null;
try {
input = getClass().getResourceAsStream("/" + mapperName.replace('.', '/') + ".xml");
new XMLMapperBuilder(input, configuration, mapperName, configuration.getSqlFragments()).parse();
configuration.addLoadedResource(mapperName);
} catch (Exception e) {
throw new IllegalArgumentException("Unable to load mapper " + mapperName, e);
} finally {
Closeables.closeQuietly(input);