0 Replies Latest reply on Aug 5, 2002 5:54 PM by Benoit Xhenseval

    Log4J and SMTPAppender

    Benoit Xhenseval Newbie

      Hi

      I am trying to use the SMTPAppender in JBoss and it is not trivial...

      I have changed jboss.conf (in bold)
      <MLET CODE = "org.jboss.logging.Log4jService" ARCHIVE="jboss.jar,mail.jar,activation.jar,log4j.jar" CODEBASE="../../lib/ext/">


      mail.jar and activation.jar are in lib/ext

      and added the following entry in log4j.properties

      log4j.appender.SMTP=org.apache.log4j.net.SMTPAppender
      log4j.appender.SMTP.To=me@mymail.com
      log4j.appender.SMTP.From=BigBug@acme.org

      # The following is the most important parameter:
      log4j.appender.SMTP.SMTPHost=my smtp server
      log4j.appender.SMTP.Subject=Waaaaaah!
      log4j.appender.SMTP.layout=org.apache.log4j.SimpleLayout
      log4j.category.org=DEBUG, SMTP
      log4j.debug=true

      Unfortunately, as soon as Log4J tries to send an email, I get the following error:

      Could anyone help me?
      What have I done wrong?

      Thank you!
      Benoit

      [INFO,STDERR,JBossMain] log4j:ERROR Error occured while sending e-mail notification.
      [INFO,STDERR,JBossMain] javax.mail.SendFailedException: Sending failed;
      nested exception is:
      javax.mail.MessagingException: IOException while sending message;
      nested exception is:
      javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
      boundary="----=_Part_0_-30154002.1028580876751"
      [INFO,STDERR,JBossMain] at javax.mail.Transport.send0(Transport.java:219)
      [INFO,STDERR,JBossMain] at javax.mail.Transport.send(Transport.java:81)
      [INFO,STDERR,JBossMain] at org.apache.log4j.net.SMTPAppender.sendBuffer(SMTPAppender.java:346)
      [INFO,STDERR,JBossMain] at org.apache.log4j.net.SMTPAppender.append(SMTPAppender.java:232)
      [INFO,STDERR,JBossMain] at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
      [INFO,STDERR,JBossMain] at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
      [INFO,STDERR,JBossMain] at org.apache.log4j.Category.callAppenders(Category.java:255)
      [INFO,STDERR,JBossMain] at org.apache.log4j.Category.forcedLog(Category.java:445)
      [INFO,STDERR,JBossMain] at org.apache.log4j.Category.log(Category.java:852)
      [INFO,STDERR,JBossMain] at org.jboss.logging.Logger.error(Logger.java:170)
      [INFO,STDERR,JBossMain] at org.jboss.pool.jdbc.xa.XAConnectionFactory.createObject(XAConnectionFactory.java:291)
      [INFO,STDERR,JBossMain] at org.jboss.pool.ObjectPool.createNewObject(ObjectPool.java:1004)
      [INFO,STDERR,JBossMain] at org.jboss.pool.ObjectPool.initialize(ObjectPool.java:550)
      [INFO,STDERR,JBossMain] at org.jboss.pool.jdbc.xa.XAPoolDataSource.initialize(XAPoolDataSource.java:167)
      [INFO,STDERR,JBossMain] at org.jboss.jdbc.XADataSourceLoader.startService(XADataSourceLoader.java:403)
      [INFO,STDERR,JBossMain] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
      [INFO,STDERR,JBossMain] at java.lang.reflect.Method.invoke(Native Method)
      [INFO,STDERR,JBossMain] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      [INFO,STDERR,JBossMain] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      [INFO,STDERR,JBossMain] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
      [INFO,STDERR,JBossMain] at $Proxy0.start(Unknown Source)
      [INFO,STDERR,JBossMain] at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      [INFO,STDERR,JBossMain] at java.lang.reflect.Method.invoke(Native Method)
      [INFO,STDERR,JBossMain] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      [INFO,STDERR,JBossMain] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      [INFO,STDERR,JBossMain] at org.jboss.Main.(Main.java:209)
      [INFO,STDERR,JBossMain] at org.jboss.Main$1.run(Main.java:110)
      [INFO,STDERR,JBossMain] at java.security.AccessController.doPrivileged(Native Method)
      [INFO,STDERR,JBossMain] at org.jboss.Main.main(Main.java:106)