Hi I'm new with james and I encounter some difficulties having to work with
mysql.
I'm using apache-james-3.0-beta4

I don't really understand what I am suppose to put in mailetcontainer.conf
to have it work with mysql I tried
<mailet match="All" class="ToRepository">
          <repositoryPath>db://James/deadletter/error</repositoryPath>
</mailet>

<mailet match="All" class="ToRepository">
          <repositoryPath>db://mysql/deadletter/error</repositoryPath>
</mailet>

In persistence.xml I Have:
<persistence-unit name="James" transaction-type="RESOURCE_LOCAL">

 The JPA part works fine it create the tables etc.. It's really the mailer
part that poses me a problem

I have that kind of errors:

Caused by: javax.mail.MessagingException: Failed to retrieve MailRepository
for url db://mysql/deadletter/error;
  nested exception is:
org.apache.james.mailrepository.api.MailRepositoryStore$MailRepositoryStoreE
xception: Cannot find or init repository
at 
org.apache.james.transport.mailets.ToRepository.init(ToRepository.java:76)
at org.apache.mailet.base.GenericMailet.init(GenericMailet.java:181)
at 
org.apache.james.container.spring.bean.factory.mailetcontainer.MailetLoaderB
eanFactory.getMailet(MailetLoaderBeanFactory.java:48)
at 
org.apache.james.mailetcontainer.lib.AbstractStateMailetProcessor.parseConfi
guration(AbstractStateMailetProcessor.java:381)
... 28 more
Caused by: 
org.apache.james.mailrepository.api.MailRepositoryStore$MailRepositoryStoreE
xception: Cannot find or init repository
at 
org.apache.james.container.spring.bean.factory.mailrepositorystore.MailRepos
itoryStoreBeanFactory.select(MailRepositoryStoreBeanFactory.java:236)
at 
org.apache.james.transport.mailets.ToRepository.init(ToRepository.java:74)
... 31 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'db': Invocation of init method failed; nested
exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Specified key was too long; max key length is 767 bytes


OR

Caused by: javax.mail.MessagingException: Failed to retrieve MailRepository
for url db://James/deadletter/error;
  nested exception is:



The doc on the website says :
JDBCAlias
Description: This mailet does alias translation for email addresses stored
in a database table.
Parameters:
* mappings (required) - a URL of the form db://<data-source>/<table>, where
<table> is the table in the database containing the alias info and
<data-source> is the name of the data-source in mailetcontainer.xml that is
to be used.
* source-column (required) - the column containing the aliases.
* target-column (required) - the column containing the alias targets.

What am I suppose to use as <data-source>, do I need to create the tables
???
I don't understand where my configuration is wrong or what is missing.

Thank you for your help.

Patrick




Reply via email to