autodeployai / pmml4s

PMML scoring library for Scala
https://www.pmml4s.org/
Apache License 2.0
62 stars 10 forks source link

Model.fromFile(model) error #7

Closed isaaclo97 closed 4 years ago

isaaclo97 commented 4 years ago

I am trying to load models, it compiles correctly instead when executing it gives an error with Model.fromFile. I tried load a basic PMMLs to avoid file problems and it gets the same error.

Scala version: 2.12.11 Flink version: 1.9.2 Tested versions of pmml4s: 0.9.3, 0.9.4, 0.9.5

Any idea?

java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
at org.pmml4s.xml.XmlAttrs.(XmlAttrs.scala:23) at org.pmml4s.xml.XmlImplicits$.metaData2Attr(XmlAttrs.scala:92) at org.pmml4s.xml.XmlAttrs$.apply(XmlAttrs.scala:84) at org.pmml4s.xml.XmlUtils.makeElem(XmlUtils.scala:71) at org.pmml4s.xml.XmlUtils.makeElem$(XmlUtils.scala:71) at org.pmml4s.xml.ModelBuilder$.makeElem(ModelBuilder.scala:138) at org.pmml4s.xml.XmlUtils.makeElem(XmlUtils.scala:73) at org.pmml4s.xml.XmlUtils.makeElem$(XmlUtils.scala:73) at org.pmml4s.xml.ModelBuilder$.makeElem(ModelBuilder.scala:138) at org.pmml4s.xml.ModelBuilder$.fromXml(ModelBuilder.scala:149) at
at org.pmml4s.model.Model$.apply(Model.scala:670)
at org.pmml4s.model.Model$.fromFile(Model.scala:657)
at es.dmr.uimp.Job$.main(Job.scala:71)
at es.dmr.uimp.Job.main(Job.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:576)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:438)
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:274)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:746)
at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:273)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:205)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1010)
at org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1083)
at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1083)
scorebot commented 4 years ago

@isaaclo97 Different scala versions (2.11, 2.12, and 2.13) are not compatible. Since you use Scala 2.12, make sure you use pmml4s_2.12, which build tool is used? sbt, maven, or others?

isaaclo97 commented 4 years ago

@scorebot i used sbt and pmml4s_X.XX according to scala versions used, the problem was solved. The problem appear when i run it in local cluster with flink, when i run it with sbt run it does not appear.

scorebot commented 4 years ago

Cool. I close this issue now. if you have other problems, please feel free to open a new one.