This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Android Kawa - verifier error


(I've set aside the issue of creating classes at the moment)

My next task is to figure out how to execute Lisp forms on the UI thread and
fetch the result back to the REPL. The main idea is to use a lock, eval a
form, store the result and the REPL thread blocks until the result is
available.

First I ran this up in Java, and confirmed it worked.

; Job.scm
; a job that is posted on a UI thread.
(define-simple-class Job (java.lang.Runnable)
    (result type: object init-value: #!null)
    (form init-keyword: form:)
    ((*init* (form0:: Object))
        (set! form form0))
    ((run) :: #!void
        (synchronized (this)
            (if (not (eq? #!null form))
                (set! result (eval form (interaction-environment))))
            (notify))
    ))

#|
; Test routine
(let ((job (Job '(* 21 2))))
    (synchronized job
        ((java.lang.Thread:new job):start)
        (job:wait))
    (display (format "Result: ~a ~%Done~%" job:result)))
|#

But when I (require "Job.scm") from my hello.scm in Dalvik, 
I get the following error on the 'require' line itself:

FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
       at kawa.android.hello.onCreate(hello.scm:7)
       at android.app.Activity.performCreate(Activity.java:4465)
       at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
       at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
       at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
       at android.app.ActivityThread.access$600(ActivityThread.java:123)
       at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4424)
       at java.lang.reflect.Method.invokeNative(Native Method)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
       at dalvik.system.NativeStart.main(Native Method)
Caused by: exception while initializing module kawa.android.Job
       at gnu.expr.ModuleContext.findInstance(ModuleContext.java:84)
       at gnu.expr.ModuleContext.findInstance(ModuleContext.java:57)
       at gnu.expr.ModuleInfo.getInstance(ModuleInfo.java:272)
       at kawa.standard.require.find(require.java:120)
       at kawa.android.repl.run(repl.scm:1)
       at gnu.expr.ModuleBody.run(ModuleBody.java:44)
       at gnu.expr.ModuleBody.run(ModuleBody.java:32)
       at kawa.android.repl.<clinit>(repl.scm)
       ... 15 more
Caused by: java.lang.VerifyError: kawa/android/Job
       at java.lang.Class.newInstanceImpl(Native Method)
       at java.lang.Class.newInstance(Class.java:1319)
       at gnu.expr.ModuleContext.findInstance(ModuleContext.java:79)
       ... 22 more
   Force finishing activity kawa.android/.hello

-- 
View this message in context: http://old.nabble.com/Android-Kawa---verifier-error-tp33217024p33217024.html
Sent from the Sourceware - kawa list mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]