按照Alien Factory's afBedNap的指示,使用Fantom的afBedSheet框架构建一个Web应用程序,我在第3步(运行应用程序)结束时遇到了这个错误:
$ fan myAfBedNap
[09:37:54 03-Aug-14] [info] [afBedSheet] Starting BedSheet Proxy on port 8069
[09:37:54 03-Aug-14] [info] [web] WispService started on port 8069
[09:37:54 03-Aug-14] [info] [afBedSheet] Cached the timestamps of 57 pods
[09:37:54 03-Aug-14] [info] [afBedSheet] Launching BedSheet WebApp 'myAfBedNap' on port 8070
ERROR: cannot init Sys.homeDir
java.lang.RuntimeException: Invalid fan.home dir: "/Users/coder/apps/fantom-1.0.66"
at fan.sys.Sys.sysPropToDir(Sys.java:349)
at fan.sys.Sys.initHomeDir(Sys.java:304)
at fan.sys.Sys.<clinit>(Sys.java:41)
at fanx.tools.Fan.execute(Fan.java:28)
at fanx.tools.Fan.run(Fan.java:298)
at fanx.tools.Fan.main(Fan.java:336)
java.lang.ExceptionInInitializerError
at fanx.tools.Fan.execute(Fan.java:28)
at fanx.tools.Fan.run(Fan.java:298)
at fanx.tools.Fan.main(Fan.java:336)
Caused by: java.lang.RuntimeException: Cannot boot fan: java.lang.RuntimeException: Invalid fan.home dir: "/Users/coder/apps/fantom-1.0.66"
at fan.sys.Sys.initFail(Sys.java:606)
at fan.sys.Sys.initHomeDir(Sys.java:308)
at fan.sys.Sys.<clinit>(Sys.java:41)
... 3 more
路径/Users/coder/apps/fantom-1.0.66
存在,是我安装Fantom的地方。我跑了export FAN_HOME="/Users/coder/apps/fantom-1.0.66"
,但没有区别。
如果我运行$FAN_HOME/bin/fan -version
,这就是我得到的:
Fantom Launcher
Copyright (c) 2006-2013, Brian Frank and Andy Frank
Licensed under the Academic Free License version 3.0
Java Runtime:
java.version: 1.8.0_05
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.vm.vendor: Oracle Corporation
java.vm.version: 25.5-b02
java.home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
fan.platform: macosx-x86_64
fan.version: 1.0.66
fan.env: sys::BootEnv
fan.home: /Users/coder/apps/fantom-1.0.66
我无法在Fantom forums找到解决方案。有什么想法吗?
答案 0 :(得分:1)
看起来应用程序在启动BedSheet Development Proxy时会失败,所以请尝试使用它启动Web应用程序。
在/myAfBedNap/fan/Main.fan
中删除-proxy
选项,使其如下所示:
class Main {
Int main() {
afBedSheet::Main().main("-env dev myAfBedNap 8069".split)
}
}