Copy link to clipboard
Copied
I'm coding a CF11 application on a Windows virtual machine. I made the mistake of seeing the orange icon flashing telling me I needed to do a Java update. After running through the update and restarting everything, the Coldfusion Application did not start. I got the "Service Not Avaialble" error in the browser. So I tried restart the Coldfusion Application and it wouldn't let me start it at all. Then went to Google and located these two somewhat helpful articles:
https://handyman.dulare.com/service-not-available-on-coldfusion-host-after-java-update/
https://community.hostek.com/t/coldfusion-service-startup-failures/550
On there they mentioned going into the CF files to the cfusion\bin\jvm.config file and updating the "java.home" variable with the current path to the Java directory. Which I did. That variable is now: C:\Program Files\Java\jre1.8.0_281 for me. I tried starting the Coldfusion Application again and now it tries to start, but then stops. Which is better than nothing at all, but it still doesn't work. Naturally there is no good error message. So I read that I should go into the Windows Event Viewer -> Click Windows Logs -> Click System -> and find the error message. Ok, so I did that, and the error says "The Coldfusion 11 Application Server service terminated with the following service-specific error: The system could not find the file specified". Fine, but what file? It doesn't say which file. So now I'm at the throw up my hands and yell phase of frustration. Any of you wonderful Coldfusion and JVE/JVM experts have a better answer for me than the Google search?
Copy link to clipboard
Copied
Hello,
Sounds like you are going in the right direction with editing CF "java.home" setting.
Perhaps there is an error you can't see. Try open CMD prompt as administrator then run cfstart from \cfusion\bin\ folder. Are there any errors or warnings to notice?
Regards, Carl.
Copy link to clipboard
Copied
After going to C:\ColdFusion11\cfusion\bin and running cfstart like you requested, I get this: Error loading C:\Program Files\Java\jre1.8.0_281\bin\server\jvm.dll
Copy link to clipboard
Copied
Use 2 slashes for the java.home in the jvm.config (or reverse the single slash). This is a requirement of Java on windows, not of cf.
If you saved the previous java.home value, you will see it uses this. And the resources you found should have clarified it also.
If that's not it, make sure there is the bin folder named in the error in that jvm folder you named.
Copy link to clipboard
Copied
I have tried that before, but I tried it again per your request. The java home variable is now set to: java.home=C:\\Program Files\\Java\\jdk1.8.0_281 I rebooted the Windows virtual machine. The application server still won't start. Back at the cmd promp I get this when I try to start:
PS C:\ColdFusion11\cfusion\bin> .\cfstart
Error loading: C:\\Program Files\\Java\\jdk1.8.0_281\jre\bin\server\jvm.dll
It looks like it's picking up the double slahes in the java.home path, but as Java drills down to this file it uses single slashes. Not sure if that matters or not, or even how to change it. There is a jvm.dll file in the directory and it's not empty. It's 8.35MB.
Copy link to clipboard
Copied
Hello,
You are reporting two different errors ignoring slashes for now on running cfstart:
Error loading C:\Program Files\Java\jre1.8.0_281\bin\server\jvm.dll
Error loading: C:\\Program Files\\Java\\jdk1.8.0_281\jre\bin\server\jvm.dll
Which is the error you are seeing?
Can you show your syntax for Java home in JVM.CONFIG EG:
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=D:\\Program Files\\Java\\jdk1.8.0_281\\jre
Perhaps the Java installed or that was upgraded is a JRE rather than JDK. Perhaps remove and install that again. You can get installer here:
https://download.macromedia.com/pub/coldfusion/java/java8/8u281/jdk/jdk-8u281-windows-x64.exe
Take care you are 64 bit CF11 otherwise use 32 bit install JDK.
HTH, Carl.
Copy link to clipboard
Copied
Hi @FSUKXAZ , I find Carl's suggestion to be spot-on.
Copy link to clipboard
Copied
And for more on all this (and still more to consider if you still struggle), see an old post I did that remains helpful to people to this day:
https://www.carehart.org/blog/client/index.cfm/2014/12/11/help_I_updated_CFs_JVM_and_it_wont_start
I should have offered it in my first reply, but I had hoped it was just that simple solution I'd proposed. I cover the ideas Carl had helpfully raised, and in more detail, and still others if needed.
Copy link to clipboard
Copied
I was just going through the steps that Charlie mentioned and showing the error that occured after I made the changes he reccomended. It's not 2 errors, it's just a different error now. Everyting worked fine for years with just a JRE. Maybe it's that I didn't delete the old Java JRE before doing the install and did it afterwards.
Anyways, to answer your question, it's the last error: C:\\Program Files\\Java\\jdk1.8.0_281\jre\bin\server\jvm.dll
Here is the file in it's entirety:
#
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
java.home=C:\\Program Files\\Java\\jdk1.8.0_281
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#
# 1) ../runtime/jre
# 2) registry (windows only)
# 3) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
# 4) java.exe in path
#
# Arguments to VM
java.args=-server -Xms256m -Xmx512m -XX:MaxMetaspaceSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} -Djava.awt.headless=true -Duser.language=en -Dcoldfusion.rootDir={application.home} -Dcoldfusion.classPath={application.home}/lib/updates,{application.home}/lib,{application.home}/lib/axis2,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/cfform/jars,{application.home}/wwwroot/WEB-INF/flex/jars,{application.home}/lib/oosdk/lib,{application.home}/lib/oosdk/classes -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog -Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1 -Dcoldfusion.enablefipscrypto=true -Djava.security.manager "-Djava.security.policy=C:\\ColdFusion11\\cfusion\\lib\\coldfusion.policy" "-Djava.security.auth.policy=C:\\ColdFusion11\\cfusion\\lib\\neo_jaas.policy"
# Comma separated list of shared library path
java.library.path={application.home}/lib,{application.home}/jintegra/bin,{application.home}/jintegra/bin/international,{application.home}/lib/oosdk/classes/win
# Comma separated list of shared library path for non-windows
java.nixlibrary.path={application.home}/lib
java.class.path={application.home}/lib/oosdk/lib,{application.home}/lib/oosdk/classes
Copy link to clipboard
Copied
I just did what Carl mentioned. I removed Java, and reinstalled it. It shows I now have a JDK and JRE directory in the Java directory. I've tried pointing my java.home variable to each of them. Each time restarting the server. Neither way works.
Copy link to clipboard
Copied
Here is the error from the Windows Powershell. The error is the same if I point it to one or the other. Except for the directory.
Copy link to clipboard
Copied
Hi,
Suggest edit JVM.CONFIG and add JRE to path EG:
This
java.home=C:\\Program Files\\Java\\jdk1.8.0_281
Becomes
java.home=C:\\Program Files\\Java\\jdk1.8.0_281\\jre
Refer to Charlies old blog he linked for reasons why ..\\jre from JDK.
Run cfstart from CMD or PS as admin. Lets see what happens?
Regards, Carl.
Copy link to clipboard
Copied
I tried what you suggested and still get the same error. There has to be something else. It would be best if I just offer one of you $100 to get it working by us having a zoom meeting where I can share my screen or give you control to just fix it.
Copy link to clipboard
Copied
I can't tell if you're asking that of only Carl, but I will say that yes, I can help with this in that budget, and via a screen-share. I'm available today, and you can grab a slot via my online calendar at https://calendly.com/carehart. I'm confident we'll have this running, in perhaps even less than 15 mins.
Copy link to clipboard
Copied
That sounds great. Yeah, the message was to anyone.
Copy link to clipboard
Copied
He and I are meeting in 20 mins. Hoping we'll have good news to share.
Copy link to clipboard
Copied
OK, I have an update. All's working for him now. There were a few issues, and they may interest some.
The TLDR is that first, a valuable JVM error message that would normally be shown via the command line was NOT being shown to him via powershell. And that JVM error (once we could see it) required copying a needed jvm DLL from his jdk into CF. Once fixed, since CF had been changed (for security) to run as a limited function user, it still would not run from the command line (unless that was launched "as admin"), but then things DID run as a service. Yay. And then there was a root cause reason for why CF was initially failing that led him down the rabbit hole of updating the JVM that CF uses.
For those interested, read on.
First, while some of the things he encountered were indeed covered in my blog post on troubleshooting errors when changing the JVM that CF uses, one was new to me--and I have updated the post (and in thanks for that as a lesson learned, I did not charge him for my time). And we did initially make sure the problem was not about the bit-level of CF vs that of the jvm (see more in my blog post), etc. There were basically 3 things wrong.
About the "discovery" for me, Carl had above recommended here (as I do in my post) that for the sake of diagnosing the problem he should run cfstart from the command line, to see what it may report. That so often WILL give the answer of what's amiss. And he HAD done that. But note above in his his screenshot that he opted to do that via powershell rather than the windows command prompt.
Well, as I always do in cases like this, I had him run the cfstart via the command prompt instead, and sure enough we got a popup error that he was NOT seeing when he had run it from powershell (that was new info for me).
And the error was about a missing vcruntime140.dll. That IS something I cover in my post. His new jvm was very new (1.8.0_281) compared to the original jvm that his CF 11 originally came with (1.8.0_25). We copied that dll from his jdk/'s bin folder and placed it in his cf11 cfusion/bin folder (more details in my post).
And now CF did start (from the command line). Touchdown...but wait, "there was a flag on the play". š
I noticed there were errors showing in the console. And those turned out to be permissions errors. FWIW, in our attempt to just run the cfstart from the command line, we had not thought to run the command line "as admin" (I do suggest that in my blog post, but I just hadn't thought of it when I had him open it this time. I suspected we'd get some more clear error related to the JVM, as we did, and that would indeed happen even if not run "as admin".)
As soon as I saw the permissions errors I had him look at the Windows Services and the CF service. Sure enough, someone in the past he (or some vagrant config script he thinks) had changed the CF service to run as a new cfuser. That's a good thing for security reasons, of course, and the CF Lockdown guide recommneds it.
The problem is that while that cfuser had permissions to the CF folders, his user that he was logged in as (vagrant) did not have those permissions. (Again, I discuss this matter a bit more in my blog post, also.) And that then is why we were "close, but no cigar".
The simple solution to that was that we now tried to start CF as a service, and with the JVM and DLL issue resolved, ta-da: now CF worked!
Finally, as for what caused his initial problem (that led to all this), it was a classic one, which many can learn from, and again which I cover in my post. In brief, it was this.
As he said at the outset above, in recent weeks he had gotten the java popup (in the Windows status tray) offering to update the JVM, and he took it. And that had offered to remove any old JVMs. Again, that's a good thing. The problem is that unbeknownst to him, one of those was the one that CF had been pointing to. (Someone or again some script had previously updated CF to point to a newer jvm than had come with CF itself.) And in that situation, that JVM removal process would try to remove JVM that CF was pointing to, but since CF was running, that removal would only be able to delete most but not ALL of the JVM's files. That's bad enough.
But sadly, one only notices that this has happened when they later restart CF (which may be hours, days, or weeks later), when you find that, crap, CF won't start.
As for that java prompt offering to update itself, it's worth noting that it only enables itself if you either install a JRE or install a JDK (in version 8 or earlier) that offers to implement a "pubic jre". This is in fact why I recommend NOT using a JRE (or NOT letting a JDK installer implement its offered option to implement a "public jre"). I mention this in my post also, but I then did (and point there to) a more specific post on this: Why you should think twice about leaving on the "public JRE" option of the Java JDK installer .
As I told him, it's not that everyone hits such problems when they update the JVM CF uses. It's just that in SOME situations they may well hit these various problems. Again that's why I have that encyclopedic blog post, CF911: 'Help! I've updated the JVM which ColdFusion uses, and now it won't start!'. Not everyone needs it, and not everyone will read it all, but it's there in the hopes of helping people who have been hitting problems like this for about a decade. š
Glad we were able to get him going, and hope his lessons learned may benefit others here
Copy link to clipboard
Copied
Good to hear that is working.