ICEpush
  1. ICEpush
  2. PUSH-140

NoClassDefFoundError thrown when application started without mail.jar

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-Beta
    • Component/s: None
    • Labels:
      None
    • Environment:
      server

      Description

      The following exception is thrown when a webapplication is started without mail.jar library in the classpath:
      java.lang.NoClassDefFoundError: javax/mail/MessagingException
      at org.icepush.EmailNotificationProvider$AutoRegister.contextInitialized(EmailNotificationProvider.java:99)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4600)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      ... 9 more

        Activity

        Hide
        Mircea Toma added a comment -

        Looks like that by using the logger declared in the outer-class of EmailNotificationProvider$AutoRegister a NoClassDefFoundError is thrown.

        The fix instantiates and uses a logger local to the AutoRegister inner-class thus avoiding any side-effects of using the logger declared in the outer-class.

        Show
        Mircea Toma added a comment - Looks like that by using the logger declared in the outer-class of EmailNotificationProvider$AutoRegister a NoClassDefFoundError is thrown. The fix instantiates and uses a logger local to the AutoRegister inner-class thus avoiding any side-effects of using the logger declared in the outer-class.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mircea Toma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: