• Post Reply Bookmark Topic Watch Topic
  • New Topic

ExceptionInInitializerError with JavaMail  RSS feed

Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • 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?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!