Tuesday, 21 July 2009

more alfresco pain

This time I tried to send e-mails when new documents are added. I thought this would be simple. (With Alfresco labs 3.1)
First I got errors like:
20:08:32,529  ERROR [action.executer.MailActionExecuter]
Failed to send email to 'amanica@localhost'
as the address is incorrectly formatted

Eventually I figured out my test addresses are not acceptable to javamail. I had to setup amanica@localhost.dev before it worked.

Next I got the following:
20:08:33,310  ERROR [action.executer.MailActionExecuter]
Failed to send email to [root, test]
Could not prepare mail; nested exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:599)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:388)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:332)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:347)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)
at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:352

And I think setting a e-mail address for the admin user fixed that.

Thirdly it only wanted to send these rule e-mails from alfresco@alfresco.com, but if I copy slightly newer versions of
MailActionExecuter$1.class and MailActionExecuter.class into
it works. I don't know if that breaks anything else in the process.

And finally, I'm still unhappy that they don't ship with oracle hibernate mapping files in the community edition, even in version 3.2 .
Caused by: java.lang.RuntimeException: Error occurred.  Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause: java.lang.RuntimeException
: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.sqlmap.client.SqlMapException: The <sqlmap> resource is missing: alfresco/ibatis/#resource.
at org.alfresco.ibatis.HierarchicalSqlMapConfigParser.parse(HierarchicalSqlMapConfigParser.java:112)
at org.alfresco.ibatis.HierarchicalSqlMapClientFactoryBean.buildSqlMapClient(HierarchicalSqlMapClientFactoryBean.java:86)

Like eclipse and maven, its painfull but theres nothing better :(


  1. I had a similar problem. So to solve, I edited the user's profile and updated with a working email address.
    But now, the emails being sent have :

    localhost instead of the server name. Back to the drawing board.

  2. You have to go into the data directory, and then the email templates and manually add your FQDN or IP address. Ran into the same thing today.