#2343 Problem with starting fwt examples in F4

rasa Wed 10 Sep 2014

There are two fwt examples I can't start in F4: demo.fan and richtext.fan Their errors are respectively:

demo.fan

sys::NullErr: Coerce to non-null
  fan.sys.NullErr.makeCoerce (NullErr.java:38)
  FantomExamples::FwtDemo.instance$init$FantomExamples$FwtDemo (demo.fan:638)
  FantomExamples::FwtDemo.make$ (demo.fan:16)
  FantomExamples::FwtDemo.make (demo.fan:16)
  java.lang.reflect.Method.invoke (Unknown)
  fan.sys.Method.invoke (Method.java:559)
  fan.sys.Method$MethodFunc.callList (Method.java:198)
  fan.sys.Type.make (Type.java:246)
  fan.sys.ClassType.make (ClassType.java:110)
  fan.sys.Type.make (Type.java:236)
  fanx.tools.Fan.callMain (Fan.java:175)
  fanx.tools.Fan.executeType (Fan.java:140)
  fanx.tools.Fan.execute (Fan.java:41)
  fanx.tools.Fan.run (Fan.java:298)
  fanx.tools.Fan.main (Fan.java:336)

richtext.fan

sys::IOErr: java.io.FileNotFoundException: richtext.fan (The system cannot find the file specified)
  java.io.FileInputStream.open (Unknown)
  java.io.FileInputStream.<init> (Unknown)
  fan.sys.LocalFile.in (LocalFile.java:431)
  fan.sys.File.readAllLines (File.java:381)
  FantomExamples::RichTextDemo.main (richtext.fan:21)
  java.lang.reflect.Method.invoke (Unknown)
  fan.sys.Method.invoke (Method.java:559)
  fan.sys.Method$MethodFunc.callOn (Method.java:230)
  fan.sys.Method.callOn (Method.java:139)
  fanx.tools.Fan.callMain (Fan.java:175)
  fanx.tools.Fan.executeType (Fan.java:140)
  fanx.tools.Fan.execute (Fan.java:41)
  fanx.tools.Fan.run (Fan.java:298)
  fanx.tools.Fan.main (Fan.java:336)

Both examples work without problems when started externally with fan.

SlimerDude Wed 10 Sep 2014

Both errors have the same cause; not being able to find a relative file.

  1. demo.fan

    Just delete line 638 for it is not used.

  2. richtext.fan

    It tries to load richtext.fan as a sample file to edit.

    Goto Run -> Run Configurations -> richtext.fan -> Arguments tab and change the Working directory to other and browse to wherever the source file is. I tend to use eclipse workspace paths, so my working directory would look something like:

    ${workspace_loc:FantomExamples/fan}

    OR

    change line 52 to an absolute location of a text file:

    File scriptFile := `file:C:/Projects/FantomExamples/fan/richtext.fan`.toFile

rasa Wed 10 Sep 2014

Thanks.

Login or Signup to reply.