Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to load data from an in-memory resource file #15

Open
vruusmann opened this issue Jul 13, 2021 · 0 comments
Open

Failing to load data from an in-memory resource file #15

vruusmann opened this issue Jul 13, 2021 · 0 comments

Comments

@vruusmann
Copy link
Member

Reportedly, FileTranspiler works, but InMemoryTranspiler fails with the following exception:

Exception in thread "main" java.util.ServiceConfigurationError: org.dmg.pmml.PMML: Provider com.mycompany.MyModel could not be instantiated
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:582)
        at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:804)
        at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:722)
        at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1393)
        at org.jpmml.model.ServiceLoaderUtil.load(ServiceLoaderUtil.java:30)
        at org.jpmml.model.PMMLUtil.load(PMMLUtil.java:58)
        at org.jpmml.transpiler.InMemoryTranspiler.transpile(InMemoryTranspiler.java:40)
        at org.jpmml.transpiler.TranspilerTransformer.apply(TranspilerTransformer.java:40)
        at org.jpmml.evaluator.LoadingModelEvaluatorBuilder.transform(LoadingModelEvaluatorBuilder.java:142)
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:780)
        ... 8 more
Caused by: java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read()" because "this.in" is null
        at java.base/java.io.DataInputStream.readUnsignedShort(DataInputStream.java:343)
        at java.base/java.io.DataInputStream.readUTF(DataInputStream.java:595)
        at java.base/java.io.DataInputStream.readUTF(DataInputStream.java:570)
        at org.jpmml.evaluator.ResourceUtil.readStrings(ResourceUtil.java:98)
        at org.jpmml.evaluator.ResourceUtil.readFieldNames(ResourceUtil.java:39)
        at com.mycompany.MyModel.<clinit>(MyModel.java:60)
        ... 14 more
        Suppressed: java.lang.NullPointerException: Cannot invoke "java.io.InputStream.close()" because "this.in" is null
                at java.base/java.io.FilterInputStream.close(FilterInputStream.java:179)
                at com.mycompany.MyModel.<clinit>(MyModel.java:59)
                ... 14 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant