1

Following the instructions from Alien Factory's afBedNap to build a web app using the afBedSheet framework for Fantom I got this error at the end of step 3 (running the app):

$ 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

The path /Users/coder/apps/fantom-1.0.66 exists and is where I installed Fantom. I ran export FAN_HOME="/Users/coder/apps/fantom-1.0.66" but this made no difference.

If I run $FAN_HOME/bin/fan -version this is what I get:

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

I can't find a solution in Fantom forums. Any ideas, please?

LightDye
  • 1,174
  • 8
  • 14

1 Answers1

1

It looks like the app is falling over when it launches the BedSheet Development Proxy so try starting the web app with out it.

In /myAfBedNap/fan/Main.fan remove the -proxy option so it looks like:

class Main {
    Int main() {
        afBedSheet::Main().main("-env dev myAfBedNap 8069".split)
    }
}
Steve Eynon
  • 4,308
  • 1
  • 23
  • 44
  • 1
    It was definitely a bug in [afBedSheet](http://repo.status302.com/doc/afBedSheet/#v1.3.14) v1.3.12 but it's been fixed in v1.3.14 and the development proxy can be used again. – LightDye Aug 08 '14 at 15:35