androidjess

How to use jess in Android


I'm trying to use JESS in and Android project. I tried using Jess 6 which is working fine on a web application on netbeans, but it's giving errors. It seems like the version of the jar file is not compatible. I need help on how to integrate jess with an Android project.

The error is generated from a line of code:

Rete engine = new Rete();

See the error trail below:

 2593-2593/com.example.modupe.tryjessapp E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.example.modupe.tryjessapp, PID: 2593
 java.lang.NoClassDefFoundError: Failed resolution of: Ljava/applet/Applet;
     at jess.Rete.getApplet(Unknown Source)
     at jess.Batch.batch(Unknown Source)
     at jess.Rete.if(Unknown Source)
     at jess.Rete.<init>(Unknown Source)
     at jess.Rete.<init>(Unknown Source)
     at jess.Rete.<init>(Unknown Source)
     at com.example.modupe.tryjessapp.MainActivity.<init>(MainActivity.java:17)
     at java.lang.Class.newInstance(Native Method)
     at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
     at android.app.ActivityThread.-wrap12(ActivityThread.java)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:154)
     at android.app.ActivityThread.main(ActivityThread.java:6119)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "java.applet.Applet" on path: DexPathList[[zip file "/data/app/com.example.modupe.tryjessapp-1/base.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.modupe.tryjessapp-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.modupe.tryjessapp-1/lib/x86, /system/lib, /vendor/lib]]
....

Solution

  • Jess uses a number of Java APIs that are not supported on Dalvik, Applet being one, but more importantly, java.beans.Introspector. An android-capable version of Jess is available as an alpha build to source licensees only; it hasn't been released.