Ever since i upgraded to Ubuntu 7.04 I have been unable to successfully run all the unit tests for our project. One particular test kept failing in a part of the system that handles email. Here was the stack trace I kept seeing.
java.lang.NullPointerException
[junit] at java.lang.String.concat(Ljava.lang.String;)Ljava.lang.String;(Unknown Source)
[junit] at com.sun.activation.registries.MailcapFile.parseLine(MailcapFile.java:234)
[junit] at com.sun.activation.registries.MailcapFile.parse(MailcapFile.java:198)
[junit] at com.sun.activation.registries.MailcapFile.createMailcapHash(MailcapFile.java:158)
[junit] at com.sun.activation.registries.MailcapFile.(MailcapFile.java:47)
[junit] at javax.activation.MailcapCommandMap.loadFile(MailcapCommandMap.java:171)
[junit] at javax.activation.MailcapCommandMap.(MailcapCommandMap.java:125)
[junit] at javax.activation.CommandMap.getDefaultCommandMap(CommandMap.java:54)
[junit] at javax.activation.DataHandler.initDefaultCommandMap(DataHandler.java:149)
[junit] at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:615)
[junit] at javax.activation.DataHandler.getContent(DataHandler.java:540)
[junit] at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1068)
I figured out that there is a file called .mailcap in my home directory. In my case, for whatever reason, the first line of the file had some junk in it. There was a -e there. By deleting that line of the .mailcap the test passes. Totally lame. I don't know if this is an Ubuntu thing or PEBKAC, but at least it is easy to fix (if you know what is wrong).
5 comments:
Gosh it's been a long day, but the weirdness of that "-e" just tops it all.
Thanks for posting your solution. I'm migrating a web application, and scratched my head for a little while on this one.
Captcha oymdg indeed.
Wow, thanks a lot!!!!
Mr upper case G.
You saved my life!
How did you find it?
Hello,
You saved another life today, thanks a lot for that.
Keep publishing... ;-)
Thanks You Rock !
Post a Comment