我在Windows 2008 R2(64位)使用CF10(64位)(开发版?)无法添加最基本的RESTful Web服务
我想实现这个非常基础教程: http://blogs.coldfusion.com/post.cfm/rest-support-in-coldfusion-part-i
我创建了一个新的网站通过IIS端口8081,然后添加两个文件:
/index.cfm(理论上,因为需要包含应用瓦尔没有的Application.cfc,我可以跳过这一点)
<cfset s = "Hello World!">
<cfoutput>#s#</cfoutput>
/RestExample/HelloWorld.cfc
<cfcomponent rest="true" restPath="/hello">
<cffunction name="sayHello" access="remote" returnType="String" httpMethod="GET">
<cfset res="Hello World">
<cfreturn res>
</cffunction>
</cfcomponent>
在CF管理员:
- 根路径:
C:/websites/test/RestExample/
- 服务映射:
Example
我得到以下错误:
Error registering REST service. Please ensure that you have entered a proper mapping and path.
Application Example could not be initialized.
Reason: The application does not contain any rest enabled CFCs.
The application does not contain any rest enabled CFCs.
的系统信息的比特:
Server Product ColdFusion
Version 10,0,8,284032
Tomcat Version 7.0.23.0
Edition Developer
Serial Number Developer
Operating System Windows Server 2008 R2
OS Version 6.1
Update Level /C:/ColdFusion10/cfusion/lib/updates/chf10000008.jar
Adobe Driver Version 4.1 (Build 0001)
JVM Details
Java Version 1.6.0_29
Java Vendor Sun Microsystems Inc.
Java Vendor URL http://java.sun.com/
Java Home C:\ColdFusion10\jre
不知道它是否是一个配置问题,在这一点?这是related to my previous question,并试图简化一切以隔离原因。
编辑#1 我能够没有任何问题添加这个非常简单的RESTful服务为Windows 7 64位/ CF 10(没有更新)。我想知道是否我的安装是损坏的或更新会损坏它?
编辑#2 我重新安装了CF服务器,它仍然给了我同样的问题。
编辑#3
按milanchandna的建议,我按照这些步骤:
- 创建的文件夹C:使用的应用程序池\网站\ milanchandna
- 创建一个新的网站(milanchandna在IIS中使用c:\ websites \ milanchandna作为root用户,在端口8084上运行
- 创建jakarta虚拟目录(需要此操作)
- 添加基本HelloWorld.cfc
- 导航到HelloWorld。CFC成功,没有任何错误
- 在CF管理员,REST服务,增加了以下内容:
- 根路径:C:/网站/ milanchandna/
- 服务映射:实例
- 单击添加服务
- 获取错误: 注册REST服务时出错。请确保您输入了正确的映射和路径。 应用程序示例无法初始化。 原因:应用程序不包含任何已启用的CFC。 该应用程序不包含任何已启用的CFC。
HelloWorld.cfc:
<cfcomponent rest="true" restPath="/hello">
<cffunction name="sayHello" access="remote" returnType="String" httpMethod="GET">
<cfset res="Hello World">
<cfreturn res>
</cffunction>
</cfcomponent>
看到我的第三编辑,我跟着你的脚步,并得到了一个错误。奇怪的... – TekiusFanatikus 2013-03-12 23:45:41