【问题标题】:How to install and test wirebox 1.6?如何安装和测试wirebox 1.6?
【发布时间】:2013-03-14 21:12:55
【问题描述】:

我正在使用 ColdFusion8、Windows7 64 位操作系统,并且我从 ColdBox 下载了 Wirebox 1.6。我已提取文件并将它们放在wwwroot 中,并使用以下代码创建了一个“index.cfm”页面:

<cfscript>
  wirebox = createObject("component","wirebox.system.ioc.Injector").init();
</cfscript>
<cfdump var="#wirebox#">

但是它抛出了一个错误:

Invalid CFML construct found on line 43 at column 36.
ColdFusion was looking at the following text:
{
The CFML compiler was processing:
A script statement beginning with instance on line 43, column 25.
A cfscript tag beginning on line 33, column 18.
A cfscript tag beginning on line 33, column 18.

The error occurred in C:\ColdFusion8\wwwroot\wirebox\system\ioc\Injector.cfc: line 43
41 : 
42 :          // Prepare Injector instance
43 :          instance = {
44 :              // Java System
45 :              javaSystem = createObject('java','java.lang.System'),

如何正确安装并测试安装?

【问题讨论】:

    标签: coldfusion coldfusion-8 cfml coldbox


    【解决方案1】:

    the documentation 中所述,ColdBox 需要以下引擎之一:

    • ColdFusion 8.01 或更高版本
    • Railo 2.0 或更高版本
    • Open Blue Dragon(并非所有功能都受支持)

    正如this answer 解释的那样,CF 8 不支持 ColdBox 使用的嵌套内联结构。

    【讨论】:

      【解决方案2】:

      您使用的是什么 CF8 更新程序?我猜这是 struct 文字解析的 CF8 错误。您可以通过将 struct 文字重写为老式风格来测试这一点:

      instance = structnew();
      instance.javaSystem = createObject(...);
      

      【讨论】:

      • 我仍然收到同样的错误提示“找到无效的 CFML 构造”。我用过- instance = structnew(); instance.javaSystem = createObject("组件","wirebox.system.ioc.Injector").init();
      • 我猜代码中还有其他结构文字与您的 CF8 版本不兼容。我建议安装最新的 CF8 更新程序。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多