Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 86797 invoked from network); 11 Aug 2006 15:30:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Aug 2006 15:30:30 -0000 Received: (qmail 87279 invoked by uid 500); 11 Aug 2006 15:30:27 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 87109 invoked by uid 500); 11 Aug 2006 15:30:26 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 87098 invoked by uid 99); 11 Aug 2006 15:30:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2006 08:30:26 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.52.166.6] (HELO mail.watt22.hu) (212.52.166.6) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2006 08:30:23 -0700 Received: from grabowski.watt22hq.hu (taifel [127.0.0.1]) by mail.watt22.hu (Postfix) with ESMTP id 9C92B3B5DC for ; Fri, 11 Aug 2006 17:29:59 +0200 (CEST) Received: from [172.16.200.20] ([::ffff:172.16.200.20]) by grabowski.watt22hq.hu with esmtp; Fri, 11 Aug 2006 17:29:57 +0200 Message-ID: <44DCA274.5020900@watt22.hu> Date: Fri, 11 Aug 2006 17:29:56 +0200 From: Takacs Bence User-Agent: Thunderbird 1.5 (X11/20060313) MIME-Version: 1.0 To: Log4J Users List Subject: Re: problems with SMTPAppender under tomcat References: <44DC3D07.5080908@watt22.hu> <44DC54EC.30909@watt22.hu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello The projekt uses the configuration, but has no SMPTAppender attached to it. You mean, that if it use a config in which I call an appender: every package I use should meet the requirements of that appender? This would mean that all my projects would use the mail.api and activation.jar because I attached the SMTPAppender to one of them. This would be weird. Thanks: Bence James Stauffer wrote: > If a project that doesn't need to send email uses a log4j config that > includes an SMPTAppender log4j still needs to configure that appender > so it needs mail.jar and activation.jar. > You don't want to have 2 copies of the same jar in the classpath twice. > > On 8/11/06, Takacs Bence wrote: >> Hello >> >> I've found a solution on the net: >> Deleted all tomcat projects includes the mail.jar, and copied the >> mail.jar and activation.jar to the /tomcat/shared/lib, and everything >> looks fine. >> >> But WHY??? >> It has solved the problem, but it's not a real solution. The problem >> remained unrevealed. My questions: >> >> - Why does a package , which doesn't need to send a mail throws an >> AddressException >> - Why is it problem if I have different projects with mail.jar, and >> activation.jar? And how can I use them regularly (without exceptions)? >> >> Any ideas? >> >> Thanks: >> Bence >> >> >> Takacs Bence wrote: >> > Greetings >> > >> > I've been using log4j for a couple of weeks with tapestry framework, on >> > tomcat. [We've been using tapestry and tomcat for a year] It was >> working >> > properly, until I attached the SMTPAppender to a tapestry projekt. >> > An other projekt throws the following exception: >> > org.apache.commons.logging.LogConfigurationException: >> > java.lang.NoClassDefFoundError: javax/mail/internet/AddressException >> > (Caused by java.lang.NoClassDefFoundError: >> > javax/mail/internet/AddressException) >> > But that projekt would not need to send email... I don't understand... >> > >> > I attached the SMTPAppender to projekt cc, and the eTransferManager >> > throws the exception. >> > >> > And in addition: the attached projekt (cc) works , and sends email if I >> > call the logger.error() method despite the fact that I haven't put the >> > mail.jar, and activation jar into it... >> > And the other projekt doesn't start. >> > >> > If I comment out the line I call the SMTP appender, they are working >> > properly. (but no email...) >> > >> > Does anybody has any idea, what's the problem? >> > Thanks fore the help >> > >> > here is the properties file: >> > >> > # root: >> > log4j.rootLogger=ERROR, stdout >> > >> > # packages: >> > log4j.logger.hu.watt22.wde22.cc=DEBUG, logfile >> > log4j.logger.hu.watt22.wde22.cc=ERROR, mail >> > log4j.logger.hu.watt22.wde22.ctransfer=DEBUG, logfile >> > log4j.logger.hu.watt22.nowision.test=DEBUG, logfile >> > >> > # stdout -- Console Appender >> > log4j.appender.stdout=org.apache.log4j.ConsoleAppender >> > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout >> > log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] >> %5p >> > (%F:%L) - %m%n >> > >> > # logfile -- DailyRollingFileAppender >> > log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender >> > log4j.appender.logfile.File=${catalina.home}/myLogs/client.log >> > log4j.appender.logfile.DatePattern='.'yyyy-MM-dd >> > >> > # logfile Layout >> > log4j.appender.logfile.layout=org.apache.log4j.PatternLayout >> > log4j.appender.logfile.layout.ConversionPattern=%d{HH:mm:ss,SSS} %5p >> > (%F:%L) - %m%n >> > >> > # mail -- SMTPAppender >> > log4j.appender.mail=org.apache.log4j.net.SMTPAppender >> > log4j.appender.mail.To=b.takacs@watt22.hu >> > log4j.appender.mail.From=error@watt22.hu >> > log4j.appender.mail.SMTPHost=mail.watt22hq.hu >> > #log4j.appender.mail.Threshold=ERROR >> > log4j.appender.mail.BufferSize=512 >> > log4j.appender.mail.Subject=WDE Application Error >> > log4j.appender.mail.layout=org.apache.log4j.PatternLayout >> > log4j.appender.mail.layout.ConversionPattern=[%p] %d{DATE} %c - %m%n >> > >> > >> > ...and the whole exception: >> > >> > Aug 10, 2006 4:56:25 PM org.apache.catalina.startup.HostConfig >> deployWAR >> > SEVERE: Error deploying web application archive eTransferManager.war >> > org.apache.commons.logging.LogConfigurationException: >> > java.lang.NoClassDefFoundError: javax/mail/internet/AddressException >> > (Caused by java.lang.NoClassDefFoundError: >> > javax/mail/internet/AddressException) >> > at >> > >> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:538) >> >> > >> > at >> > >> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) >> >> > >> > at >> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) >> > at >> > >> org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:380) >> > at >> > >> org.apache.catalina.core.StandardContext.start(StandardContext.java:4090) >> > at >> > >> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) >> >> > >> > at >> > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) >> > at >> > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) >> > at >> > org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809) >> > at >> > org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698) >> > at >> > org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472) >> > at >> > org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122) >> > at >> > >> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) >> >> > at >> > >> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) >> >> > >> > at >> > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) >> > at >> > org.apache.catalina.core.StandardHost.start(StandardHost.java:718) >> > at >> > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) >> > at >> > org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) >> > at >> > >> org.apache.catalina.core.StandardService.start(StandardService.java:450) >> > at >> > org.apache.catalina.core.StandardServer.start(StandardServer.java:709) >> > at org.apache.catalina.startup.Catalina.start(Catalina.java:551) >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > at >> > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> >> > >> > at >> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> >> > >> > at java.lang.reflect.Method.invoke(Method.java:585) >> > at >> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) >> > at >> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) >> > Caused by: java.lang.NoClassDefFoundError: >> > javax/mail/internet/AddressException >> > at java.lang.Class.getDeclaredConstructors0(Native Method) >> > at >> java.lang.Class.privateGetDeclaredConstructors(Class.java:2328) >> > at java.lang.Class.getConstructor0(Class.java:2640) >> > at java.lang.Class.newInstance0(Class.java:321) >> > at java.lang.Class.newInstance(Class.java:303) >> > at >> > >> org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:319) >> >> > >> > at >> > >> org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:112) >> >> > >> > at >> > >> org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:620) >> >> > >> > at >> > >> org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603) >> >> > >> > at >> > >> org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:524) >> >> > >> > at >> > >> org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:408) >> >> > >> > at >> > >> org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432) >> >> > >> > at >> > >> org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460) >> >> > >> > at org.apache.log4j.LogManager.(LogManager.java:113) >> > at org.apache.log4j.Logger.getLogger(Logger.java:85) >> > at >> > >> org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229) >> >> > at >> > org.apache.commons.logging.impl.Log4JLogger.(Log4JLogger.java:65) >> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >> > Method) >> > at >> > >> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >> >> > >> > at >> > >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >> >> > >> > at >> java.lang.reflect.Constructor.newInstance(Constructor.java:494) >> > at >> > >> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) >> >> > >> > ... 26 more >> > >> > Thanks: >> > Bence >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> > For additional commands, e-mail: log4j-user-help@logging.apache.org >> > >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> For additional commands, e-mail: log4j-user-help@logging.apache.org >> >> > > --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org