• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFMAIL Stopped Working After CF2018 Update 14

Community Beginner ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

I am having an interesting problem.  Since installing CF2018 Update 14 I am no longer able to use the CFMail tags in my web pages.  It was working before the update without issue.  Since applying the update when the page is called, it acts as if it stops reading the page at the <cfmail> tag.  Nothing else loads after that point.  I just get a blank white page in the browser.
Looking at chrome developer tools, the body of the page is blank.

 

Example of my cfmail:

<cfmail
from="test_noreply@server.com"
to="email_address@server.com"
subject="test email message">
This is a test email message
</cfmail>

I get the following error in the server application log:

"Error","ajp-nio-127.0.0.1-8018-exec-5","06/28/22","07:46:57","","org/bouncycastle/jce/provider/BouncyCastleProvider The specific sequence of files included or processed is: X:\<path>\page.cfm, line: 2 "

 

I've tried the <cfmail> tag all on one line and get the same error but the line changes to 1.

I'm not getting any other error messages in any logs.

I'm pulling my hair out trying to find an answer and google is not much help with this issue.

Thanks for any suggestions you can offer - I apologize if this is not the right forum, new to posting stuff here.  

Views

651

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 06, 2022 Jul 06, 2022

That is not surprising. I would:

  1. Roll back the update,;
  2. Restart ColdFusion.
  3. Confirm that the current update level is one on which Update 14 may be installed, and test it to verify there are no bugs;
  4. Install Update 14. 

Votes

Translate

Translate
Community Expert ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

You're in the right forum. It's a curious error. Unlikely to be caused by you, more likely to be caused by ColdFusion.

 

We need more details. See if a try/catch provides more details about the error

 

 

<cftry>
<cfmail
from="test_noreply@server.com"
to="email_address@server.com"
subject="test email message">
This is a test email message
</cfmail>
<cfcatch type="any">
    <cfdump var="#cfcatch#">
</cfcatch>
</cftry>

 

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

Same result, same error in the application log.  Nothing dumped to the screen.

I wish I had more to offer.  That is what's making this so hard to figure out, no errors on the screen to go by.  I was thinking I may try to uninstall Update 14 to see if that resolves the issue but I was hoping that would be my last resourt.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

What is the error in exception.log?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

"Error","ajp-nio-127.0.0.1-8018-exec-2","06/28/22","10:56:31","","org/bouncycastle/jce/provider/BouncyCastleProvider The specific sequence of files included or processed is: X:\<path>\file.cfm, line: 3 "
java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
at coldfusion.tagext.net.MailTag.validate(MailTag.java:668)
at coldfusion.tagext.net.MailTag.processAttributes(MailTag.java:856)
at cfredirect2ecfm515206229.runPage(X:\<path>\file.cfm:3)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:262)
at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:735)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:565)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:595)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:162)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:45)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:96)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:226)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:377)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:463)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
at coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:250)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 46 more

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

Some more ideas:

 

Is there a JAR file similar to C:\ColdFusion2018\cfusion\lib\bcprov-jdk15on-153.jar in your installation?  That would be the location of the package org/bouncycastle/jce/provider/BouncyCastleProvider.

 

On a related note, what happens when you run the following code in a CFM page:

<cfset obj=createobject("java","org.bouncycastle.jce.provider.BouncyCastleProvider")>
<cfdump var="#obj#">

 

Does the mail server perhaps require <cfmail> to pass it the certificate details?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

A test you can do: Go to https://www.bouncycastle.org/latest_releases.html.

Download the JAR, bcprov-jdk18on-171.jar

Copy it to /cfusion/lib

Restart ColdFusion.

Try sending the mail.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

I had bcprov-jdk15on-153.jar in my cfusion\lib directory.  I copied the file you suggested and restarted the services, still same result.  I added your code

 

<cfset obj=createobject("java","org.bouncycastle.jce.provider.BouncyCastleProvider")>
<cfdump var="#obj#">

 

at the top of my test page and got the following:

object of org.bouncycastle.jce.provider.BouncyCastleProvider

Class Nameorg.bouncycastle.jce.provider.BouncyCastleProvider
MethodsMethod Return Type
addAlgorithm(java.lang.String, org.bouncycastle.asn1.ASN1ObjectIdentifier, java.lang.String)void
addAlgorithm(java.lang.String, java.lang.String)void
addAttributes(java.lang.String, java.util.Map)void
addKeyInfoConverter(org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter)void
getKeyInfoConverter(org.bouncycastle.asn1.ASN1ObjectIdentifier)org.bouncycastle.jcajce.provider.util.AsymmetricKeyInfoConverter
getPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo)java.security.PrivateKey
getPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo)java.security.PublicKey
hasAlgorithm(java.lang.String, java.lang.String)boolean
setParameter(java.lang.String, java.lang.Object)void
FieldsField Value
java.lang.String ACCEPTABLE_EC_CURVESacceptableEcCurves
java.lang.String ADDITIONAL_EC_PARAMETERSadditionalEcParameters
org.bouncycastle.jcajce.provider.config.ProviderConfiguration CONFIGURATIONorg.bouncycastle.jcajce.provider.config.ProviderConfiguration
java.lang.String DH_DEFAULT_PARAMSDhDefaultParams
java.lang.String EC_IMPLICITLY_CAecImplicitlyCa
java.lang.String PROVIDER_NAMEBC
java.lang.String THREAD_LOCAL_DH_DEFAULT_PARAMSthreadLocalDhDefaultParams
java.lang.String THREAD_LOCAL_EC_IMPLICITLY_CAthreadLocalEcImplicitlyCa
Parent Class

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

