• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic