The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> ColdFusion Development
|
CF9 "Hang"
Discuss CF9 "Hang" in the ColdFusion Development forum on Dev Shed. CF9 "Hang" ColdFusion Development forum discussing CFML coding practices, tips on CFML, and other CFML related topics. Find out why ColdFusion is the tool of choice for many e-commerce developers.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 25th, 2013, 06:37 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
|
CF9 "Hang"
My flash program uses a CFC to form an email and a PDF attachment and then sends it via CFMAIL. On my test system, this works fine but the production system is having problems such that the CFC never returns to the Flash program. By inserting various CFLOG statements in the CFC, it would seem that it hangs in the PDF creation phase. I tried simplifying the PDF to a couple of lines but to no avail. Then, I re-started the CF Server and was able to send an email, in original format, but only one. I had to re-start CF in order to send another and so on. There are many web examples of people having similar issues but none of their solutions have so far helped.
|

January 25th, 2013, 08:15 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
I'd start by looking at the web server and CF logs on the production system. If that reveals nothing, thoroughly compare everything you can between your test system setup and the production system setup. That means all CF administrator settings, JVM settings, IIS/Apache settings, Windows settings/RAM/memory, version numbers and patch level on CF/IIS/Apache/Windows, and so on. If it works on test but not on production, then something must be different between the two.
Last edited by kiteless : January 25th, 2013 at 08:17 AM.
|

January 28th, 2013, 12:43 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
|
kiteless - again, thanks. Lots of comparison checking, as per your advice, and experimentation on the server has shown that the problem is definitely in the pdf creation (cfdocument). The server is SBS2008 whilst my test box is XP and the application does not use a browser. Flash talks to coldfusion which has the db (mySQL) attached. Flash calls a CFC SENDeMAIL which invokes another CFC called CREATEPDF which creates the PDF and puts it in a variable which is passed back to SENDeMAIL to be an attachment to CFMAIL. If I don't do CREATEPDF, the simple email always sends. If I attach a previously created PDF, the email sends. It's only when I use CREATEPDF that I get a problem. It seems that SBS2008 is doing something differently. I restart CF and I can send the email with the CREATEPDF attachment but if I then try to send it again, it "hangs" in CREATEPDF requiring a CF restart. It's like CF has been corrupted in someway.
|

January 28th, 2013, 08:50 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
It's possible...it's also possible that the code that's creating the PDF is doing something that is screwing things up for subsequent attempts to create the PDF.
It always helps in cases like this to try and create a web-based test page that will call your CFC. That way you can test things more easily, use cfdump to view debug output, etc.
|

January 28th, 2013, 08:52 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
Also, it obviously goes without saying that you really should try to mirror the production environment when you test. An easy way to do this is use something like VMWare Workstation to set up a local virtual machine running SBS 2008.
|

January 29th, 2013, 01:47 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
|
kiteless, as ever you make good points. A further difference between the test and production environments is that production has a purchased copy of CF9 whilst test has a developer version.
I've been at this all day. Eventually, I created a small Flash program which I run in the browser and it calls my CREATEPDF cfc to create a 1 line pdf and save it in cf9's wwwroot/cfc folder. This works perfectly in test but in production it "hangs" on the CFDOCUMENT statement. How to debug this further? Is there some sort of trace I can use?
UPDATE: When we create a PDF "in memory", does it write a file, albeit temporary? It occurs to me that this may be the first time that I've used CF to write a file.
Last edited by new2cfrb : January 29th, 2013 at 07:38 AM.
|

January 29th, 2013, 08:21 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
It may write a temporary file automatically to CF's temp directory, but I'm not sure why that would matter unless you think it's a permissions issue?
|

January 30th, 2013, 08:04 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
I guess there is a lot of clutching at straws. I did find well documented examples of my exact problem being experienced in cf7 but nothing later. I have borrowed an sbs2003 server on which I can experiment further but I'm not sure I can install sbs2008.
The cfc which fails is a very simple "in memory" model:
Code:
<cffunction name="createAndSavePDF" access="remote" output="yes">
<cflog text="createAndSavePDF: Starting cfsavecontent!">
<cfsavecontent variable="doc">
<p>This is a test</p>
</cfsavecontent>
<cflog text="createAndSavePDF: Starting cfdocument!">
<cfdocument format="pdf" filename="poPDF.pdf" overwrite="yes">
<cfoutput>#doc#</cfoutput>
</cfdocument>
<cflog text="createAndSavePDF: Finished!">
<cfset replyStruct.status = "ALLOK">
<cfreturn replyStruct>
</cffunction>
I see the first 2 log outputs but not the third and there seems to be no excessive cpu consumption.
|

January 30th, 2013, 04:09 PM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
Have you checked the CF server logs to see if any errors have been logged? You could also try wrapping the cfdocument tag in a try/catch block and log any errors.
|

February 4th, 2013, 02:10 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
|
kiteless: Yes, logs checked and I had the try/catch there but to no avail because it never failed - just "hung". Setting up my test server was not going to be quick so, short of time and with production stalled, I had to find a workaround and I did. A rapid "learning" phase and I created a workable, though far from perfect, CFSCRIPT containing iText commands. Users can now create and email PDF's which can be printed by the recipient. There is a downside though and please tell me if this should be a separate thread. To print the PDF, the CFC uses CFPRINT but CF9 won't pick up the default printer. So, I specify a printer in the CFPRINT but this printer is not installed on this machine as there is no 64bit driver, so it's shared from another computer - CF9 doesn't pick it up in it's list of printers and the command fails rather badly.
I'll close this and open a new thread.
Last edited by new2cfrb : February 4th, 2013 at 10:37 PM.
|

February 12th, 2013, 05:57 AM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
|
Solved!
Since updating to Java 1.6.0_38, cfprint no longer hangs.
|

February 12th, 2013, 08:28 AM
|
|
Moderator
|
|
Join Date: Jun 2002
Location: Raleigh, NC
|
|
|
Great, even though that SEEMS to me like something else was going on then. CF 9 came out way before Java 6 u38, so I can't imagine there is something "magic" in that particular Java update that fixes a CF issue.
|

February 12th, 2013, 04:59 PM
|
|
Contributing User
|
|
Join Date: Oct 2009
Posts: 60
Time spent in forums: 11 h 45 m 32 sec
Reputation Power: 4
|
|
|
kiteless, my feelings exactly, it's been working on xp under 1.6.0_16 for a while. Yes, the server has a very different software environment but....how far do I take this? I'd really like to find the cause but...got to get on...other challenges, etc.
Thank you for your assistance and patience.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|