AFAIK there is no easy way to get the mail jars in the geronimo startup classloader, although you might try lib/endorsed. I don't know anything about the internal structure of log4j but I wonder, if there is a way to register an appender in code, if the simplest and least invasive solution would be to write a geronimo gbean to register the appender directly? You'd lose log output up to the point where that gbean started. thanks david jencks On Jul 25, 2007, at 1:23 PM, Geronimo User wrote: > Could I have some pointers on how to use an SMTPAppender in the > server-log4j.properties in Geronimo. > > I have my appender defined like this: > > log4j.rootCategory=INFO, CONSOLE, FILE, MAIL > > ... > > log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender > log4j.appender.MAIL.SMTPHost=my.smtphost.com > log4j.appender.MAIL.To=me@mycompany.com > log4j.appender.MAIL.From=Geronimo@mycompany.com > log4j.appender.MAIL.BufferSize=1 > log4j.appender.MAIL.LocationInfo=true > log4j.appender.MAIL.Level=ERROR > > I imagine my problem (see below) is because I'm missing mail.jar and > activation.jar somewhere. > > I've tried putting these .jar files, obtained from elsewhere, in > geronimo-1.1.1/lib or geronimo-1.1.1/lib/ext but still see the error > below. > > When I start Geronimo with this appender in the properties file, with > or without the above .jar files available, it says: > > 2007-07-25 16:07:36,429 ERROR [GBeanInstanceState] Error while > starting; GBean is now in the FAILED state: > abstractName="geronimo/j2ee-system/1.1.1/car?ServiceModule=geronimo/ > j2ee-system/1.1.1/car,j2eeType=SystemLog,name=Logger" > java.lang.NoClassDefFoundError: > at java.lang.Class.getDeclaredConstructors0(Native Method) > at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) > at java.lang.Class.getConstructor0(Class.java:2671) > 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.configureRootCategory > (PropertyConfigurator.java:500) > at org.apache.log4j.PropertyConfigurator.doConfigure > (PropertyConfigurator.java:406) > at org.apache.log4j.PropertyConfigurator.doConfigure > (PropertyConfigurator.java:432) > at > org.apache.geronimo.system.logging.log4j.URLConfigurator.doConfigure > (URLConfigurator.java:117) > at > org.apache.geronimo.system.logging.log4j.URLConfigurator.configure > (URLConfigurator.java:44) > at > org.apache.geronimo.system.logging.log4j.Log4jService.reconfigure > (Log4jService.java:519) > at org.apache.geronimo.system.logging.log4j.Log4jService.doStart > (Log4jService.java:562) > at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance > (GBeanInstance.java:981) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart( > GBeanInstanceState.java:267) > at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start > (GBeanInstanceState.java:102) > at org.apache.geronimo.gbean.runtime.GBeanInstance.start > (GBeanInstance.java:526) > at > org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart > (GBeanDependency.java:111) > at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget > (GBeanDependency.java:146) > at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running > (GBeanDependency.java:120) > at > org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEven > t(BasicLifecycleMonitor.java:173) > at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access > $300(BasicLifecycleMonitor.java:41) > at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor > $RawLifecycleBroadcaster.fireRunningEvent > (BasicLifecycleMonitor.java:251) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart( > GBeanInstanceState.java:292) > at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start > (GBeanInstanceState.java:102) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive > (GBeanInstanceState.java:124) > at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive > (GBeanInstance.java:540) > at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean > (BasicKernel.java:379) > at > org.apache.geronimo.kernel.config.ConfigurationUtil.startConfiguration > GBeans(ConfigurationUtil.java:374) > at > org.apache.geronimo.kernel.config.ConfigurationUtil.loadBootstrapConfi > guration(ConfigurationUtil.java:155) > at > org.apache.geronimo.kernel.config.ConfigurationUtil.loadBootstrapConfi > guration(ConfigurationUtil.java:126) > at org.apache.geronimo.system.main.Daemon.doStartup(Daemon.java:253) > at org.apache.geronimo.system.main.Daemon.(Daemon.java:74) > at org.apache.geronimo.system.main.Daemon.main(Daemon.java:377) > > Thanks.