Hi
This is the implementation of addResource(). so you must add your mapping files to project classpath or global classpath.
Code:
public Configuration addResource(String resourceName) throws MappingException {
log.info( "Reading mappings from resource : " + resourceName );
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
InputStream rsrc = null;
if (contextClassLoader!=null) {
rsrc = contextClassLoader.getResourceAsStream( resourceName );
}
if ( rsrc == null ) {
rsrc = Environment.class.getClassLoader().getResourceAsStream( resourceName );
}
if ( rsrc == null ) {
throw new MappingNotFoundException( "resource", resourceName );
}
try {
return addInputStream( rsrc );
}
catch (MappingException me) {
throw new InvalidMappingException( "resource", resourceName, me );
}
}
Amila
(Don't forget to rate if helps)