I think my classpath issues are in pretty good shape for the moment, having dropped the requisite jars directly into my JDK ext dir.
I'm still on my mission to run some fantom code within appengine, and my latest stumbling block is that, having created a bundle via JarDist(), I'm getting the following error upon trying to access my FanServlet: http://pastebin.com/1gMV5Jay.
I tried adding a FAN_HOME env variable pointing to the Fantom installation on my system, but got a bunch of file io permission errors, presumably since appengine can't access anything outside its sandbox. So I'm wondering how to ensure that the bundled fantom code can find FAN_HOME or fan.home within itself.
brianWed 2 Jun 2010
This will be cool once you get it working!
Ideally we want to set the system property "fan.home" to something (even if just "."). Do you have that system property set? Maybe try something like The Environment?
liamstaskWed 2 Jun 2010
Getting closer :) I've set fan.home to . but in this case, fantom doesn't seem to start up properly: http://pastebin.com/v6zaA86q
brianWed 2 Jun 2010
It shouldn't be trying to open a zip file in JarDist, but rather opening reflection files from the ClassLoader.
You should have the "fan.jardist" System property set to "true".
Looking thru, doesn't appear that stuff is documented as well as it should - I will add some of these notes to the docLang::Env chapter
liamstaskWed 2 Jun 2010
Hah, that did it. I can now spit back some trivial text from a Fantom class that subclasses javax.servlet.http.HttpServlet - pretty cool. A bit more doc would be helpful, but I think I'm off and running for now...thanks again!
AkcelistoTue 23 Nov 2010
I want use pod as jar in AppEngine. But my call of Fantom from Java is fail.
public class TestTabulara {
public static void main(String[] args) throws CacheException {
Tabulara tabulara = Tabulara.make();
System.out.println(tabulara);
}
}
But:
ERROR: cannot init Sys.homeDir
java.lang.RuntimeException: Missing fan.home system property or FAN_HOME env var
at fan.sys.Sys.sysPropToDir(Sys.java:320)
at fan.sys.Sys.initHomeDir(Sys.java:283)
at fan.sys.Sys.<clinit>(Sys.java:41)
at fan.sys.Pod.readFPod(Pod.java:140)
at fan.sys.Pod.doFind(Pod.java:65)
at fan.sys.Pod.find(Pod.java:46)
at fanx.util.TypeParser.find(TypeParser.java:87)
at fanx.util.TypeParser.load(TypeParser.java:67)
at fan.sys.Type.find(Type.java:44)
at fan.tabulara.Tabulara.<clinit>(Tabulara.fan:5)
liamstask Wed 2 Jun 2010
I think my classpath issues are in pretty good shape for the moment, having dropped the requisite jars directly into my JDK ext dir.
I'm still on my mission to run some fantom code within appengine, and my latest stumbling block is that, having created a bundle via JarDist(), I'm getting the following error upon trying to access my FanServlet: http://pastebin.com/1gMV5Jay.
I tried adding a FAN_HOME env variable pointing to the Fantom installation on my system, but got a bunch of file io permission errors, presumably since appengine can't access anything outside its sandbox. So I'm wondering how to ensure that the bundled fantom code can find
FAN_HOME
orfan.home
within itself.brian Wed 2 Jun 2010
This will be cool once you get it working!
Ideally we want to set the system property "fan.home" to something (even if just "."). Do you have that system property set? Maybe try something like The Environment?
liamstask Wed 2 Jun 2010
Getting closer :) I've set
fan.home
to.
but in this case, fantom doesn't seem to start up properly: http://pastebin.com/v6zaA86qbrian Wed 2 Jun 2010
It shouldn't be trying to open a zip file in JarDist, but rather opening reflection files from the ClassLoader.
You should have the "fan.jardist" System property set to "true".
Looking thru, doesn't appear that stuff is documented as well as it should - I will add some of these notes to the docLang::Env chapter
liamstask Wed 2 Jun 2010
Hah, that did it. I can now spit back some trivial text from a Fantom class that subclasses javax.servlet.http.HttpServlet - pretty cool. A bit more doc would be helpful, but I think I'm off and running for now...thanks again!
Akcelisto Tue 23 Nov 2010
I want use pod as jar in AppEngine. But my call of Fantom from Java is fail.
I build jar:
I write in Java (with tabulara.jar in classpath):
But:
I dont understand:
fan.jardist
andfan.home
fan.jardist
andfan.home
go4 Wed 24 Nov 2010
In java:
but GAE:
In fact, I have not tried it. Good luck
Akcelisto Wed 24 Nov 2010
Thanks. This works.
brian Fri 26 Nov 2010
So if that XML file something we can stick into the dist jar file and have GAE automatically pick it up?
Akcelisto Sat 27 Nov 2010
I think JarDist must add this code to init Fantom code:
This code works in Java and AppEngine if his called before calling Fantom.
brian Sun 28 Nov 2010
The code to set the system properties is generated in the jardist main method.
See JarDist source.
We could potentially pull that out into a static init method?