geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: SMTPAppender in server-log4j.properties
Date Fri, 08 Feb 2008 08:12:39 GMT

On Feb 7, 2008, at 11:03 PM, Vamsavardhana Reddy wrote:

> After I added geronimo-activation_1.1_spec-1.0.jar also to the  
> classpath in the MANIFEST.MF, I got the SMTPAppender to send e-mail  
> on an "ERROR".  I don't know if adding geronimo- 
> javamail_1.4_mail-1.2.jar and geronimo-activation_1.1_spec-1.0.jar  
> to j2ee-system classLoader will break anything else.  This hack is  
> definitely not the way to handle this.  Should we make geronimo- 
> javamail part of the base server so that j2ee-system config readily  
> has these jars in the classLoader?  Or should we provide a way to  
> add additional dependencies through config.xml (I don't know how  
> complicated this will be)?

So far I don't really like either of these methods and think we  
should find out how hard it is to follow my idea of adding the smtp  
appender from somewhere the appropriate classes are already available  
from.

Maybe optional dependencies are the way to go... but this will be  
really hard to make work with the "bootstrap" server.jar.  Maybe when  
gshell can get all the g. jars back into the repo this will be easier.

thanks
david jencks

>
>
> ++Vamsi
>
>
> On Feb 8, 2008 11:21 AM, Vamsavardhana Reddy <c1vamsi1c@gmail.com>  
> wrote:
> I tried this hack by adding mail jar to the classpath entry in  
> MANIFEST.MF inside server.jar.  I ended up with an NCDFE.
>
> 11:12:03,593 ERROR [GBeanInstanceState] Error while starting; GBean  
> is now in th
> e FAILED state: abstractName="org.apache.geronimo.configs/j2ee- 
> system/2.0.3-SNAP
> SHOT/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/ 
> 2.0.3-SNAPSHOT/ca
>
> r,j2eeType=SystemLog,name=Logger"
> java.lang.NoClassDefFoundError: javax/activation/DataSource
>         at org.apache.log4j.net.SMTPAppender.activateOptions 
> (Unknown Source)
>         at org.apache.log4j.config.PropertySetter.activate 
> (PropertySetter.java:2
> 56)
>         at org.apache.log4j.config.PropertySetter.setProperties 
> (PropertySetter.j
>
> ++Vamsi
>
> On Feb 8, 2008 7:02 AM, N Z <nzender1986@yahoo.com> wrote:
> I would like to be able to send errors to my email when they occur  
> but I cannot seem to get it to work. I have the following  
> configuration in the properties file.
>
> log4j.rootLogger=INFO, CONSOLE, FILE, MAIL
>
> log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
> log4j.appender.CONSOLE.Threshold=$ 
> {org.apache.geronimo.log.ConsoleLogLevel}
> log4j.appender.CONSOLE.Target=System.out
> log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
> log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [% 
> c{1}] %m%n
>
> log4j.appender.FILE=org.apache.log4j.RollingFileAppender
> log4j.appender.FILE.Threshold=TRACE
> log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
> log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c 
> {1}] %m%n
>
> #email appender
> log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
> #defines how othen emails are send
> log4j.appender.MAIL.BufferSize=1
> log4j.appender.MAIL.SMTPHost="smtp.gmail.com"
> log4j.appender.MAIL.From=log@gmail.com
> log4j.appender.MAIL.To=nzender1986@gmail.com
> log4j.appender.MAIL.Subject=Log ...
> log4j.appender.MAIL.threshold=error
> log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
> log4j.appender.MAIL.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}: 
> %L - %m%n
>
> But I get the following error
>
> 19:32:54,828 ERROR [GBeanInstanceState] Error while starting; GBean  
> is now in the FAILED state:  
> abstractName="org.apache.geronimo.configs/j2ee-system/2.0.2/car? 
> ServiceModule=org.apache.geronimo.configs/j2ee-system/2.0.2/ 
> car,j2eeType=SystemLog,name=Logger"
> java.lang.NoClassDefFoundError: javax/mail/Multipart
>     at java.lang.Class.getDeclaredConstructors0(Native Method)
>     at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
>     at java.lang.Class.getConstructor0(Unknown Source)
>     at java.lang.Class.newInstance0(Unknown Source)
>     at java.lang.Class.newInstance(Unknown Source)
>     at  
> org.apache.log4j.helpers.OptionConverter.instantiateByClassName 
> (OptionConverter.java:329)
>     at org.apache.log4j.helpers.OptionConverter.instantiateByKey 
> (OptionConverter.java:120)
>     at org.apache.log4j.PropertyConfigurator.parseAppender 
> (PropertyConfigurator.java:629)
>     at org.apache.log4j.PropertyConfigurator.parseCategory 
> (PropertyConfigurator.java:612)
>     at org.apache.log4j.PropertyConfigurator.configureRootCategory 
> (PropertyConfigurator.java:509)
>     at org.apache.log4j.PropertyConfigurator.doConfigure 
> (PropertyConfigurator.java:415)
>     at org.apache.log4j.PropertyConfigurator.doConfigure 
> (PropertyConfigurator.java:441)
>     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:532)
>     at org.apache.geronimo.system.logging.log4j.Log4jService.doStart 
> (Log4jService.java:586)
>     at  
> org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance 
> (GBeanInstance.java:996)
>     at  
> org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart( 
> GBeanInstanceState.java:268)
>     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:553)
>     at  
> org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean 
> (BasicKernel.java:379)
>     at  
> org.apache.geronimo.kernel.config.ConfigurationUtil.startConfiguration 
> GBeans(ConfigurationUtil.java:448)
>     at  
> org.apache.geronimo.kernel.config.ConfigurationUtil.loadBootstrapConfi 
> guration(ConfigurationUtil.java:200)
>     at  
> org.apache.geronimo.kernel.config.ConfigurationUtil.loadBootstrapConfi 
> guration(ConfigurationUtil.java:159)
>     at  
> org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.loadBoot 
> Configuration(MainConfigurationBootstrapper.java:84)
>     at  
> org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.getMain( 
> MainConfigurationBootstrapper.java:57)
>     at  
> org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main 
> (MainConfigurationBootstrapper.java:38)
>     at org.apache.geronimo.cli.AbstractCLI.executeMain 
> (AbstractCLI.java:67)
>     at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java: 
> 30)
>
>
> I have tried to add the javamail.jar to the j2ee-system/Meta-Inf/ 
> Manifest.MF file. But still to no luck. I have also put the  
> javamail.jar into the repository and that still does nothing.  
> Please any help would be very much appreciated.
> Thank you,
> Nathan
>
>


Mime
View raw message