Playframework and Spark classpath issue -
is there workaround issue? managed integrate spark in playframework in dev mode?
i'm running playframework-2.5
application uses spark-sql-2.1.0
read csv file. class should instantiated spark-sql
listing2exported
.
i read there might classpath issues when run in dev mode , can confirm that.
- dev mode: if execute
activator run
exception - prod mode: if execute
activator start
file read properly.
.
case class listing2exported ( extractor:option[string], categoryid:option[int], categoryname:option[string], productname:option[string], productcode:option[int] )
the exception
1) error injecting constructor, scala.scalareflectionexception: class org.raisercostin.namek.io.listing2exported in javamirror playdependencyclassloader{.... ] not found. @ scala.reflect.internal.mirrors$rootsbase.staticclass(mirrors.scala:123) ~[scala-reflect-2.11.8.jar:na] @ scala.reflect.internal.mirrors$rootsbase.staticclass(mirrors.scala:22) ~[scala-reflect-2.11.8.jar:na] @ org.raisercostin.namek.io.listingsparkcsvimporter$$typecreator1$1.apply(listingsparkcsvimporter.scala:70) ~[na:na] @ scala.reflect.api.typetags$weaktypetagimpl.tpe$lzycompute(typetags.scala:232) ~[scala-reflect-2.11.8.jar:na] @ scala.reflect.api.typetags$weaktypetagimpl.tpe(typetags.scala:232) ~[scala-reflect-2.11.8.jar:na] @ org.apache.spark.sql.catalyst.scalareflection$class.localtypeof(scalareflection.scala:782) ~[spark-catalyst_2.11-2.1.0.jar:2.1.0] @ org.apache.spark.sql.catalyst.scalareflection$.localtypeof(scalareflection.scala:39) ~[spark-catalyst_2.11-2.1.0.jar:2.1.0] @ org.apache.spark.sql.catalyst.scalareflection$.datatypefor(scalareflection.scala:63) ~[spark-catalyst_2.11-2.1.0.jar:2.1.0] @ org.apache.spark.sql.catalyst.encoders.expressionencoder$.apply(expressionencoder.scala:63) ~[spark-catalyst_2.11-2.1.0.jar:2.1.0] @ org.apache.spark.sql.encoders$.product(encoders.scala:275) ~[spark-catalyst_2.11-2.1.0.jar:2.1.0] @ org.raisercostin.namek.io.listingsparkcsvimporter.readcsv(listingsparkcsvimporter.scala:70) ~[na:na] @ org.raisercostin.namek.io.listingsparkcsvimporter.read(listingsparkcsvimporter.scala:40) ~[na:na] @ namek.app.application$appdatareader.read2(application.scala:154) ~[na:na] @ namek.app.application$appdatareader$$anonfun$11.apply(application.scala:157) ~[na:na] @ namek.app.application$appdatareader$$anonfun$11.apply(application.scala:156) ~[na:na] @ scala.collection.traversablelike$$anonfun$map$1.apply(traversablelike.scala:234) ~[scala-library-2.11.8.jar:na] @ scala.collection.traversablelike$$anonfun$map$1.apply(traversablelike.scala:234) ~[scala-library-2.11.8.jar:na] @ scala.collection.mutable.resizablearray$class.foreach(resizablearray.scala:59) ~[scala-library-2.11.8.jar:na] @ scala.collection.mutable.arraybuffer.foreach(arraybuffer.scala:48) ~[scala-library-2.11.8.jar:na] @ scala.collection.traversablelike$class.map(traversablelike.scala:234) ~[scala-library-2.11.8.jar:na] @ scala.collection.abstracttraversable.map(traversable.scala:104) ~[scala-library-2.11.8.jar:na] @ namek.app.application$appdatareader.<init>(application.scala:156) ~[na:na] @ namek.app.application$application.appdata$lzycompute(application.scala:72) ~[na:na] @ namek.app.application$application.appdata(application.scala:71) ~[na:na] @ namek.app.application$application.filter(application.scala:79) ~[na:na] @ namek.app.application$application.namek$app$application$application$$toplistings$1(application.scala:46) ~[na:na] @ namek.app.application$application$$anonfun$2.apply(application.scala:49) ~[na:na] @ namek.app.application$application$$anonfun$2.apply(application.scala:49) ~[na:na] @ models.topcategory.<init>(models.scala:160) ~[na:na] @ namek.app.application$application.<init>(application.scala:49) ~[na:na] @ namek.services.defaultlistingsservice.reloadapplication(listingsservice.scala:63) ~[na:na] @ namek.services.defaultlistingsservice.<init>(listingsservice.scala:43) ~[na:na] @ namek.services.defaultlistingsservice$$fastclassbyguice$$97a4e1c7.newinstance(<generated>) ~[na:na] @ com.google.inject.internal.cglib.reflect.$fastconstructor.newinstance(fastconstructor.java:40) ~[guice-4.0.jar:na] @ com.google.inject.internal.defaultconstructionproxyfactory$1.newinstance(defaultconstructionproxyfactory.java:61) ~[guice-4.0.jar:na] @ com.google.inject.internal.constructorinjector.provision(constructorinjector.java:105) ~[guice-4.0.jar:na] @ com.google.inject.internal.constructorinjector.construct(constructorinjector.java:85) ~[guice-4.0.jar:na] @ com.google.inject.internal.constructorbindingimpl$factory.get(constructorbindingimpl.java:267) ~[guice-4.0.jar:na] @ com.google.inject.internal.factoryproxy.get(factoryproxy.java:56) ~[guice-4.0.jar:na] @ com.google.inject.internal.singleparameterinjector.inject(singleparameterinjector.java:38) ~[guice-4.0.jar:na] @ com.google.inject.internal.singleparameterinjector.getall(singleparameterinjector.java:62) ~[guice-4.0.jar:na] @ com.google.inject.internal.constructorinjector.provision(constructorinjector.java:104) ~[guice-4.0.jar:na] @ com.google.inject.internal.constructorinjector.construct(constructorinjector.java:85) ~[guice-4.0.jar:na] @ com.google.inject.internal.constructorbindingimpl$factory.get(constructorbindingimpl.java:267) ~[guice-4.0.jar:na] @ com.google.inject.internal.providertointernalfactoryadapter$1.call(providertointernalfactoryadapter.java:46) ~[guice-4.0.jar:na] @ com.google.inject.internal.injectorimpl.callincontext(injectorimpl.java:1103) ~[guice-4.0.jar:na] @ com.google.inject.internal.providertointernalfactoryadapter.get(providertointernalfactoryadapter.java:40) ~[guice-4.0.jar:na] @ com.google.inject.internal.singletonscope$1.get(singletonscope.java:145) ~[guice-4.0.jar:na] @ com.google.inject.internal.internalfactorytoprovideradapter.get(internalfactorytoprovideradapter.java:41) ~[guice-4.0.jar:na] @ com.google.inject.internal.injectorimpl$2$1.call(injectorimpl.java:1016) ~[guice-4.0.jar:na] @ com.google.inject.internal.injectorimpl.callincontext(injectorimpl.java:1092) ~[guice-4.0.jar:na] @ com.google.inject.internal.injectorimpl$2.get(injectorimpl.java:1012) ~[guice-4.0.jar:na] ... 47 common frames omitted
Comments
Post a Comment