tracker issue : CF-3041473

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 82932:Problem using log4j when sending an email (org

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Thierry Troubat / Thierry Troubat (cflog4j)

Created: 05/18/2010

Components: General Server

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,0,251028 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 0

Problem:

Problem using log4j when sending an email (org.apache.log4j.net.SMTPAppender). The code under works fine with CF8 (version   8,0,0,176276)  :<cfset parameters = structnew()><cfset parameters.category="frontPHS"><cfset parameters.message="#randRange(1000, 100000)# Test Error"><cfscript>configurator = CreateObject("java", "org.apache.log4j.PropertyConfigurator");configurator.configure('D:/Projets/phswebservice/global/settings/phs/cflog4j/cflog4j.properties');The code au the cflog4j.properties file is under (Steps to reproduce)category = CreateObject("java", "org.apache.log4j.Category");logger = category.getInstance(parameters.category);logger.error(parameters.message);</cfscript>
Method:

D:/Projets/phswebservice/global/settings/phs/cflog4j/cflog4j.propertieslog4j.category.frontPHS=frontAppender, maillog4j.appender.frontAppender =org.apache.log4j.RollingFileAppenderlog4j.appender.frontAppender.File=D:/Projets/phswebservice/local/phs/log/front/frontTT.loglog4j.appender.frontAppender.layout=org.apache.log4j.PatternLayout log4j.appender.frontAppender.layout.ConversionPattern=%-5p %c %d - %m%nlog4j.appender.frontAppender.MaxFileSize=1024KBlog4j.appender.mail=org.apache.log4j.net.SMTPAppenderlog4j.appender.mail.SMTPHost=smtp.cgin.frlog4j.appender.mail.Subject=DEV PHS Message erreur Front CF9log4j.appender.mail.From=erreur@cgin.frlog4j.appender.mail.To=thierry.troubat@cgin.frlog4j.appender.mail.BufferSize=10log4j.appender.mail.Threshold=infolog4j.appender.mail.layout=org.apache.log4j.PatternLayoutlog4j.appender.mail.layout.ConversionPattern=%-5p %c %d{ISO8601} - %m%n
Result:

log4j:ERROR Error occured while sending e-mail notification.java.lang.ClassCastException: com.sun.mail.handlers.text_plain cannot be cast to javax.activation.DataContentHandlerat javax.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:581)at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:535)at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:597)at javax.activation.DataHandler.writeTo(DataHandler.java:301)at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:264)at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1299)at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1008)at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:414)at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1285)at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2071)at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2039)at javax.mail.Transport.send(Transport.java:119)at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)at org.apache.log4j.net.SMTPAppender.append(Unknown Source)at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)at org.apache.log4j.Category.callAppenders(Category.java:187)at org.apache.log4j.Category.forcedLog(Category.java:372)at org.apache.log4j.Category.error(Category.java:286)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:597)at coldfusion.runtime.StructBean.invoke(StructBean.java:502)at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393)at cflogError22ecfm1601859185.runPage(D:\projets\phswebservice\global\web_phs_front\test\logError2.cfm:14)at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:342)at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)at coldfusion.CfmServlet.service(CfmServlet.java:200)at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)at jrun.servlet.FilterChain.service(FilterChain.java:101)at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3041473

External Customer Info:
External Company:  
External Customer Name: Thierry Troubat
External Customer Email: 471B5E1846FA2BE4992015A9
External Test Config: 05/18/2010

Attachments:

Comments: