avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: [repost - sorry, urgent] File "null" not found
Date Mon, 14 Jan 2002 11:42:54 GMT
On Mon, Jan 14, 2002 at 12:24:10PM +0100, Jan Stary wrote:
> Hello druzja,
> 
> the following code in ContainerComponent
> (copied from the white paper) ...
> 
> -- cut ----------------
> public void initialize() throws Exception {
> 	DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
> 	Configuration sysConfig = builder.buildFromFile(
> 		"/home/hans/casopis/system.xml");
> 	Configuration roleConfig =
> 		builder.build(this.getClass().getClassLoader().
> 		getResourceAsStream("/home/hans/casopis/roles.xml"));

This might be the problem. A "resource" is a file or class accessible
from a JVM classloader. File resources are searched for relative to
paths listed in the classpath. So unless you have '/' in your classpath,
you won't be able to find '/home/hans//..'.

The code then becomes "builder.build(this.getClass().getClassLoader(),
null);", hence the 'File "null" not found' error.

--Jeff

 
> Why does this happen? Which file can't be found? Or should I provide
> a filename somewhere (and I don't)? All the files mentioned in code
> exist and are readable.
> 
> In fact, I believe it's not related to Avalon...
> 
> Thanks for any ideas
> 
> Jan
> 

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message