FWIW, I did read own response to Jason Webb, who ran into the same problem
on Monday with NNTP. Updating the .xinfo file fixed the Component Manager
issue, but I still needed to move the code into an initialize() method.
Both of those changes fixed it. :-)
--- Noel
q.v. http://www.mail-archive.com/[email protected]/msg03051.html
-----Original Message-----
From: Noel J. Bergman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 19:00
To: James-Dev Mailing List
Subject: Fun with component manager
I added this:
// make our "helloName" available through the MailetContext
MailetContext mailetcontext =
(MailetContext)
componentManager.lookup("org.apache.mailet.MailetContext");
mailetcontext.setAttribute(Constants.HELLO_NAME, this.helloName);
to SMTPHandler.compose(). I added this to james-assembly.xml:
<provide name="James" role="org.apache.mailet.MailetContext"/>
in the SMTPServer block. The other componentManager.lookup() calls work,
but when I make this change, now I get:
20/08/02 06:20:57 ERROR connections: Exception executing runner
org.apache.avalon.framework.component.ComponentException: Unable to provide
implementation.
at
org.apache.avalon.framework.component.DefaultComponentManager.lookup(Default
ComponentManager.java:71)
at
org.apache.james.smtpserver.SMTPHandler.compose(SMTPHandler.java:156)
at
org.apache.avalon.cornerstone.services.connection.AbstractHandlerFactory.cre
ateConnectionHandler(AbstractHandlerFactory.java:72)
at
org.apache.avalon.cornerstone.blocks.connection.Connection.run(Connection.ja
va:93)
at
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Executabl
eRunnable.java:47)
at
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:8
0)
What am I missing? I copied the both sections of code from the
JamesSpoolManager sections, so if it works in one place, why not in the
other? The only difference I see is that the spooler calls it in the
initialize() method, instead of compose. Mind you, SMTPHandler calls all of
the others in compose, and MailServer and MailetContext are the same object,
so ...
BTW, it would be nice if the code threw the exception with descriptive
content ... you know, a little thing like THE DATA THAT CAUSED THE FAILURE
... [Some nice Avalon developer, please fix it, thank you. :-)]
--- Noel
P.S. While I wait for someone to tell me what I'm doing wrong, I'm adding
Initializable to the interface so that I can call it then, to see if that
works.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>