Mail from log handler
We need to send mail from a log handler in GlassFish.
We've tried to use smtphandler-0.6 and -0.7 with limited success. We install the jarfile to domain/lib/ext. We configure smtphandler's properties in domain/config/logging.properties.
We've tried two ways of satisfying smtphandler's reliance on mail imports: 1) We have edited its manifest classpath to point to ../../../../modules/javax.mail.jar, and 2) we've put javax.mail.jar in domain/lib/ext alongside the smtphandler jar.
With either of these arrangements the behavior is the same: the handler loads ok and sends mail for errors and warnings that occur during domain startup. However, when we then deploy our application and cause it to emit some error logs, mail stops working. The handler still runs, but it fails with an error finding the constructor for SMTPTransport:
java.lang.NoSuchMethodException: com.sun.mail.smtp.SMTPTransport.[init](javax.mail.Session, javax.mail.URLName)
1) Are we deploying the handler to the correct location (domain/lib/ext) ?
2) Why does it send mail during an (empty, no apps) domain startup, but fail for logs emitted by our application?
P.S. In the exception cited above, pretend that "init" appears in angle brackets.