Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-10593

No way to prevent java mail “expected resource not found” warnings from camel-mail component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.4-GA
    • fuse-7.2
    • Camel
    • None
    • % %
    • +
    • Hide
      • unzip attached reproducer.zip
      • modify reproducer/src/main/resources/mail.properties
      • cd reproducer
      • mvn clean install
      • FUSE7.2_KARAF_HOME/bin/fuse
      • osgi:install -s mvn:sample/reproducer/1.0.0-SNAPSHOT

      You can observe the following WARN logs

      2019-04-25 12:42:09,806 | WARN | 23 - scheduler://foo | j.mail | 21 - com.sun.mail.javax.mail - 1.6.1.redhat-1 | expected resource not found: /META-INF/javamail.default.providers
      2019-04-25 12:42:09,807 | WARN | 23 - scheduler://foo | j.mail | 21 - com.sun.mail.javax.mail - 1.6.1.redhat-1 | expected resource not found: /META-INF/javamail.default.address.map

      Show
      unzip attached reproducer.zip modify reproducer/src/main/resources/mail.properties cd reproducer mvn clean install FUSE7.2_KARAF_HOME/bin/fuse osgi:install -s mvn:sample/reproducer/1.0.0-SNAPSHOT You can observe the following WARN logs 2019-04-25 12:42:09,806 | WARN | 23 - scheduler://foo | j.mail | 21 - com.sun.mail.javax.mail - 1.6.1.redhat-1 | expected resource not found: /META-INF/javamail.default.providers 2019-04-25 12:42:09,807 | WARN | 23 - scheduler://foo | j.mail | 21 - com.sun.mail.javax.mail - 1.6.1.redhat-1 | expected resource not found: /META-INF/javamail.default.address.map
    • Fuse 7.4 Sprint 46 - Dev #2

      Following warn messages are always logged by using camel-mail component.
      fuse.log

      2019-04-25 12:42:09,806 | WARN | 23 - scheduler://foo | j.mail | 21 - com.sun.mail.javax.mail - 1.6.1.redhat-1 | expected resource not found: /META-INF/javamail.default.providers
      2019-04-25 12:42:09,807 | WARN | 23 - scheduler://foo | j.mail | 21 - com.sun.mail.javax.mail - 1.6.1.redhat-1 | expected resource not found: /META-INF/javamail.default.address.map

      part of camel route

      <to id="_to1" uri="smtp:smtp.host:smtp.port?password=smtp.password&username=smtp.username"/>

      I confirmed that javamail.default.providers and javamail.default.address.map are packaged in javax.mail-1.6.1.redhat-1.jar and also in my reproducer app.

      I guess the reason is a class loader for camel-mail(org.apache.camel.component.mail.DefaultAuthenticator) is used for Class.getResourceAsStream(), and could not find one in javax.mail-1.6.1.redhat-1.jar nor reproducer app.
      Please check the constructor for javax.mail.Session and Session.getResourceAsStream() method.

              yfang@redhat.com Freeman(Yue) Fang
              rhn-support-hfuruich Hisao Furuichi
              Jan Bouska Jan Bouska
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: