Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

java.lang.RuntimeException: java.io.FileNotFoundException: model.pmml.ser (Android) #3

Description

@jassilva

I'm testing the jpmml-android example app and realize that model.pmml file was not serialized. I'd like to know how can I serialize the .pmml file inside Android or even use another method. Is there any way to do that? Is there any step-by-step?

I'm using gradle to compile the librarys inside pom.xml file from the example app:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    testCompile 'junit:junit:4.12'
    compile group: 'org.jpmml', name: 'pmml-model', version: '1.3.6'
    compile group: 'org.jpmml', name: 'jpmml-evaluator', version: '1.3.6'
    compile group: 'org.codehaus.plexus', name: 'plexus-io', version: '3.0.0'

}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://mvnrepository.com/artifact/org.jpmml/pmml-model' }
        maven { url 'https://mvnrepository.com/artifact/org.jpmml/jpmml-evaluator' }
        maven { url 'https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-io' }
    }
}

Error:

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: jpmml.org.androidm, PID: 17753
                  java.lang.RuntimeException: java.io.FileNotFoundException: model.pmml.ser
                      at jpmml.org.androidm.MainActivity$1.onClick(MainActivity.java:37)
                      at android.view.View.performClick(View.java:5246)
                      at android.widget.TextView.performClick(TextView.java:10565)
                      at android.view.View$PerformClick.run(View.java:21200)
                      at android.os.Handler.handleCallback(Handler.java:739)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:145)
                      at android.app.ActivityThread.main(ActivityThread.java:6946)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:372)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
                   Caused by: java.io.FileNotFoundException: model.pmml.ser
                      at android.content.res.AssetManager.openAsset(Native Method)
                      at android.content.res.AssetManager.open(AssetManager.java:323)
                      at android.content.res.AssetManager.open(AssetManager.java:297)
                      at jpmml.org.androidm.MainActivity.createEvaluator(MainActivity.java:75)
                      at jpmml.org.androidm.MainActivity.access$000(MainActivity.java:18)
                      at jpmml.org.androidm.MainActivity$1.onClick(MainActivity.java:35)
                      at android.view.View.performClick(View.java:5246) 
                      at android.widget.TextView.performClick(TextView.java:10565) 
                      at android.view.View$PerformClick.run(View.java:21200) 
                      at android.os.Handler.handleCallback(Handler.java:739) 
                      at android.os.Handler.dispatchMessage(Handler.java:95) 
                      at android.os.Looper.loop(Looper.java:145) 
                      at android.app.ActivityThread.main(ActivityThread.java:6946) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at java.lang.reflect.Method.invoke(Method.java:372) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
Application terminated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions