3 Replies Latest reply on Jun 16, 2004 4:50 PM by yacout

    log4j & org.apache.log4j.net.SMTPAppender

    priceke1 Newbie

      Hello.

      I am trying to get the smtp portion of log4j working, but not having any luck currently. I have uncommented the SMTPAppender section and updated the information as needed. But I don't get any emails or information in my logs about it. I was wondering if I need to do something additional in the log4j.xml file to get this working?

      I am using the stock log4j.xml file and I uncommented the email appender.

      The email host I am pointing I know works becuase I use it in my code with javaMail.

      This is with JBOSS 3.2.1 with Tomcat.

      I have the buffer set to 1 right now just to see if I can get anything. I've played with changing the Threshold some as well hoping that might spark something out of it, but no luck their either.


      Any information or suggestions are greatly appreciated.

      thanks.

      Kevin

      if you need any additional information, let me know.

        • 1. Re: log4j & org.apache.log4j.net.SMTPAppender
          k sw Newbie

          Hi, Kevin,
          I have that same problem too...

          When I turn on the SMTP appender, I will get the following error:

          java.lang.NoClassDefFoundError: javax/mail/Multipart
           at java.lang.Class.getDeclaredConstructors0(Native Method)
           at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
           at java.lang.Class.getConstructor0(Class.java:1762)
           at java.lang.Class.newInstance0(Class.java:276)
           at java.lang.Class.newInstance(Class.java:259)
           at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:164)
           at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
           at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
           at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:201)
           .
           .
           .
          


          I have checked that mail.jar is in my jboss/lib directory. Seems like some kind of class loader problem?

          Have you found any solution to this yet?

          • 2. Re: log4j & org.apache.log4j.net.SMTPAppender
            pawnxing Newbie

            I was having similar problems on my windows. I was using SMTPHost set to 'localhost'. IIS was running as well as the virtual SMTP Server. But no emails.

            To fix that I added a domain alias for the Virtual SMPT Server named localhost. It now works.

            • 3. Re: log4j & org.apache.log4j.net.SMTPAppender
              yacout Newbie

              Hi,
              I have the same error in linux, have you find any solution ?
              Thanks

              "lazarusli" wrote:
              Hi, Kevin,
              I have that same problem too...

              When I turn on the SMTP appender, I will get the following error:
              java.lang.NoClassDefFoundError: javax/mail/Multipart
               at java.lang.Class.getDeclaredConstructors0(Native Method)
               at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
               at java.lang.Class.getConstructor0(Class.java:1762)
               at java.lang.Class.newInstance0(Class.java:276)
               at java.lang.Class.newInstance(Class.java:259)
               at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:164)
               at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
               at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
               at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:201)
               .
               .
               .
              


              I have checked that mail.jar is in my jboss/lib directory. Seems like some kind of class loader problem?

              Have you found any solution to this yet?