From the tests, we can indeed rule out Bouncy Castle. Therefore, undo the test with bcprov-jdk18on-171.jar.  

 

The error message mentions MailTag validation. So let's rule out strange (for example, non-ASCII) characters or characters not allowed in e-mail addresses.

 

1) Create a new CFM page and retype the following code from scratch (don't copy-paste!):

 

<cftry>
	<cfset fromEmail="first@domain.com">
	<cfset toEmail="second@domain.com">
	
	<cfif isValid("email", "first@domain.com") and  isValid("email", "second@domain.com")>
		<cfmail from="#fromEmail#" to="#toEmail#" subject="test email message">
			This is a test email message
    		</cfmail>
        <cfelse>
               The from-address or the to-address in not valid.
	</cfif>
	
<cfcatch type="any">
    <cfdump var="#cfcatch#">
</cfcatch>
</cftry>

 

2) Test with a cfscript variant:

 

try {
         	cfmail( subject="test email message", from="first@domain.com", to="second@domain.com" ) {
		writeOutput("This is a test email message");
	}
} catch (any e) {
	writeDump( var=e );
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

Oh, what was in mail.log ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

Mail log is not showing any issues.

I tried your two suggestions, rewriting the <CFMail> tag resulted in the same outcome and same error.

Going the script route produced the same result but a different error:

"Error","ajp-nio-127.0.0.1-8018-exec-7","06/29/22","06:16:53","","Could not initialize class coldfusion.mail.MailImpl The specific sequence of files included or processed is: X:\<path>\file.cfm, line: 3 "

Note that Line 3 was the start of the script:

<cfscript>
	try {
	CFMAIL( subject="This is a Test Message", from="from@server.com", to="to@server.cpm" ) {
		writeOutput("This is a test email message from ColdFusion using CFMAIL as a script");
		}
	} catch (any e) {
		writeDump( var=e );
	}
</cfscript>

I did a search on the error and came across this thread: 

https://community.adobe.com/t5/coldfusion-discussions/could-not-initialize-class-coldfusion-mail-mai...

 

I'm beginning to wonder if the update failed somewhere and that I may need to reinstall it.  And this time delete and recreate my connectors even thought the update states its not required.  I updated them the last time.

 

And I really do appreciate all the help you're providing.  It's been a very long time since I've had to work on this server and I'm trying to rebuild my knowledge base.  🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

Correction - 

I had not removed the updated Bouncy Castle jar file.

I stopped the CF services, removed the file, restarted the services and tried your script version again, got a slightly different error:

"Error","ajp-nio-127.0.0.1-8018-exec-7","06/29/22","07:29:04","","org/bouncycastle/asn1/ASN1Encodable The specific sequence of files included or processed is: X:\test.cfm, line: 21 "

Note that Line 21 is the beginning the cfml script inside the <cfscript> tags.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2022 Jun 29, 2022

Copy link to clipboard

Copied

Hi @DC_271 , it is becoming clear that at least one of the following is happening:

  1. CF2018 Update 14 has a Bouncy-Castle bug, perhaps as a result of the upgrade to Log4J 2.17.2. (On this point, make sure there are no longer any Log4J 2.17.x files in /cfusion/lib that are older than 2.17.2);
  2.  Your installation of CF2018 Update 14 is faulty. Should this be the case, then a re-installation would be the best way to find out;
  3.  There is contention between ColdFusion's Bouncy Castle (bcprov-jdk15on-153.jar) and an existing, third-party library on your Operating System. I say that because the following code works, without any problem:
    <cfset obj=createobject("java","org.bouncycastle.asn1.ASN1Encodable")>
    <cfdump var="#obj#">​


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 05, 2022 Jul 05, 2022

Copy link to clipboard

Copied

Good Morning - Thanks for all the help you have provided on this issue.  I am finally back in the office and can work on the server hands on.

I checked the Update 14 install log again and found that I had 1 nonCricital error.  That error happens to be with the bouncycastle jar.

Install File:             \Users\xxxx\493885.tmp\dist\cfusion\lib\bcprov-jdk15on-153.jar
                          Status: ERROR
                          Additional Notes: ERROR - Flexeraak7: invalid entry CRC (expected 0x46c83847 but got 0x2af2b939)

So, I'm trying to figure out if I can just replace that file (not seeing the 153.jar file on bouncycastle site) or if I need to roll the whole update back and reinstall...

Any suggestions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2022 Jul 06, 2022

Copy link to clipboard

Copied

That is not surprising. I would:

  1. Roll back the update,;
  2. Restart ColdFusion.
  3. Confirm that the current update level is one on which Update 14 may be installed, and test it to verify there are no bugs;
  4. Install Update 14. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 06, 2022 Jul 06, 2022

Copy link to clipboard

Copied

LATEST

Sorry - Yes, I replaced bcprov-jdk15on-153.jar, rebooted and all is working now.  I think the file got correupted during the update.  Didn't have to roll back the update, just replaced the file and all is good.  

 

Thanks again for all your help traking this down.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

I don't think Bouncy Castle is the default JCE library in ColdFusion? Anyway, that's probably where your problem is.

 

Dave Watts, Eidolon LLC 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2022 Jun 28, 2022

Copy link to clipboard

Copied

And hey, it looks like you may have already figured this out!

 

Dave Watts, Eidolon LLC 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation