sdsinc_pmascari
Engaged
sdsinc_pmascari
Engaged
Activity
‎Feb 21, 2025
07:49 AM
Glad you got it working. Thanks for stepping in, Charlie, and filling in the details.
... View more
‎Feb 20, 2025
12:17 PM
1 Upvote
There was a security update to CF not too long ago that now requires you to include the scope of any variable in these scopes: URL, FORM, CGI, COOKIE. So, the place in your code that may look like: #thearea# now needs to be: #url.thearea#
... View more
‎Feb 05, 2025
07:30 AM
Wanted to chime in here, even though this is an old post. I was setting up SAML using Azure Entra SSO and running into the error Cannot invoke "String.toLowerCase()" because the return value of "coldfusion.runtime.ApplicationScope.getApplicationPath()" is null and this is the only Google result that came up. In my case, I had set up a separate directory inside my site root to facilitate a specific company's SSO request. For example, the SSO link I created was similar to: https://www.mysite.com/saml/company1/ In the 'company1' directory I had just a single index.cfm file containing: <cfset SAMLconfig = {
idp = {name = "myIDPNameInCF"},
sp = {name = "MySPNameinCF"},
relayState = "A_value_my_app_uses"
}>
<cfset InitSAMLAuthRequest(SAMLconfig)> A bizarre thing happened where this code was working for me on my tests. I would get directed to Microsoft (MS) to login and my process worked fine. However, when I sent the link to others, it produced the error message, above. WTF? So, I tried the link on other devices where I'd never logged into MS before and, lo and behold, there was the error! The line number indicated by the error is the InitSAMLAuthRequest() line. Not sure why it was working on my test setup...even different browsers? Only guess is because I had previously logged into my MS account in those browsers before? No clue. Anyway, seeing as this posting was the only 'help' I found I tried grasping at a straw and it seems to have worked: The error indicates the 'return value of "coldfusion.runtime.ApplicationScope.getApplicationPath()" is null. So, it would seem the inner workings of InitSAMLAuthRequest() can't find the application path? So, I created a new application.cfc file in the same directory as this index file. So now my SAML directory at /mywebsite/saml/company1/ has 2 files: application.cfc and index.cfm. The appliaiton file is very simply: component {
this.name = "myCompanySAML";
this.appBasePath = getDirectoryFromPath(getCurrentTemplatePath());
this.sessionManagement = true;
} (I also found sessionmanagement needs to be turned on or you get another error with InitSAMLAuthRequest().) Adding this application file seems to have fixed the issue. All the devices I tried, that had previously errored, are now working as expected and sending me to a MS login page. I've also tested on devices that have never accessed MS before and it also works. Hopefully, no more issues?
... View more
‎Feb 04, 2025
01:06 PM
If you can obtain a jar file, then it should be fairly simple to load it into CF for use. I'm a bit hazy on creating a JAR out of Maven repository, though.
... View more
‎Nov 26, 2024
09:52 AM
You are using sessions for the 'isLoggedIn' variable. I'm asking what is your setting in the CF Admin for session storage? Charlie mentioned this, also. Is if EHCache or Redis, or something else?
... View more
‎Nov 26, 2024
08:55 AM
Question: what do you use for session storage? Is it the standard EHcache or do you use an external system like Redis? We had something similar happen with CFLogin a while back when we switched to remote Redis cache for sessions.
... View more
‎Nov 18, 2024
06:53 AM
Will do, Charlie. For all those who come here looking for help with a ColdFusion memory issue, the solution for us, in this case, was to be sure to only put getCloudService() objects into shared scopes. Do not create that object 'as needed' in a local scope.
... View more
‎Nov 18, 2024
05:58 AM
Thank you both for your comments. It has been very helpful. We will keep all this in mind as we move forward.
... View more
‎Nov 15, 2024
11:31 AM
Garbage collection did almost nothing to help when the server memory was maxed. Admittedly, I am not an expert in this area, but a forced gc gave us no relief. We are now 48+ hours after putting all getCloudService() objects into shared scopes and memory levels are back to "normal" across the board and stable. In Fusion Reactor, I can see just a handful of threads handling our S3 actions. Previously, even trying to load the Thread Visualizer would bring the server to its knees due to the number of threads. One thread dump showed 65,000+ threads!
... View more
‎Nov 15, 2024
09:29 AM
Interesting, regarding object timing out when in the application scope. Yes, of course I would expect this to be true. But, perhaps I'm misunderstanding something, so allow me to postulate.... What we had been doing was putting the object created by getCloudService() into the local variable scope. Our thinking was that object would only be alive when called upon during the intial page load. But, it spawned a thread that never died even though the original object no longer existed when the page processing completed. Which makes me wonder... When the application times out, does CF actually go kill those threads, or does it fire up some new ones when the applicaiton re-initializes? Thus, leaving the original threads continuing to run? This makes me wonder if loading this object to a server scope might make more sense to prevent to buildup of unused threads? Or, is that thinking fraught with peril?
... View more
‎Nov 15, 2024
06:43 AM
1 Upvote
A quick post in case anyone else ever runs in to this memory issue. Our CF servers seemed to have a "memory leak", in that the memory being used (Windows) by the CF service would gradually grow until it was maxing out the entire server. Long-story-short, we found (with the folks over at xByte cloud hosting) in a thread dump that we had tens of thousands of hung (waiting) threads with the name: sdk-ScheduledExecutor Turns out, that thread is created by the AWS SDK for Java, which we are not using. Not surprisingly, though, ColdFusion does use a version of this SDK for their cloud services functionality. We use that extensively when interacting with S3. At first we thought there could be a bug in CF or in the SDK if it's spawning all these threads. But, when pouring over Adobe's docs we found the following little tidbit on this page: Oh! The getCloudService() function must be in a shared scope? In true Adobe fashion, none of the examples they give on that page actually show this requirement in practice! Anyway, our devs had missed that, entirely. All our functions that interacted with S3 were starting out by creating the service object with getCloudService(). Turns out, as far as we can tell, every time that function is called, CF fires up a 'sdk-ScheduledExecutor' thread. The thread does the work you give it, then sits in a waiting state for another job that, in our case, would never come. So, after a while, we'd accumulate 1000s! Solution: make sure 'getCloudService()' is called in a shared scope and reuse that object! Going forward...and maybe I've missed something.... it would be helpful to have a way to close, or kill, this serviceObject. As it stands, once you fire it up, it runs forever? Cheers!
... View more
‎Oct 15, 2024
09:22 AM
OK, this took quite a bit of time, but we've narrow it down to rare instances when a function includes its own arguments as part of its return payload. The Redis cache apparently doesn't handle this? Take this code example we made up and just sent to Adobe: <cfset cacheKey = "ThisIsATest123">
<!--- <cfset cacheremove(cacheKey)> --->
<cfif isNull(cacheGet( cacheKey ))>
<cfset fromCache = false>
<cfset testData = {}>
<cfset testData = WTFFxn("test1","test2")>
<cfset cachePut(cacheKey, testData , createTimeSpan(1,0,0,0),createTimeSpan(0,1,0,0) )>
<cfelse>
<!--- <cfset cacheremove(cacheKey)> --->
<cfset fromCache = true>
<cfset testData = cacheGet( cacheKey )>
</cfif>
<cfdump var="#fromCache#">
<cfdump var="#testData#"><cfabort>
<!--- --------------------------------------------------------------- --->
<cffunction name="WTFFxn">
<cfargument name="wtf1" required="true">
<cfargument name="wtf2" required="true">
<!--- If returned like this: Redis ERROR --->
<cfset ret = arguments>
<!--- If returned like this: Redis ERROR --->
<cfset ret.wtf1 = arguments.wtf1 >
<cfset ret.wtf2 = arguments.wtf2 >
<!--- If returned like this: Redis OK --->
<cfset ret = {
wtf1 = arguments.wtf1,
wtf2 = arguments.wtf2
}>
<cfreturn ret>
</cffunction> We're calling the 'WTFFxn" function which simply returns the arguments we send in. We tried 3 methods of returning: Simply sending the arguments right back out, ret = arguments, results in the Redis 'error' Assigning the arguments to a new structure using dot notation, results in a Redis 'error' However, if we reassign the arguments to a new structure using curly braces, this is handled properly by Redis cache Bizarre, and we normally don't return arguments in this way, but we found this code leftover from a dev's troubleshooting a completely different issue! Again, this only happened to us when using Redis caching. EHCache handles it no problem. Anyway, seems like a bug. I've reported to Adobe support and will also submit it as a bug. Are others able to reproduce this?
... View more
‎Oct 15, 2024
05:44 AM
Charlie, to answer your 2 questions: Yes and Yes. The code fails in Redis but when I switch to EHCache it works, and yes, I've verified it's new data. I've reached out to CF Support and they've asked for a script to reproduce. I'll have to figure out how to give them something, since the code I'm using is part of our apps and has a myriad of different data sources, objects, etc feeding it. I'll report back what I find.
... View more
‎Oct 14, 2024
12:16 PM
there IS the option on the cf admin caching page to control WHICH caching mechanism to use This is what we are testing. We are running Enterprise and have changed the CFAdmin setting to Redis with settings from redis.io are you confirming that if you use cacheGet() against a query cached in ehcache, it shows none of that junk? Yes. I have never seen CF dump data like this when using EHCache. I don't know if it's only choking on queries or what. The object we're storing is big. Full of structs, arrays, queries, etc.... And are you saying that if it's a small query, things look ok when cached in redis? Yes. Just as a test, I put together a quick test and it works as expected in Redis. (NOTE: This is substantially smaller than the data structures we normally cache) <cfset cacheKey = "ThisIsATest123">
<cfif isNull(cacheGet( cacheKey ))>
<cfset fromCache = false>
<cfset testData = {
WasThisATest = true,
HaveABeer = true
}>
<cfset testQry = queryNew("id")>
<cfloop from="1" to="10" index="i">
<cfset queryAddRow(testQry,{id=i})>
</cfloop>
<cfset testData.testQry = testQry>
<cfset cachePut(cacheKey, testData , createTimeSpan(1,0,0,0),createTimeSpan(0,1,0,0) )>
<cfelse>
<cfset fromCache = true>
<cfset testData = cacheGet( cacheKey )>
</cfif>
<cfdump var="#fromCache#">
<cfdump var="#testData#"><cfabort> the free edition of redis cloud, it does have limits I updated our test connection in redis.io for more space and connections. No effect. Still dumps out junk. you can monitor what's going on within redis using either the redis-cli or tools like redisinsight Yep, I have been looking through the redisinsight app. The value it shows in the cache is the same garbage:
... View more
‎Oct 14, 2024
10:21 AM
For all our caching needs we've always used the built-in EHCache in ColdFusion. It's served us well. As our caching use has grown, lately, we're looking to offload our cache duties to an external service. To be clear, in this context I'm not talking about session cache but, rather, caching of specific data using ColdFusion's built-in caching functions. Our apps have several long-running processes that build reports for end users. As the processes run, we cache the data so as to speed up any subsequent calls. The data cached can be rather extensive. Large structs holding any number of additional structs, arrays, queries, etc... Using EHCache we've never had issues. However, as we're trying our Redis, using a free account at redis.io, we're finding the Redis cache doesn't seem to like our large data objects. When I dump out the data obtained from cache via cacheGet() function, instead of seeing a nice ColdFusion structure, we get what appears to be a JSON string but it doesn't validate as JSON. In addition, there look to be internal CF function calls in the string that would be assembling the data such as queries and such. For instance, here's an excerpt from one of the JSON strings: TRADENEWS={{trades={[Table (rows 20 columns engagements, Headline, datepub, hreflink, author, image, source): [engagements: coldfusion.sql.QueryColumn@61138795] [Headline: coldfusion.sql.QueryColumn@52942e28] [datepub: coldfusion.sql.QueryColumn@2dd401bd] [hreflink: coldfusion.sql.QueryColumn@5a8d982] [author: coldfusion.sql.QueryColumn@787ad98d] [image: coldfusion.sql.QueryColumn@bec4dc4] [source: coldfusion.sql.QueryColumn@6b86ced] ]},ERROR={NONE}}},MILERADIUSLIST={216},AUDIENCEINFO={{AudienceReport={[Table (rows 1 columns ID, AIAGROUPID, AIACATID, CATEGORYNAME, GENERALDESC, OTHERINFO, WIKIPEDIAURL, WEBSITEURL, WEBSITENAME, WEBSITEURL2, WEBSITENAME2, SELECTEDLOCALID, SECONDARYLOCALID, OTHERTOPPROSPECTS, CEXCODE, SECONDARYCEXCODES, PEAKMONTHS, PEAKMONTHSDESC, LOCALNEWSSOURCE, AUDIENCEIMAGE, SELECTEDHEALTHCARE, IAB, COMPOSITION, OMITCOMPOSITION, PRIMARYPURCHASEINTENT, SUPPRESSGENDERAGE): [ID: coldfusion.sql.QueryColumn@459fc171] [AIAGROUPID: coldfusion.sql.QueryColumn@6b07cefe] [AIACATID: coldfusion.sql.QueryColumn@26c2c37] [CATEGORYNAME: coldfusion.sql.QueryColumn@4776e793] [GENERALDESC: coldfusion.sql.QueryColumn@7c593245] [OTHERINFO: coldfusion.sql.QueryColumn@297c630e] [WIKIPEDIAURL: coldfusion.sql.QueryColumn@4a92ef82] [WEBSITEURL: coldfusion.sql.QueryColumn@3a28d33c] [WEBSITENAME: coldfusion.sql.QueryColumn@fd61526] [WEBSITEURL2: coldfusion.sql.QueryColumn@45f873c1] [WEBSITENAME2: coldfusion.sql.QueryColumn@18cb7a03] [SELECTEDLOCALID: coldfusion.sql.QueryColumn@6486fb15] [SECONDARYLOCALID: coldfusion.sql.QueryColumn@5bc6bd86] [OTHERTOPPROSPECTS: coldfusion.sql.QueryColumn@5da6bb44] [CEXCODE: coldfusion.sql.QueryColumn@1efed991] [SECONDARYCEXCODES: coldfusion.sql.QueryColumn@4d73c708] [PEAKMONTHS: coldfusion.sql.QueryColumn@23b769ad] [PEAKMONTHSDESC: coldfusion.sql.QueryColumn@4b239a04] [LOCALNEWSSOURCE: coldfusion.sql.QueryColumn@2379f0a0] [AUDIENCEIMAGE: coldfusion.sql.QueryColumn@70e13840] [SELECTEDHEALTHCARE: coldfusion.sql.QueryColumn@6803ddf0] [IAB: coldfusion.sql.QueryColumn@3fa7894e] [COMPOSITION: coldfusion.sql.QueryColumn@53b792ea] [OMITCOMPOSITION: coldfusion.sql.QueryColumn@2a6d83e4] [PRIMARYPURCHASEINTENT: coldfusion.sql.QueryColumn@5c772704] [SUPPRESSGENDERAGE: coldfusion.sql.QueryColumn@5f19383d] ]} Whereas, if we dumped the data out directly, with no caching, or from EHCache, we'd get a typical CF object such as: Is there a setting for Redis or CF to enable the caching of all CF data types and/or larger objects?
... View more
‎Oct 08, 2024
11:09 AM
It could be session management issue? Especially with the number of bots crawling sites these days. For every bot that hits, CF will create a session. If those sessions don't expire, they keep building up and taking memory. We had this issues not too long ago. First, try reducing the length of time your seesions stay active. You can do this in the Application.cfc file. For instance, here would be a setting for a 20 minute session: <cfset THIS.sessiontimeout=CreateTimeSpan(0,0,20,0) /> In addition, you can stop bot sessions altogether by testing to see if the session cookie exists, since bots don't use cookies. Put this in your Application.cfc file. <cfif StructKeyExists(cookie, "cfid") or StructKeyExists(cookie, "jsessionid")>
<cfset THIS.sessiontimeout=CreateTimeSpan(0,0,20,0) />
<cfelse>
<cfset this.sessiontimeout = CreateTimeSpan(0,0,0,3) />
</cfif>
... View more
‎Sep 19, 2024
07:29 AM
OK, I thought that may be an easy fix but I guess not. So, CFCs are usually not used in the manner you've shown....at least in my experience. In your case, it would be best to add the CFC as an Object with something like this: <cfobject name="zipObj" component="zip"> I don't see any code in your CFM page that is actually using the functions in the CFC file, but you said you only included part of it? Anyway, then find the places in the CFM that are calling the CFC functions and change the calls so they use your new object. For instance: <cfset zipObj.createZip(arg1,arg2)>
... View more
‎Sep 19, 2024
06:15 AM
Try adding output="false" to the function tags in the CFC.
... View more
‎Sep 19, 2024
05:39 AM
Can you show us the code of the CFM and the CFC files?
... View more
‎Aug 27, 2024
09:29 AM
1 Upvote
This does sound bizarre. Try a direct email to Adobe CF support. I've found them to be remarkably responsive. cfsup@adobe.com
... View more
‎Aug 20, 2024
06:03 AM
1 Upvote
What account is your ColdFusion service running under? It might not have permissions to access the node directory? You could try putting your node commnd in a batch file and then use CFExecute to run that. <cfexecute name="C:\myNodeCommand.bat"> I might also suggest a different app, altogether. To my knowledge, it the same engine CF uses in its HTMLTOPDF engine: https://wkhtmltopdf.org/ We use this all the time for site screenshots. Running it from the command line gives us much more flexibility and control than Adobe's tag. It can do PDFs or images. <cfexecute name="C:\Program Files\wkhtmltopdf\0.12.6\bin\wkhtmltopdf.exe" arguments="#yourOptions#"> </cfexecute> <cfexecute name="C:\Program Files\wkhtmltopdf\0.12.6\bin\wkhtmltoimage.exe" arguments="#yourOptions#"> </cfexecute> All the command-line options are here: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt
... View more
‎Aug 15, 2024
08:32 AM
We're running some tests and were wondering if code inside a CFTHREAD block actually runs the calling page's Application.cfc file? Our initial throught is: no. We've run a couple tests to indicate the answer is: no. But, I thought I'd post the question here since we found no documentation online on the matter. Our test involved putting a 'hit counter' in an Application file's onRequest() method to log page hits to a DB. We then ran a CFTHREAD block on the page. The hit count showed just one page hit which, to us, would indicate only the page-level thread hit the application file and not the CFTHREAD invoked. Is this a sound experiment? Thanks, all
... View more
‎Jun 12, 2024
09:44 AM
Is there a way to set that CFMX_COMPAT flag as an application variable? I know this has been possible in the past with other Java flags. I ask because we have a potential issue we need to look at but don't want to apply the flag server-wide while the team looks into the issue.
... View more
‎May 23, 2024
06:01 AM
1 Upvote
Day 12
... View more
‎May 22, 2024
06:40 AM
You could always ask ChatGPT to rewrite that Java code for use in ColdFusion. 🙂
... View more
‎May 21, 2024
10:26 AM
1 Upvote
Well, it's been 10 days since your post and I don't see it. Why on earth would you remove the previous guide?
... View more
‎Apr 26, 2024
05:58 AM
I have not used DataTables for editting, sorry. I'm no help there. I might suggest you look at DHTMLX Spreadsheet. I have not used their spreadsheet product, but I have used some of their other products and they are excellent.
... View more
‎Apr 24, 2024
05:37 AM
According to Adobe, CFGrid was "retired" in CF2018. Check out DataTablesJS. It's super easy and customizable.
... View more
‎Mar 20, 2024
08:04 AM
BKBK's suggestion is the method we use most of the time, as well, in cases like this. In some situations, where you don't want to potentially show the users the contents of an error message, (continuing to use BKBK's method) you can put the DUMP into a CFMAIL and email the error to yourself.
... View more
‎Mar 12, 2024
12:44 PM
Charlie, Thanks, per usual, for your swift and thorough responses. The CF community owes much to the work you do to keep us informed
... View more