avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Stary <jsta6...@artax.karlin.mff.cuni.cz>
Subject Re: ExcaliburComponentManager.configure() throws NUllPointerException
Date Fri, 11 Jan 2002 10:26:45 GMT
Thanks! continuing ...

:> public void initialize() throws Exception {
:> 	DefaultConfigurationBuilder builder = new
:> 	DefaultConfigurationBuilder();
:> 	Configuration sysConfig = builder.buildFromFile(
:> 		"/home/hans/casopis/system.xml");
:> 
:> 	this.manager.contextualize(new DefaultContext());
:> 	this.manager.configure(sysConfig);
:> 	this.manager.initialize();
:> }
:
:
:The ExcaliburComponentManager is Loggable, and the configure() method uses the
:logger that was supposed to be given to it.
:Before contextualize() you should have done this:
:this.manager.setLogger( getLogger() );
:Of course, that assumes you have already set up your LogKit Logger.

Now my container.initialize() looks like this: 
(as in DwAA)

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/document.roles"));
	DefaultRoleManager roles = new DefaultRoleManager();
	roles.enableLogging(Hierarchy.getDefaultHierarchy().getLoggerFor(
		"/home/hans/casopis/document.roles"));
	roles.configure(roleConfig);

	this.manager.setLogger(Hierarchy.getDefaultHierarchy().
		getLoggerFor("document"));
	this.manager.contextualize(new DefaultContext());
	this.manager.setRoleManager(roles);
	this.manager.configure(sysConfig);
	this.manager.initialize();
}

but when compiling it says


[javac] /home/hans/casopis/src/org/apache/bizserver/docs/ContainerComponent.java:25: cannot
resolve symbol
[javac] symbol  : method enableLogging  (org.apache.log.Logger)
[javac] location: class org.apache.avalon.excalibur.component.DefaultRoleManager
[javac] 		roles.enableLogging(Hierarchy.getDefaultHierarchy().getLoggerFor(
[javac]                      ^
[javac] 1 error


I suppose I don't "have already set up my LogKit Logger" - how do I do that,
please?

Does this have something to do with the fact that I do
this.manager.setLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("document"));
instead of
this.manager.setLogger( getLogger() );
?

Thanks again

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