Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13720

Impossible to inject database MailListener in an event listener

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.4.4
    • Fix Version/s: None
    • Component/s: Mail
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      Listener are initialized at application startup (when the database is not ready and there is no XWikiContext available).

      Problem is that DatabaseMailListener cannot be initialized then. It should probably be a bit lazier.

      The workaround is to use

          @Inject
          @Named("database")
          private Provider<MailListener> databaseMailListenerProvider;
      

      instead of the documented

          @Inject
          @Named("database")
          private MailListener databaseMailListener;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tmortagne Thomas Mortagne
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: