Skip to main content
Participant
February 9, 2017
Answered

cfcompile webroot error

  • February 9, 2017
  • 1 reply
  • 833 views

I'm getting the following error when trying to use cfcompile: "Webroot specified does not exist"

This is the command I've used: 

cfcompile –deploy D:\website D:\website\cfcompilein D:\website\cfcompileout

My default website which I would think would be my webroot is defined in IIS as D:\website. I've defined the same path as "\" in CF mappings.

ColdFusion is installed in C:\coldFusion2016

I'm getting the same result on our CF9 installation.

Any idea what I'm doing wrong?

Thanks

Bob

This topic has been closed for replies.
Correct answer bobk07

Strange. I wouldn't go looking into server.xml. Instead, I would look at C:\coldFusion2016\cfusion\bin\cfcompile.bat. There is a possible workaround.

Open the cfcompile.bat file in a text editor. Copy all its contents into a new file, which you then save, as MYcfcompile.bat, in the same directory.

Now, locate in MYcfcompile.bat the code the following code excerpt:

:sourceless_deploy

set webroot=%~f2

set srcdir=%~f3

set deploydir=%~f4

Modify this excerpt to

:sourceless_deploy

set webroot=C:\ColdFusion2016\cfusion\wwwroot

set srcdir=C:\ColdFusion2016\cfusion\wwwroot\cfcompilein

set deploydir=D:\website\cfcompileout

Then run (in DOS):

MYcfcompile -deploy C:\ColdFusion2016\cfusion\wwwroot C:\ColdFusion2016\cfusion\wwwroot\cfcompilein D:\website\cfcompileout


Found the problem. It turns out that the dash in front of -deploy was a long dash not a normal dash. I think I picked up when copying the command line from a web page. So of course the test for "%arg1%"=="-deploy" would always fail. Your suggestion to edit the batch file put me on the right track.

Many thanks for your help.

Bob

1 reply

BKBK
Community Expert
Community Expert
February 9, 2017

Copy the directory containing the files to be compiled, cfcompilein, to the root, C:\coldFusion2016\cfusion\wwwroot. The cfcompile tool is located in C:\coldFusion2016\cfusion\bin. So open MS DOS and change directories till you get to C:\coldFusion2016\cfusion\bin.

Then run

cfcompile -deploy C:\ColdFusion2016\cfusion\wwwroot C:\ColdFusion2016\cfusion\wwwroot\cfcompilein D:\website\cfcompileout

bobk07Author
Participant
February 10, 2017

Thanks,

I tried that suggestion and I still get the same error: “Webroot specified does not exist”

I would have thought that the "webroot" would be the path to the default website as defined in IIS, i.e., D:\website, but it doesn't like that either.

Maybe it needs to be defined somehow to Java, e.g.  in server.xml, just not sure how. I'm hesitant to touch anything though because CF is working fine and using the default website.

Bob

BKBK
Community Expert
Community Expert
February 11, 2017

Strange. I wouldn't go looking into server.xml. Instead, I would look at C:\coldFusion2016\cfusion\bin\cfcompile.bat. There is a possible workaround.

Open the cfcompile.bat file in a text editor. Copy all its contents into a new file, which you then save, as MYcfcompile.bat, in the same directory.

Now, locate in MYcfcompile.bat the code the following code excerpt:

:sourceless_deploy

set webroot=%~f2

set srcdir=%~f3

set deploydir=%~f4

Modify this excerpt to

:sourceless_deploy

set webroot=C:\ColdFusion2016\cfusion\wwwroot

set srcdir=C:\ColdFusion2016\cfusion\wwwroot\cfcompilein

set deploydir=D:\website\cfcompileout

Then run (in DOS):

MYcfcompile -deploy C:\ColdFusion2016\cfusion\wwwroot C:\ColdFusion2016\cfusion\wwwroot\cfcompilein D:\website\cfcompileout