• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Frits Walraven
  • Himai Minh

ExceptionInInitializerError with JavaMail

Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to add email notification to my application. I am using JavaMail. I created a runnable test class first. That worked fine. But when I use it in my J2EE environment, I get the an ExceptionInInitializerError. Try as I might, I can't find much info on this.

The only info I could find suggested it had something to do with the classpath not having activation.jar and mail.jar. Looking at the stack trace that looks like it could be right. So I went and got the latest from sun and both of them in the app server in the domain1's lib directory.

I am using the built in javax.mail.Session reference in the app server. The resource reference appears to be mapped correctly. Even though, I get the same exception if I get the session as POJO instead of looking it up.

Here is the config from ejb-jar.xml:

The email server (james) is set up in the app server and registered too..:

Here is the code:

Here is the exception:

Any ideas?
Beware the other head of science - it bites! Nibble on this message:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic