Issue with stopping ColdFusion after starting from Builder

With the release of ColdFusion Builder there is an option available that provides the ability to start and stop one or more ColdFusion servers from ColdFusion Builder. In fact, you can configure CF Builder to automatically start a CF server when Builder opens, and stop the CF server when Builder closes. The autostart/autostop is convenient for a Development box where you want to minimize resource usage on the system. You can read more about this feature here.

Server Panel in ColdFusion Builder
Server Panel in ColdFusion Builder

Server Settings Panel in ColdFusion Builder showing Auto start/stop for CF Servers
Server Settings Panel in ColdFusion Builder showing Auto start/stop for CF Server

However, if you don't enable the automatic stop/start option, if you ever start ColdFusion server from Builder then close Builder without stopping ColdFusion there, then later you will not be able to stop the ColdFusion server using the standard ColdFusion stop script. I've encountered this on Mac OS X, but since its possible to configure CF Builder to start/stop remote CF servers, it's likely that the problem might occur when using ColdFusion server on Linux or Solaris as well, even though Builder doesn't run on those platforms.

Normally, to stop / start the ColdFusion server from the command line, you would the control script located (typically) at /opt/coldfusion9/bin/coldfusion, such as with ./coldfusion stop. That control script in turn invokes /opt/coldfusion9/runtime/bin/coldfusion9. When calling stop, the control script works by first grepping for any running ColdFusion processes with fgrep, like this: ps -axc | fgrep coldfusion9. If it finds a process listing that matches for the string "coldfusion9" then it stops that process.

Here's what you might see if you try to restart ColdFusion from the command line after it was started but not stopped from Builder:

view plain print about
1$ /opt/ColdFusion9/bin/coldfusion restart
2Restarting ColdFusion 9...
3ColdFusion 9 does not seem to be currently running
4Starting ColdFusion 9...
5The ColdFusion 9 server is starting up and will be available shortly.
6There has been an error starting ColdFusion 9, please check the logs.


The problem of not being able to use that control script to stop ColdFusion server after having started it from Builder arises because of how Builder starts the CF server. Rather than invoking /opt/coldfusion9/runtime/bin/coldfusion9, Builder instead invokes /opt/coldfusion9/runtime/bin/jrun. When the control script tries to grep for the process with a "coldfusion9" string, the control script doesn't find it because Builder invoked runtime/jrun instead of runtime/coldfusion9.

Why the need for runtime/jrun AND runtime/coldfusion9? I have no idea, especially since the files are identical and not symlinked.

view plain print about
1$ pwd
2/opt/ColdFusion9/runtime/bin
3$ diff jrun coldfusion9
4$




I logged ColdFusion server bug 82573 for this where I proposed a change to the bin/coldfusion control script. My suggested change was only shown for Mac OS X, but you can easily change it yourself for the Linux or Solaris blocks in a similar way.

If you want to use my suggested fix on your local Mac OS X dev box, then you can refer to the full example control script containing the fix here: http://pastebin.com/Y7r6sDGu.

For brevity, I won't show the whole script in this blog entry. Instead, here's the diff between the backed up original coldfusion control script which I renamed to 'orig.coldfusion' compared to the fixed version 'coldfusion'.

view plain print about
11.    $ diff orig.coldfusion coldfusion
2    2.    13a14
3    3.    >
JRUN_BIN="${CF_DIR}/runtime/bin"
4    4.    34c35
5    5.    < ⬠ ⬠ ⬠ ⬠ $PSCMD | fgrep coldfusion9 ⬠> /dev/null 2>&1
6    6.    ---
7    7.    > ⬠ ⬠ ⬠ ⬠ $PSCMD | grep -i $JRUN_BIN | grep -v 'grep' > /dev/null 2>&1
8    8.    117c118,119
9    9.    < ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ $PSCMD | fgrep coldfusion9 | awk '{print $1}' | xargs kill -9 > /dev/null 2>&1
10    10.    ---
11    11.    > ⬠ ⬠ ⬠ ⬠ ⬠ $PSCMD | grep -i $JRUN_BIN ⬠| grep -v 'grep' | awk '{print $1}' | xargs kill -9 > /dev/null 2>&1
12    12.    > ⬠ ⬠ ⬠ ⬠ ⬠
13    13.    130,131c132,133
14    14.    < ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ $PSCMD | fgrep coldfusion9 | awk '{print $1}'
15    15.    < ⬠ ⬠ ⬠ ⬠ fi
16    16.    ---
17    17.    >
⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ $PSCMD | grep -i $JRUN_BIN ⬠| grep -v 'grep' | awk '{print $1}'
18    18.    >
⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ fi
19    19.    152c154
20    20.    < ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ PSCMD="ps -axc"
21    21.    ---
22    22.    >
⬠ ⬠ ⬠ ⬠ ⬠ ⬠ ⬠ PSCMD="ps -ef"

Starting ColdFusion9 Solr: Using cfsolr in same directory

The cfsolr script for Mac, Linux, and Unix is written such that you must be in the ColdFusion9/solr/ directory when running the script. The script refers to the start.jar file without providing the full path.

The problem is that if you are not in the solr/ directory under the ColdFusion root directory, the cfsolr script echos that Solr has been started or stopped, even though it has not.

Since the standard error is redirected to the standard out with "2>&1" the problem is swallowed and the person performing the operation is led to believe that the operation has been carried out as expected.

Here's a snippet from the ColdFusion9/solr/cfsolr script showing that start.jar is referenced without a full path:

view plain print about
1SOLRSTART='nohup java $JVMARGS -jar start.jar > $SOLR/logs/start.log 2>&1 &'
2SOLRSTOP='nohup java $JVMARGS -jar start.jar --stop > $SOLR/logs/start.log 2>&1'




Looking at the logs, I see that the problem was quietly recorded in a solr log file:

view plain print about
1QAs-iMac:logs QA$ pwd
2/opt/ColdFusion901/solr/logs
3QAs-iMac:logs QA$ cat start.log
4Unable to access jarfile start.jar




The script already has a variable defining the Solr directory path:

view plain print about
1SOLR="/opt/ColdFusion9/solr"




To fix the bug, prefix the reference to start.jar with ${SOLR}/start.jar like this:

view plain print about
1SOLRSTART='nohup java $JVMARGS -jar ${SOLR}/start.jar > $SOLR/logs/start.log 2>&1 &'
2SOLRSTOP='nohup java $JVMARGS -jar ${SOLR}/start.jar --stop > $SOLR/logs/start.log 2>&1'




With that fix, the cfsolr script can be called from any directory outside the solr directory.

Here is an examle of how the script falsely echos that the solr server has stopped or started when it has not (determined by grepping for the process):

view plain print about
1QAs-iMac:opt QA$ pwd
2/opt
3QAs-iMac:opt QA$ ./ColdFusion9/bin/coldfusion stop
4Stopping ColdFusion 9, please wait
5Stopping coldfusion server.stopped
6ColdFusion 9 has been stopped
7QAs-iMac:opt QA$ ps -ef | grep solr
8 501 73310 1 0 0:00.25 ?? 0:02.64 /usr/bin/java -XX:+AggressiveOpts -XX:+ScavengeBeforeFullGC -XX:-UseParallelGC -Xmx256m -Dsolr.solr.home=multicore -DSTOP.PORT=8079 -DSTOP.KEY=cfsolrstop -jar start.jar




view plain print about
1QAs-iMac:opt QA$ ./ColdFusion9/solr/cfsolr start
2Starting ColdFusion Solr Server...
3ColdFusion Solr Server is starting up and will be available shortly.
4QAs-iMac:opt QA$ ps -ef | grep solr
5 501 78371 62961 0 0:00.00 ttys000 0:00.00 grep solr
6QAs-iMac:opt QA$ ps -ef | grep solr
7 501 78373 62961 0 0:00.00 ttys000 0:00.00 grep solr
8QAs-iMac:opt QA$ ps -ef | grep solr

Adobe LiveCycle DataServices for ColdFusion at CFObjective

Allaire's CEO, David OrfaoAfter a decade of working intensely with the ColdFusion server, I'm finally getting the courage to start presenting about it on the conference circuit. As a blogger, tweeter, and contributor to mailing lists I'm very confident helping others solve ColdFusion related problems because I can do that from the quiet comfort of my own desk. However, one of my greatest fears has always been public speaking. I'm the kind of person that feels like I need to know the subject matter cold, so that I can speak from the hip without relying on looking at the slides.




Blackstone Test CDsOver the years, I had some opportunities to present to small groups, and I recall each time feeling the adrenalin surge and my heart pounding. That started with presenting ColdFusion for Unix and Linux as an internal training class at Macromedia. Later, while taking classes at the Harvard Extension School, I was honored to be asked to present to CSCI-253 Developing Web-Based Database Applications. Even more so, I presented twice there in one year. The first time on Building ColdFusion Web Applications with CFEclipse and Dreamweaver, and later on ColdFusion Server Administration




MAX in ActionI've been attending ColdFusion conferences since the days of Allaire DevCon, but had never presented at any of them including MAX. My long time friend in the local ColdFusion Community, Brian Rinaldi, continued to encourage me to present at the local Boston CFUG as a starting point, as well as the new conference that he was organizing, RIA Unleashed, held in Bentley College this past November. The members of the CFUG were kind enough to let me present a draft of a presentation that I was to later give at RIA Unleashed. My presentation topic was Adobe LiveCycle DataServices Data Management for Mere Mortals


ColdFusion 1.5 on Floppy DisksFortunately at RIA Unleashed I was among the very first sessions after the keynote, so there was no time to build up butterflies that morning. If beforehand you would have told me that among the audience front row would be Ben Nadel, Simon Free, and Ray Camden with Tom Jordahl tucked way in the back then I surely would have freaked out. But they were both kind enough to chat with me before hand and even lend some technical assistance getting setup with the A/V, so that really put me at ease. With a firm limit of 50 minutes, I pushed all the way through what should have been a 90 minute talk, all the while trying to remember to speak clearly and loudly. The talk went off pretty much without a hitch as I found myself completely focused on the technical content and not at all worrying about the large room filled with people in front of me. I was delighted at the end when Tom complemented me on talk, which to me was the ultimate satisfaction.




First Unix machine to run ColdFusionI chose LCDS for ColdFusion as a topic because while I was a QA Engineer on the ColdFusion team at Adobe, I was paired with Tom, a Computer Scientist at Adobe who architected the integration between the products. Heck, Tom architected much of ColdFusion itself, and was in fact the original engineer to have ported ColdFusion to run on Unix and Linux back in the day. Tom is a font of information, and I cut my teeth on the feature under his guidance, which was then known as Flex Data Services and later renamed under the LiveCycle brand. I spent many days last summer and fall revisiting all the LCDS documentation again to ensure the quality of my presentation and to mentally prepare me for the upcoming conference.




ColdFusion Team, BangaloreWIth my first conference under my belt, I decided to throw my hat into the ring for the ultimate ColdFusion experience, CFObjective, which is promoted as The Only Enterprise ColdFusion Conference. I'm excited to announce that I have been selected to be a speaker at the conference, which runs from April 22-24th in Minneapolis, Minnesota. The conference is divided into three tracks for technologies related to ColdFusion. I'll be speaking the last day in the Flex track, once again on the topic of LiveCycle DataServices for ColdFusion Developers. Specifically I'll be talking about the prime feature of LCDS, the Data Management capabilities. With any luck I'll be updating my presentation to consider the benefits of working with the latest versions of Adobe software. Here's the brief description and the PDF:




Discussions of Adobe's LiveCycle Data Services are often entered with the same trepidation as those of Organic Chemistry or Quantum Mechanics, but with ColdFusion, building Web applications that manage complex data sets doesn't have to be that scary. Data Management is a pillar of LCDS that offers scalable, real-time data synchronization across very large numbers of connected clients with the benefits of conflict resolution and data pagination.† Come learn how to quickly get up to speed with Data Management by letting ColdFusion do the hard work for you.


If you're seriously interested in ColdFusion, then CFObjective is the conference for you. I hope to see you there.






ColdFusion Screams

Recent Tweets for Fri Oct 2, 2009

Follow me on Twitter!



Fri Oct 02 7:26 PM
Ghosts of ColdFusion Past http://yfrog.com/3omigoj
Fri Oct 02 4:40 PM
@john_mason_ Thanks. Indeed, the server was under high load.
Fri Oct 02 4:21 PM
Ditto that! RT @awest: Working at home really blows. Not. http://bit.ly/UflXy
Fri Oct 02 3:44 PM
@charliegriefer Enjoy! Twitter is gonna have a melt down. #adobeMAX
Fri Oct 02 3:12 PM
Have you ever launched the ColdFusion Server Monitor and seen the buttons for Monitoring, Profiling, and Memory just not show up at the top?




[More]

Recent Tweets for Fri August 28, 2009

Follow me on Twitter!





Fri Aug 28 8:52 PM
Why is it that ColdFusion must be started by a privileged user on every operating system but Mac? Hmph!
Fri Aug 28 8:43 PM
@shutupdanielle Could be worse, you could be in Bolton. 2 pizza shops, that's it. Nary a chicken wing in sight (really).
Fri Aug 28 8:36 PM
@mobarger Big city turn me loose, set me free, somewhere in the middle of Montana
Fri Aug 28 8:08 PM
@styggiti Outside temp last night was 52F here, but not sure which is better lower temps or lower humidity.
Fri Aug 28 5:43 PM
ColdFusion 9 (& ColdFusion 8.01) bug for CF Multiserver's bin/cf-init.sh file. Please vote: http://bit.ly/MsgCT
Fri Aug 28 4:56 PM
Yep, verified the 3 issues with the Solaris part of the cf-init.sh boot script installer for ColdFusion 9. Oh, bugtracker.....


[More]

Recent Tweets for Fri August 14, 2009

Follow me on Twitter!





Thu Aug 13 11:30 PM
"All Washed Up", new photo in the Trash The Dress series. #photog #photoshop http://flic.kr/p/6Px1MC
Thu Aug 13 2:48 PM
RT @iotashan: queries in cfscript is as bad as doing queries in any other lang. cfquery will always be superior to Query() in ease of use
Thu Aug 13 2:47 PM
@Photocritic In digital imaging half the data is in highlights & can be recovered PDFs: http://bit.ly/1ReSZ http://bit.ly/11osFd
Thu Aug 13 12:31 PM
@stevei Great posing on Paige for the lying down, forward shot. Would have been nice to have some more crash to the waves. #TTD #Photog






[More]

Recent Tweets for Friday July 17, 2009

Follow me on Twitter!

Fri Jul 17 1:15 AM
@scouten Fascinating! BTW, if u ever need LR3 beta testers, sign me up. (I won the Adobe contest for most bugs logged against PS Express)
Fri Jul 17 12:59 AM
@ashumittal Feeling a lot like Thursday night here! ;-)
Fri Jul 17 12:52 AM
@scouten Yikes! Didn't know that. A 4 year dev cycle must have been grueling (but finally rewarding)
Fri Jul 17 12:43 AM
@scouten Wasn't Lightroom 1 released Feb 2007? Macr/Adobe deal closed Dec 2005. Well, as Flex dev, my fingers are crossed for MXML in LR3
Fri Jul 17 12:37 AM
@scouten What got me thinking was PatchPanel which enables Flex developers to write plugins for CS4. WIshing could do that with Lightroom.
Fri Jul 17 12:33 AM
Passing the night by watching @benforta videos on ColdFusion 9 (again) http://bit.ly/Qz4Yv




[More]

Recent Tweets for Fri July 10, 2009







Fri Jul 10 1:57 PM
Happy Friday! A few backlogged portraits updated. Lydia and Ms Asphyxia http://flic.kr/p/6DDjss http://flic.kr/p/6DDjt3 #photog
Fri Jul 10 12:59 PM
@remotesynth Nice, I didn't even know Cringely was still writing columns since he parted with PBS. I used to read them every week.
Fri Jul 10 12:41 PM
@chrisadragna This is old news since Labs was first published under Macromedia. Wiki was a canned app, and a better one in CF didn't exist
Fri Jul 10 12:38 PM
New Portrait: Twelve Feet (@tangon) #photog #photo http://flic.kr/p/6DBkmU (posting again for Left Coast peeps just waking up)
Fri Jul 10 12:05 PM
According to @klout, I'm influential to these peeps: @stevei @claymgarrett @styggiti @coldfusionPaul @ranarula. http://bit.ly/14VD7D
Fri Jul 10 11:45 AM
@photonconcepts Thanks for the #FF!
Fri Jul 10 10:51 AM
New Portrait: Twelve Feet (@tangon) #photog #photo http://flic.kr/p/6DBkmU
Fri Jul 10 9:54 AM
Oh no, Geocities is closing. Sniff. That was my first place on the web back in 1994. I'm gonna miss my blink tags.
Thu Jul 09 10:03 PM
According to @klout, I'm influenced by these peeps: @demirkapi @ryanstewart @cfjedimaster @reboog711 @jeffcrossphoto. http://bit.ly/14VD7D
Thu Jul 09 9:16 PM
If my brain were as big as @pfreitag's I would be serious danger of having my head explode into a million bits




[More]

Recent Tweets for Wed July 01, 2009

Recent Tweets for Wed July 01, 2009

Wed Jul 01 2:59 PM
Thx @fuzzyorange . Looks like a known condition with its own JVM flag http://bit.ly/UYzMh -XX:-UseGCOverheadLimit
Wed Jul 01 2:56 PM
@dfgrumpy Thx. Its the "GC overhead limit exceeded" part I've never seen before. Researching now. Might be a new verbiage, nothing more.
Wed Jul 01 2:50 PM
First time I've ever seen this in ColdFusion: java.lang.OutOfMemoryError: GC overhead limit exceeded
Wed Jul 01 2:48 PM
@awest @cfaddict minus ~30% in taxes of course.
Wed Jul 01 2:37 PM
@mvanleest Linux, CF80 RedHat 5. I'm thinking its a large cf.registry file for client storage since cf startup pauses at "Starting client"


[More]

I'm Twittering This! or Dude, Where's My Blog?

As you may have noticed, TalkingTree.com blog is rather barren these days. I find that while I work, while I relax at home (that is when I'm not working at home), or even when I'm mobile I'm nearly always using Twitter, and less so Facebook.

Unless you've been living under a rock you've heard of Twitter by now. If you're still not sure, Twitter is a bit like group chat where you post a short summary of what you're doing or what's on your mind, and other people that are interested can reply. While I'm not going to explain Twitter fully here -- you can find that on Twitter.com -- it can be very useful for sharing up to date information about a particular interest with lots of other people that share that interest. Most of my Tweeps fall into one of several interest groups... There's those interested in Photography, those interested in Web Technology, and those that happen to otherwise be friends or family. There are several applications you can use to watch Twitter updates. My favorite for use on a computer is TweetDeck, and on my iPhone I use Twitterific. One reason to love using an iPhone with Twitterrific is that I can be anywhere, shopping, getting a haircut, or at a conference and have the ability to take a cell phone picture for upload to Twitter with a brief description about what's going on.

Twitter and Facebook are such interesting places to socialize online while sharing information that I've neglected my blog for quite some time. To address that problem, I'll be posting summaries of recent Tweets to my blog here where you can catch up on some of the things I've been talking about. Although, this is a bit like sitting next to someone that's on the phone since my Tweets here are only half the conversation some time. To get the full benefit of Twitter you really have to follow both sides of the conversation.

To accomplish updating this blog with my Tweets, I whipped up a quick ColdFusion script to pull in my Twitter RSS feed and convert to HTML with all usernames and URLs converted to actual links. I'll next try to automate this so that my blog gets regularly updated with my Twitter summaries.

Of course, if you're already on Twitter, Follow Me, and on Facebook Add Me as a Friend.

How to read tweets

  • If a tweet begins with an at sign, its a username, like @JoeSchmoe. Its at the beginning because I'm replying to something that Joe Schmoe tweeted earlier.
  • If a @username appears later in the tweet but not at the beginning, then i'm refering to that user, like Hey, did you see that cool widget that @JoeSchmoe built?
  • If a tweet begins with RT, that means Re-Tweet, and its kinda like holding up a megaphone. On Twitter you Follow or subscribe to certain people, and in turn other people follow you. The people that subscribe to your tweets may not be following the people that you subscribe to. So by retweeting someone that you subscribe to, you are amplifying that persons tweet by broadcasting to all the people that subscribe to you. Confused yet? If your subscribers are interested in the retweet, they may then follow that original person (a.k.a tweep or twit).
  • If a tweet has a word beginning with a pound sign like #photog, that's called a hashtag. Hashtags are used as labels to identify a topic for your tweet. Later people can search by hashtags to see tweets from everyone that talked about that topic. In this case, #photog means the tweet is about photography or a photographer. This in contrast to #photo without the last 'g' and it is used for tweets about a particular photo.


Recent Tweets for Mon June 29, 2009



Mon Jun 29 10:09 PM
2 nights in a row my son doesn't want to sleep coz he's not feeling well. Long nights of frequent rocking, not much sleep for me.
Mon Jun 29 4:45 PM
@JoshuaCurtiss Pretty sure it was CF5 -> CF6 w/ the J2EE conversion. I was on the team at Macromedia that reviewd poss bkwds compat issues
Mon Jun 29 4:39 PM
@jlamoree Holy cow, a fradulent Lactating Lesbians infringement claim from Cream Ridge, NJ. That just, em, *sucks*!
Mon Jun 29 12:52 PM
@jonbcampos Apache XSL-FO http://bit.ly/Xrhar


[More]

More Entries