[jboss-jira] [JBoss JIRA] (AS7-3731) Only one deployed application can use custom mailcap

Philippe Guinot (JIRA) jira-events at lists.jboss.org
Mon Feb 13 07:54:01 EST 2012


Philippe Guinot created AS7-3731:
------------------------------------

             Summary: Only one deployed application can use custom mailcap
                 Key: AS7-3731
                 URL: https://issues.jboss.org/browse/AS7-3731
             Project: Application Server 7
          Issue Type: Bug
          Components: EE
    Affects Versions: 7.1.0.CR1b
         Environment: AS 7, many applications deployed with custom mailcaps.
            Reporter: Philippe Guinot
            Assignee: David Lloyd
            Priority: Minor


In the MailcapCommandMap class, it loads the mailcap file only once. This may cause troubles when different applications use different custom mailcap.

Also, if no mailcap is found in the current class loader, only ONE mailcap file from the module will be loaded, and not all of them, which is an issue if we get the mail-dsn jar added in the javax.mail.api module.


If there is only one application deployed, adding in the jboss-deployement-structure.xml the following dependency:
{code:xml}<module name="javax.mail.api"><imports><include path="META-INF"/><include path="META-INF/**"/></imports></module>{code}
and, from the application, calling at startup:
{code}javax.activation.CommandMap.setDefaultCommandMap(new MailcapCommandMap());{code}
cause the loading of all mailcap files found from the current class loader (those of the application + those of javax.mail.api module).

But, if there are more than one application deployed, only the first to do so will have its mailcap loaded.

The design of javax.activation should be changed to take in account this side-effect of isolation: what happen if 2 applications define different classes for the same type/mime ??

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list