On Oct 11, 2008, at 8:07 PM, John wrote:


I have a webapp setup to send an email notification using javamail.  The code works in both Tomcat and JBoss, but in Geronimo I am getting a SecurityException.  Here is a subset of the stacktrace:

  at javax.mail.Session.getDefaultInstance(Session.java:137)
  at com.esa.gaf.server.mail.MailServiceImpl.createSession(MailServiceImpl.java:121)
  at com.esa.gaf.server.mail.MailServiceImpl.sendMail(MailServiceImpl.java:61)
  at com.esa.web.recruiting.app.server.service.RecruitingServiceImpl.notify(RecruitingServiceImpl.java:267)
  at com.esa.web.recruiting.app.server.service.RecruitingServiceImpl.addRecruit(RecruitingServiceImpl.java:246)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)

FWIW, I initially had the war built to include the necessary javamail dependencies.  I suspect, since Geronimo includes a Javamail car, that I don't need to include these, but am finding little guidance in the documentation or through googling to point me in the right direction.

The mail server is configured correctly and I am using a valid user to send the email from.  Is there something special I need to do in order to get this to work correctly?

Hi John,
There are multiple conditions which could result in that exception. Possible that we have a bug in our Javamail implementation... I'm not an expert on our Javamail implementation. I may see a potential problem, though...

Has your app already called Session.getDefaultInstance(Properties, Authenticator)? Or would this be the first call by your app? Are you passing a non-null Authenticator?

Do you see this error, if you restart your server?