Custom CSS

Monday, November 19, 2007

NPE when sending mail (JavaMail 1.4) in Ubuntu

Never noticed this before, but it came up today. I tried to send some mail, and got this nasty exception:

org.springframework.web.util.NestedServletException: Request processing failed; 
  nested exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
  at java.lang.String.concat(
  at com.sun.activation.registries.MailcapFile.parseLine(
  at com.sun.activation.registries.MailcapFile.parse(
  at com.sun.activation.registries.MailcapFile.createMailcapHash(
  at com.sun.activation.registries.MailcapFile.<init>(
  at javax.activation.MailcapCommandMap.loadFile(
  at javax.activation.MailcapCommandMap.<init>(

Curiously, this didn't occur until I started Mavenizing the project I was working on, though I was using the same version of JavaMail as before. The fix? Apparently it only happens if you're using Ubuntu. Open up ~/.mailcap and delete the -e at the top of the file.
Post a Comment