My mistakes

Posts Tagged ‘software

SEVERE: Servlet.service() for servlet EmailServlet threw exception
java.lang.SecurityException: Access to default session denied

Please try the below solutions
1) Verify there is no duplication of javamail.jar in the tomcat or in your application.

Check the tomcat_home/lib , your_app/WEB-INF/lib

2)  Verify you are using only one email configuration to call the Session.getDefaultInstance through out the site.

Because as per the documentation the replication of the configuration with getDefaultInstance will cause an error.

In such case if you want to insist with the new configuration then use Session.getInstance instead of Session.getDefaultInstance.