I mistakenly believed that updating the connector would fix all my
woes. Lo' & behold the error occurs when the server is under load.
When the messages approach >400 msgs/min. I continue to get the same
error in the Connections log:
20/06/05 16:36:43 ERROR connections: Exception executing client
connection runner: Could not create enough Components to service
your request.
java.lang.Exception: Could not create enough Components to service
your request.
at
org.apache.avalon.excalibur.pool.DefaultPool.get(DefaultPool.java:133)
at
org.apache.james.util.connection.ServerConnection.addClientConnectionRunner(ServerConnection.java:215)
at
org.apache.james.util.connection.ServerConnection.run(ServerConnection.java:304)
at
org.apache.james.util.thread.ExecutableRunnable.execute(ExecutableRunnable.java:55)
at
org.apache.james.util.thread.WorkerThread.run(WorkerThread.java:90)
MySql is on the same box.
Messages are being directed to the deadletter repository with the error:
Exception caught while storing mail Container: java.io.IOException:
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection,
pool exhausted
Any help would be greatly appreciated.
Here is my config file:
--- Begin---
<?xml version="1.0"?>
<!DOCTYPE config [
<!ENTITY listserverConfig SYSTEM "../conf/james-listmanager.xml">
<!ENTITY listserverStores SYSTEM "../conf/james-liststores.xml">
<!ENTITY fetchmailConfig SYSTEM "../conf/james-fetchmail.xml">
]>
<config>
<James>
<postmaster>[EMAIL PROTECTED]</postmaster>
<servernames autodetect="true" autodetectIP="true">
<!-- CONFIRM? -->
<servername>test.com</servername>
</servernames>
<!-- Set whether user names are case sensitive or case insensitive -->
<!-- Set whether to enable local aliases -->
<!-- Set whether to enable forwarding -->
<usernames ignoreCase="true" enableAliases="true"
enableForwarding="true"/>
<!-- The inbox repository is the location for users inboxes -->
<!-- Default setting: file based repository - enter path ( use
"file:///" for absolute) -->
<!--
<inboxRepository>
<repository destinationURL="file://var/mail/inboxes/" type="MAIL"/>
</inboxRepository>
-->
<inboxRepository>
<repository destinationURL="db://maildb/inbox/" type="MAIL"/>
</inboxRepository>
<!-- Alternative inbox repository definition for DB use. -->
<!-- Stores message body in file system, rest in database -->
<!--
<inboxRepository>
<repository destinationURL="dbfile://maildb/inbox/" type="MAIL"/>
</inboxRepository>
-->
<!--
<inboxRepository>
<repository destinationURL="mbox:///var/mail/" type="MAIL"/>
</inboxRepository>
-->
</James>
<fetchpop enabled="false">
<!-- You can have as many fetch tasks as you want, but each must
have a -->
<!-- unique name by which it identified -->
<fetch name="mydomain.com">
<!-- Host name or IP address -->
<host>mail.mydomain.com</host>
<!-- Account login username -->
<user>username</user>
<!-- Account login password -->
<password>pass</password>
<!-- How frequently this account is checked - in
milliseconds. 600000 is every ten minutes -->
<interval>600000</interval>
</fetch>
</fetchpop>
&fetchmailConfig;
<!-- The James Spool Manager block -->
<!-- -->
<!-- This block is responsible for processing messages on the spool. -->
<spoolmanager>
<!-- Number of spool threads -->
<threads> 100 </threads>
<!-- Set the Java packages from which to load mailets and matchers -->
<mailetpackages>
<mailetpackage>org.apache.james.transport.mailets</mailetpackage>
</mailetpackages>
<matcherpackages>
<matcherpackage>org.apache.james.transport.matchers</matcherpackage>
</matcherpackages>
<!-- The root processor is a required processor - James routes all
mail on the spool -->
<!-- through this processor first. -->
<!-- -->
<!-- This configuration is a sample configuration for the root
processor. -->
<processor name="root">
<!-- Checks that the email Sender is associated with a valid
domain. -->
<!--
<mailet
match="SenderInFakeDomain=64.55.105.9,64.94.110.11,194.205.62.122,194.205.62.62,195.7.77.20,206.253.214.102,212.181.91.6,219.88.106.80,194.205.62.42,216.35.187.246,203.119.4.6"
class="ToProcessor">
<processor> spam </processor>
</mailet>
-->
<!-- Important check to avoid looping -->
<mailet match="RelayLimit=30" class="Null"/>
<!--
<mailet match="All" class="XMLVirtualUserTable">
<!- 1:1 mapping ->
<mapping>[EMAIL PROTECTED]@mordor</mapping>
<!- 1:n mapping ->
<mapping>[EMAIL PROTECTED]@isengard;radigast;gandalf</mapping>
<!- DSN mapping ->
<mapping>[EMAIL PROTECTED]:550 Requested action not
taken: no such user here</mapping>
<!- regex based mapping ->
<mapping>[EMAIL PROTECTED]:(.*)@osgilliath:[EMAIL PROTECTED]</mapping>
<!- both standard and regex mapping ->
<mapping>[EMAIL PROTECTED]@mordor;regex:ring@(.*):[EMAIL PROTECTED]</mapping>
<!- conditional regex mapping example ->
<mapping>[EMAIL PROTECTED]:(.*)[EMAIL PROTECTED]:[EMAIL PROTECTED];
regex:(.*)[EMAIL PROTECTED]:[EMAIL PROTECTED]
</mapping>
</mailet>
-->
<!-- White List: -->
<!-- specific known senders -->
<!--
<mailet match="[EMAIL PROTECTED]"
class="ToProcessor">
<processor> transport </processor>
</mailet>
-->
<!-- People on this list agree to pay a penalty if they send
spam -->
<mailet match="InSpammerBlacklist=query.bondedsender.org"
class="ToProcessor">
<processor> transport </processor>
</mailet>
<!-- E-mail legally required not to be spam (see:
http://www.habeas.com) -->
<!--
<mailet match="HasHabeasWarrantMark" class="ToProcessor">
<processor> transport </processor>
</mailet>
-->
<!-- End of White List -->
<!-- Check for delivery from a known spam server -->
<mailet match="InSpammerBlacklist=dnsbl.njabl.org"
class="ToProcessor">
<processor> spam </processor>
<notice>550 Requested action not taken: rejected - see
http://njabl.org/ </notice>
</mailet>
<mailet match="InSpammerBlacklist=relays.ordb.org"
class="ToProcessor">
<processor> spam </processor>
<notice>550 Requested action not taken: rejected - see
http://www.ordb.org/ </notice>
</mailet>
<!-- Sample matching to kill a message (send to Null) -->
<!--
<mailet match="[EMAIL PROTECTED]" class="Null"/>
-->
<!-- Send remaining mails to the transport processor for either
local or remote delivery -->
<mailet match="All" class="ToProcessor">
<processor> transport </processor>
</mailet>
</processor>
<!-- The error processor is required. James may internally set
emails to the -->
<!-- error state. The error processor is generally invoked when
there is an -->
<!-- unexpected error either in the mailet chain or internal to
James. -->
<!-- -->
<!-- By default configuration all email that generates an error in
placed in -->
<!-- an error repository. -->
<processor name="error">
<!-- If you want to notify the sender their message generated
an error, uncomment this -->
<!--
<mailet match="All" class="Bounce"/>
-->
<!-- If you want to notify the postmaster that a message
generated an error, uncomment this -->
<!--
<mailet match="All" class="NotifyPostmaster"/>
-->
<!-- Logs any messages to the repository specified -->
<mailet match="All" class="ToRepository">
<!--
<repositoryPath> file://var/mail/error/</repositoryPath>
-->
<!-- An alternative database repository example follows. -->
<repositoryPath> db://maildb/deadletter/error </repositoryPath>
</mailet>
</processor>
<!-- Processor CONFIGURATION SAMPLE: transport is a sample custom
processor for local or -->
<!-- remote delivery -->
<processor name="transport">
<!-- This is an example configuration including configuration
for a list server. -->
<!-- CHECKME: before uncommenting this, edit the configuration
file's contents -->
<!--
&listserverConfig;
-->
<mailet match="HostIsLocal" class="ToProcessor">
<processor> local-address-error </processor>
<notice>550 - Requested action not taken: no such user
here</notice>
</mailet>
<!-- CHECKME! -->
<mailet match="RemoteAddrNotInNetwork=127.0.0.1"
class="ToProcessor">
<processor> relay-denied </processor>
<notice>550 - Requested action not taken: relaying
denied</notice>
</mailet>
<!-- Attempt remote delivery using the specified repository for
the spool, -->
<!-- using delay time to retry delivery and the maximum number
of retries -->
<mailet match="All" class="RemoteDelivery">
<!-- <outgoing> file://var/mail/outgoing/ </outgoing> -->
<!-- alternative database repository example below -->
<outgoing> db://maildb/spool/outgoing </outgoing>
<!-- Delivery Schedule based upon RFC 2821, 4.5.4.1 -->
<!-- 5 day retry period, with 4 attempts in the first
hour, two more within the first 6 hours, and then
every 6 hours for the rest of the period. -->
<delayTime> 5 minutes </delayTime>
<delayTime> 10 minutes </delayTime>
<delayTime> 45 minutes </delayTime>
<maxRetries> 3 </maxRetries>
<!-- The number of threads that should be trying to deliver
outgoing messages -->
<deliveryThreads> 30 </deliveryThreads>
<!-- If false the message will not be sent to given server
if any recipients fail -->
<sendpartial>false</sendpartial>
<!--
<gateway> 127.0.0.1 </gateway>
<gatewayPort>25</gatewayPort>
-->
</mailet>
</processor>
<!-- Processor CONFIGURATION SAMPLE: spam is a sample custom
processor for handling -->
<!-- spam. -->
<!-- You can either log these, bounce these, or just ignore them. -->
<processor name="spam">
<!-- To destroy all messages, uncomment this matcher/mailet
configuration -->
<mailet match="All" class="Null"/>
<!-- To notify the sender their message was marked as spam,
uncomment this matcher/mailet configuration -->
<!--
<mailet match="All" class="Bounce"/>
-->
<!-- To notify the postmaster that a message was marked as
spam, uncomment this matcher/mailet configuration -->
<!--
<mailet match="All" class="NotifyPostmaster"/>
-->
<!-- To log the message to a repository, this matcher/mailet
configuration should be uncommented. -->
<!-- This is the default configuration. -->
<mailet match="All" class="ToRepository">
<!-- <repositoryPath>file://var/mail/spam/</repositoryPath> -->
<!-- Changing the repositoryPath, as in this commented out
example, will -->
<!-- cause the mails to be stored in a database repository. -->
<!-- Please note that only one repositoryPath element can be
present for the mailet -->
<!-- configuration. -->
<repositoryPath> db://maildb/deadletter/spam
</repositoryPath>
</mailet>
</processor>
<!-- This processor handles messages that are for local domains,
where the user is unknown -->
<processor name="local-address-error">
<!--
<mailet match="All" class="Bounce">
<attachment>none</attachment>
</mailet>
-->
<!-- To notify the postmaster that a message had an invalid
address, uncomment this matcher/mailet configuration -->
<!--
<mailet match="All" class="NotifyPostmaster"/>
-->
<mailet match="All" class="ToRepository">
<!-- <repositoryPath>
file://var/mail/address-error/</repositoryPath> -->
<!-- An alternative database repository example follows. -->
<repositoryPath> db://maildb/deadletter/address-error
</repositoryPath>
</mailet>
</processor>
<processor name="relay-denied">
<!-- To notify the sender the address was invalid, uncomment
this matcher/mailet configuration -->
<!-- The original message is not attached to keep the bounce
processor from deliverying spam -->
<!--
<mailet match="All" class="Bounce">
<attachment>none</attachment>
</mailet>
-->
<!-- To notify the postmaster that a relay request was denied,
uncomment this matcher/mailet configuration -->
<!--
<mailet match="All" class="NotifyPostmaster"/>
-->
<mailet match="All" class="ToRepository">
<!--
<repositoryPath>file://var/mail/relay-denied/</repositoryPath> -->
<!-- An alternative database repository example follows. -->
<repositoryPath> db://maildb/deadletter/relay-denied
</repositoryPath>
</mailet>
</processor>
</spoolmanager>
<!-- DNS Server Block -->
<dnsserver>
<servers>
<!--Enter ip address of your DNS server, one IP address per
server -->
<!-- element. -->
<!--
<server>127.0.0.1</server>
-->
</servers>
<!-- Change autodiscover to false if you would like to turn off
autodiscovery -->
<!-- and set the DNS servers manually in the <servers> section -->
<autodiscover>true</autodiscover>
<authoritative>false</authoritative>
</dnsserver>
<remotemanager>
<port>4555</port>
<!-- Uncomment this if you want to bind to a specific inetaddress -->
<!--
<bind> </bind>
-->
<!-- Uncomment this if you want to use TLS (SSL) on this port -->
<!--
<useTLS>true</useTLS>
-->
<handler>
<helloName autodetect="true">myMailServer</helloName>
<administrator_accounts>
<!-- CHECKME! -->
<!-- Change the default login/password. -->
<account login="***" password="***"/>
</administrator_accounts>
<connectiontimeout> 60000 </connectiontimeout>
</handler>
</remotemanager>
<!-- The POP3 server is enabled by default -->
<pop3server enabled="true">
<!-- port 995 is the well-known/IANA registered port for POP3S ie
over SSL/TLS -->
<!-- port 110 is the well-known/IANA registered port for Standard
POP3 -->
<port>110</port>
<!-- Uncomment this if you want to bind to a specific inetaddress -->
<!--
<bind> </bind>
-->
<!-- Uncomment this if you want to use TLS (SSL) on this port -->
<!--
<useTLS>true</useTLS>
-->
<handler>
<helloName autodetect="true">myMailServer</helloName>
<connectiontimeout>120000</connectiontimeout>
</handler>
</pop3server>
<!-- The SMTP server is enabled by default -->
<smtpserver enabled="true">
<!-- port 25 is the well-known/IANA registered port for SMTP -->
<port>25</port>
<!-- Uncomment this if you want to bind to a specific inetaddress -->
<!--
<bind> </bind>
-->
<!-- Uncomment this if you want to use TLS (SSL) on this port -->
<!--
<useTLS>true</useTLS>
-->
<handler>
<helloName autodetect="false">xpMailer</helloName>
<connectiontimeout>36000</connectiontimeout>
<!-- Uncomment this if you want to require SMTP
authentication. -->
<!--
<authRequired>true</authRequired>
-->
<!-- CHECKME! -->
<authorizedAddresses>127.0.0.0/8,
192.168.0.0/24</authorizedAddresses>
<!-- Uncomment this if you want to verify sender addresses,
ensuring that -->
<!-- the sender address matches the user who has
authenticated. -->
<!-- This prevents a user of your mail server from acting as
someone else -->
<!--
<verifyIdentity>true</verifyIdentity>
-->
<!-- This sets the maximum allowed message size (in kilobytes)
for this -->
<!-- SMTP service. If unspecified, the value defaults to 0,
which means no limit. -->
<maxmessagesize>0</maxmessagesize>
</handler>
</smtpserver>
<!-- The NNTP server is enabled by default -->
<nntpserver enabled="false">
<port>119</port>
<!-- Uncomment this if you want to bind to a specific inetaddress -->
<!--
<bind> </bind>
-->
<!-- Uncomment this if you want to use TLS (SSL) on this port -->
<!--
<useTLS>true</useTLS>
-->
<handler>
<!-- This is the name used by the server to identify itself in
the NNTP -->
<!-- protocol. If autodetect is TRUE, the server will discover
its -->
<!-- own host name and use that in the protocol. If discovery
fails, -->
<!-- the value of 'localhost' is used. If autodetect is FALSE,
James -->
<!-- will use the specified value. -->
<helloName autodetect="true">myMailServer</helloName>
<connectiontimeout>120000</connectiontimeout>
<!-- Set the authRequired value to true to enable
authenticated NNTP -->
<authRequired>false</authRequired>
</handler>
</nntpserver>
<nntp-repository>
<!-- If this is set to true, posting will be disallowed. -->
<readOnly>false</readOnly>
<rootPath>file://var/nntp/groups</rootPath>
<tempPath>file://var/nntp/temp</tempPath>
<articleIDPath>file://var/nntp/articleid</articleIDPath>
<articleIDDomainSuffix>news.james.apache.org</articleIDDomainSuffix>
<!-- The news groups hosted in this NNTP repository. -->
<newsgroups>
<newsgroup>org.apache.james.dev</newsgroup>
<newsgroup>org.apache.james.user</newsgroup>
<newsgroup>org.apache.avalon.dev</newsgroup>
<newsgroup>org.apache.avalon.user</newsgroup>
</newsgroups>
<spool>
<configuration>
<spoolPath>file://var/nntp/spool</spoolPath>
<!-- The number of threads that process spooler related
tasks. -->
<threadCount>60</threadCount>
<!-- The spool thread(s) should idle for some time, if it
has nothing to do -->
<threadIdleTime>60000</threadIdleTime>
</configuration>
</spool>
</nntp-repository>
<!-- The Mailstore block -->
<mailstore>
<repositories>
<!-- File based repositories. These repositories store all
message data -->
<!-- in the file system. -->
<repository
class="org.apache.james.mailrepository.AvalonMailRepository">
<protocols>
<protocol>file</protocol>
</protocols>
<types>
<type>MAIL</type>
</types>
</repository>
<repository
class="org.apache.james.mailrepository.AvalonSpoolRepository">
<protocols>
<protocol>file</protocol>
</protocols>
<types>
<type>SPOOL</type>
</types>
</repository>
<!-- JDBC based repositories. These repositories store all
message data -->
<!-- in the database. -->
<repository
class="org.apache.james.mailrepository.JDBCMailRepository">
<protocols>
<protocol>db</protocol>
</protocols>
<types>
<type>MAIL</type>
</types>
<config>
<sqlFile>file://conf/sqlResources.xml</sqlFile>
</config>
</repository>
<repository
class="org.apache.james.mailrepository.JDBCSpoolRepository">
<protocols>
<protocol>db</protocol>
</protocols>
<types>
<type>SPOOL</type>
</types>
<config>
<sqlFile>file://conf/sqlResources.xml</sqlFile>
<maxcache>1000</maxcache>
</config>
</repository>
<!-- These repositories store message delivery and headers in
the DB, and the body to the filesystem -->
<repository
class="org.apache.james.mailrepository.JDBCMailRepository">
<protocols>
<protocol>dbfile</protocol>
</protocols>
<types>
<type>MAIL</type>
</types>
<config>
<sqlFile>file://conf/sqlResources.xml</sqlFile>
<filestore>file://var/dbmail</filestore>
</config>
</repository>
<repository
class="org.apache.james.mailrepository.JDBCSpoolRepository">
<protocols>
<protocol>dbfile</protocol>
</protocols>
<types>
<type>SPOOL</type>
</types>
<config>
<sqlFile>file://conf/sqlResources.xml</sqlFile>
<filestore>file://var/dbmail</filestore>
<maxcache>1000</maxcache>
</config>
</repository>
<!-- The mbox repository is designed for MAIL only; SPOOL
performance would be less than ideal-->
<repository
class="org.apache.james.mailrepository.MBoxMailRepository">
<protocols>
<protocol>mbox</protocol>
</protocols>
<types>
<type>MAIL</type>
</types>
</repository>
</repositories>
<!-- Spool repository configuration -->
<!-- Alternative spool repository definition for JDBC use -->
<spoolRepository>
<repository destinationURL="db://maildb/spool/spool" type="SPOOL"/>
</spoolRepository>
</mailstore>
<!-- The User Storage block -->
<users-store>
<!-- Configure User Repositories here. -->
<!-- Database backed user repositories -->
<!-- The LocalUsers repository, for storing James' User info. -->
<repository name="LocalUsers"
class="org.apache.james.userrepository.JamesUsersJdbcRepository"
destinationURL="db://maildb/users">
<sqlFile>file://conf/sqlResources.xml</sqlFile>
</repository>
</users-store>
<!-- The database-connections block -->
<database-connections>
<data-sources>
<data-source name="maildb"
class="org.apache.james.util.dbcp.JdbcDataSource">
<driver>com.mysql.jdbc.Driver</driver>
<dburl>jdbc:mysql://127.0.0.1/mail?autoReconnect=true</dburl>
<user>root</user>
<password>root</password>
<max>100</max>
</data-source>
</data-sources>
</database-connections>
<!-- Configuration for Cornerstone Services -->
<!-- -->
<!-- The Object Storage block -->
<!-- -->
<!-- Defines file storage details that are used for file-based
repositories. -->
<objectstorage>
<repositories>
<repository
class="org.apache.james.mailrepository.filepair.File_Persistent_Object_Repository">
<protocols>
<protocol>file</protocol>
</protocols>
<types>
<type>OBJECT</type>
</types>
<models>
<model>SYNCHRONOUS</model>
<model>ASYNCHRONOUS</model>
<model>CACHE</model>
</models>
</repository>
<repository
class="org.apache.james.mailrepository.filepair.File_Persistent_Stream_Repository">
<protocols>
<protocol>file</protocol>
</protocols>
<types>
<type>STREAM</type>
</types>
<models>
<model>SYNCHRONOUS</model>
<model>ASYNCHRONOUS</model>
<model>CACHE</model>
</models>
</repository>
</repositories>
</objectstorage>
<!-- The Connection Manager block -->
<!-- -->
<connections>
<idle-timeout>3000</idle-timeout>
<max-connections>0</max-connections>
</connections>
<!-- The Socket Manager block -->
<!-- -->
<sockets>
<server-sockets>
<factory name="plain"
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"/>
<!--
<factory name="ssl"
class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory">
<keystore>
<file>conf/keystore</file>
<password>secret</password>
<type>JKS</type>
<protocol>TLS</protocol>
<algorithm>SunX509</algorithm>
<authenticate-client>false</authenticate-client>
</keystore>
</factory>
-->
</server-sockets>
<client-sockets>
<factory name="plain"
class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"/>
</client-sockets>
</sockets>
<!-- The Thread Manager block -->
<thread-manager>
<thread-group>
<name>default</name>
<priority>5</priority>
<is-daemon>false</is-daemon>
<max-threads>100</max-threads>
<min-threads>20</min-threads>
<min-spare-threads>20</min-spare-threads>
</thread-group>
</thread-manager>
</config>
---End---
Cory wrote:
Thanks for the prompt response
What james release are you using? Can you send us your config.xml?
I'm using 2.2.0.
I don't know where is the problem but you should upgrade connector/j
to 3.1
(afaik mysql 4.1 needs connector/j 3.1).
I upgraded the connector and the error isn't replicating anymore.
I'll post again, if I can replicate it.
Thanks again,
--Cory