Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-778

Only one deployed application can use custom mailcap

    Details

      Description

      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:

      <module name="javax.mail.api"><imports><include path="META-INF"/><include path="META-INF/**"/></imports></module>

      and, from the application, calling at startup:

      javax.activation.CommandMap.setDefaultCommandMap(new MailcapCommandMap());

      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 ??

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                guinotphil Philippe Guinot
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: