apache - ColdFusion 11 REST 返回 404

标签 apache rest coldfusion coldfusion-11

我似乎根本无法让 CF REST 工作。 在逐字尝试文档和几篇文章后,我得到了 404。

我正在使用 apache - 根据其他帖子, JkMountFile“C:/ColdFusion11/config/wsconfig/1/uriworkermap.properties” 可能需要 - 我添加它只是为了以防万一,但这似乎没有什么区别。

APACHE 虚拟主机

<VirtualHost *:80>
    ServerName   127.0.0.1
    ServerAlias  127.0.0.1
    DocumentRoot "C:/wwwroot/CFREST2"
    ErrorLog     "C:/wwwroot/CFREST2/logs/error.log"
    CustomLog    "C:/wwwroot/CFREST2/logs/access.log" combined
    JkMountFile "C:/ColdFusion11/config/wsconfig/1/uriworkermap.properties"
    <Directory   "C:/wwwroot/CFREST2/logs/">
        AllowOverride None
        Options None
        Order allow,deny
        Deny from all
    </Directory>
</VirtualHost>

示例:

CFADMIN - registered 
Root path: C:\wwwroot\CFREST2
Host: 127.0.0.1
Service Mapping: test

文件:(C:\wwwroot\CFREST2\rest3.cfc)

<cfcomponent rest="true" restpath="restService" >

    <cffunction name="sayHello" access="remote" returntype="String" httpmethod="GET" >

        <cfset rest = "Hello World" >

    <cfreturn rest >

</cffunction>

在 postman 中发出获取请求:

http://127.0.0.1/rest/test/restService/

返回:

404

在 postman 中发出获取请求:

http://127.0.0.1/rest/test/restService/sayHello

返回:

404

我尝试了一些变体,但总是得到 404。

最佳答案

FWIW,问题提出已有 4 年多了,我已经有一段时间没有使用 CF 了,我正在尝试通过设置 RESTful 服务来解决这个问题。

我收到了 404,并在我的异常日志中看到了这一点:

java.io.FileNotFoundException: .../cfusion/wwwroot/WEB-INF/rest-skeletons/path.to.component.Fubar.class (Permission denied)

我检查过,运行该服务的帐户没有写入“rest-sculpts”目录的权限。我改变了,不再有 404,继续下一个问题!

关于apache - ColdFusion 11 REST 返回 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41964855/

相关文章:

rest - 在 Whatsapp Business api 帐户中使用不同的电话号码

http - 服务器是否应遵守 HTTP 连接 : close header sent from a client?

jquery - ColdFusion 和 AJAX - GET 403(禁止)

ssl - ColdFusion 使用多域 SSL 使用 SSL Web 服务

apache - 在 apache 服务器和 tomcat 之间设置代理的问题

java - 如何从 linux 服务器读取 geolitecity 文件路径?

apache - httpd.conf、php.ini 和 .htaccess 之间的区别

java - 如何为 Rest API 创建 SSL?

javascript - 如何通过 coldfusion 或 javascript 查找浏览器是否支持 flash 播放器?

regex - Apache .htaccess 重定向带有阿拉伯字符的 URL