You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Marcello Marangio <m....@tno.it> on 2007/03/28 17:20:00 UTC

Could not create enough Components to service your request - POP3

Hi all
I am trying to create a distributed locking mechanism for POP3 in james.
What I am trying to do is a very simple table-based mechanism, to lock some
resource in POP3Handler.doPASS and release it in POP3Handler.doQUIT.
At the moment the problem is how to get a valid db connection using Avalon
framework.

What I did is create a default  POP3Handler constructor like this:

 public POP3Handler(){
	try{
1		DefaultComponentManager ss = new DefaultComponentManager();
2		DataSourceSelector ds =(DataSourceSelector)
ss.lookup(DataSourceSelector.ROLE);
3	DataSourceComponent dc = (DataSourceComponent) ds.select("maildb");
4	conn = dc.getConnection();
	}
	catch(Exception e){
.....
	}
}

I get an exception:
	Could not create enough Components to service your request.
Apart from the deprecated object/methods, it doesn't work, because, I guess,
I tried to instantiate the DefaultComponentManager directly.
I copied this code from what I did  while ago, to get a valid db connection
into a mailet, where the line 1 originally was:

DefaultComponentManager cm =
DefaultComponentManager)getMailetContext().getAttribute(Constants.AVALON_COM
PONENT_MANAGER);
 
And it worked.

I am pretty newbie of Avalon, but how can I get a proper instance of the
DefaultComponentManager?

Any help is really appreciated.

Thanks

-------------------------------
Marcello


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Resending Failed Messages

Posted by Hans Liebenberg <ha...@cambrient.com>.
Hi,

I have a whole bunch of messages in my "Address-error" folder that 
landed up there due to a misconfiguration. I have fixed the config but 
now need to spool those messages.
What is the best way to do this?

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org