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

Impossible to inject database MailListener in an event listener

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 7.4.4
    • Mail
    • None
    • Unknown

    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

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

              Dates

                Created:
                Updated: