[ 
https://jira.duraspace.org/browse/DS-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26374#comment-26374
 ] 

Ivan Masár commented on DS-1182:
--------------------------------

Do we close this and open a new ticket for 4.0 or leave it open?
                
> Javamail: Getting Session object with getDefaultInstace
> -------------------------------------------------------
>
>                 Key: DS-1182
>                 URL: https://jira.duraspace.org/browse/DS-1182
>             Project: DSpace
>          Issue Type: Bug
>          Components: DSpace API, JSPUI
>    Affects Versions: 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 
> 1.7.2, 1.8.0, 1.8.1, 1.8.2
>         Environment: Unix
>            Reporter: João Melo
>            Assignee: Mark H. Wood
>            Priority: Critical
>              Labels: Email, Javamail, SecurityException, Tomcat
>             Fix For: 3.0
>
>
> Context
> - Tomcat 6 with multiple hosts with one application per host (DSpace is one 
> of them).
> - Local SMTP server with no Authentication required
> Problem
> As the Javamail API documentation[1] states, the method getDefaultInstance() 
> - used in DSpace - returns an object shared among the JVM context. If, for 
> some reason, another application (not DSpace) in tomcat refreshes the 
> Authenticator instance within the default session, DSpace will start getting 
> errors when trying to send emails (throwing SecurityException).
> Solution
> - A simple solution to this problem would be replacing all 
> Session.getDefaultInstance() calls by Session.getInstance().
> - Another (more efficient) solution would be defining a singleton, calling 
> the Session.getInstance using some wrapper that would replace all the 
> Session.getDefaultInstance() calls.
> Resources
> [1] Javamail API getDefaultSession - 
> http://javamail.kenai.com/nonav/javadocs/javax/mail/Session.html#getDefaultInstance(java.util.Properties)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to