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

Play Slick error #92

Closed
Jacke opened this issue Aug 10, 2014 · 5 comments
Closed

Play Slick error #92

Jacke opened this issue Aug 10, 2014 · 5 comments

Comments

@Jacke
Copy link

Jacke commented Aug 10, 2014

Hello. I get that error:

! @6j6m727a1 - Internal server error, for (GET) [/process/2/logs] ->

play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.ExceptionInInitializerError]]
        at play.api.Application$class.handleError(Application.scala:296) ~[play_2.11-2.3.1.jar:2.3.1]
        at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.11-2.3.1.jar:2.3.1]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:205) [play_2.11-2.3.1.jar:2.3.1]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:202) [play_2.11-2.3.1.jar:2.3.1]
        at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) [scala-library-2.11.2.jar:na]
Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
        at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:523) ~[play_2.11-2.3.1.jar:2.3.1]
        at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:130) ~[play_2.11-2.3.1.jar:2.3.1]
        at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:130) ~[play_2.11-2.3.1.jar:2.3.1]
        at play.utils.Threads$.withContextClassLoader(Threads.scala:21) ~[play_2.11-2.3.1.jar:2.3.1]
        at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:129) ~[play_2.11-2.3.1.jar:2.3.1]
Caused by: java.lang.ExceptionInInitializerError: null
        at models.DAO.PLoggers.<init>(PLoggers.scala:16) ~[classes/:na]
        at models.DAO.PLoggerDAO$$anonfun$5.apply(PLoggers.scala:77) ~[classes/:na]
        at models.DAO.PLoggerDAO$$anonfun$5.apply(PLoggers.scala:77) ~[classes/:na]
        at scala.slick.lifted.TableQuery.shaped$lzycompute(Query.scala:236) ~[slick_2.11-2.1.0.jar:na]
        at scala.slick.lifted.TableQuery.shaped(Query.scala:235) ~[slick_2.11-2.1.0.jar:na]
Caused by: scala.ScalaReflectionException: class models.DAO.CompositeValues in JavaMirror with PlayDependencyClassLoader{file:/C:/Users/Sobolev/.ivy2/cache/org.scala-lang.modules/scala-async_2.11/bundles/scala-async_2.11-0.9.1.jar,.......C:\Program Files\Java\jdk1.7.0_40\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_40\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_40\jre\classes] not found.
        at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:123) ~[scala-reflect-2.11.2.jar:na]
        at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:22) ~[scala-reflect-2.11.2.jar:na]
        at models.DAO.driver.MyCompositeSupport$CompositeImplicts$$typecreator2$1.apply(MyPostgresDriver.scala:29) ~[classes/:na]
        at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe$lzycompute(TypeTags.scala:232) ~[scala-reflect-2.11.2.jar:na]
        at scala.reflect.api.TypeTags$WeakTypeTagImpl.tpe(TypeTags.scala:232) ~[scala-reflect-2.11.2.jar:na]

When i use console, all works fine. Maybe someone have same issue? I think that problem with MyPostgresDriver and composites implicits, idk.

// Pretty standart
package models.DAO.driver
trait MyCompositeSupport extends PgCommonJdbcTypes
       with PgArrayJdbcTypes
       with PgCompositeSupport { driver: PostgresDriver =>

    trait CompositeImplicts {



      implicit val compositeTypeMapper = createCompositeJdbcType[CompositeValues]("compositevalues")
      implicit val compositeArrayTypeMapper = createCompositeListJdbcType[CompositeValues]("compositevalues")
    }
  }

trait MyPostgresDriver extends PostgresDriver 
with MyCompositeSupport 
with PgArraySupport
//with PgDateSupport
with PgDateSupportJoda 
 {
  ///
  override lazy val Implicit = new ImplicitsPlus with CompositeImplicts {}
  override val simple = new SimpleQLPlus with CompositeImplicts {}


  //////
  trait ImplicitsPlus extends Implicits
  with ArrayImplicits
  with DateTimeImplicits



  trait SimpleQLPlus extends SimpleQL
  with ImplicitsPlus
  with DateTimeImplicits

}

object MyPostgresDriver extends MyPostgresDriver

Plus sometimes i've seen that error

[RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class models.DAO.driver.MyPostgresDriver$]
@Jacke
Copy link
Author

Jacke commented Aug 10, 2014

Oh, probably that's it is playframework/playframework#2847

@Jacke Jacke closed this as completed Aug 10, 2014
@Jacke
Copy link
Author

Jacke commented Aug 10, 2014

Or not? I'm not sure, for now this isnt working, so probably i rewrite all compositetype and array in separate tables :(

@Jacke
Copy link
Author

Jacke commented Aug 10, 2014

Created new driver



trait WithMyDriver1 {
  val driver: MyPostgresDriver1
}


trait MyPostgresDriver1 extends PostgresDriver 
with PgArraySupport
//with PgDateSupport
with PgDateSupportJoda 
 {
  ///
   override lazy val Implicit = new ImplicitsPlus {}
override val simple = new SimpleQLPlus {}


  //////
  trait ImplicitsPlus extends Implicits
  with ArrayImplicits
  with DateTimeImplicits



  trait SimpleQLPlus extends SimpleQL
  with ImplicitsPlus
  with DateTimeImplicits

}

object MyPostgresDriver1 extends MyPostgresDriver1

And it's worked for arrays, but not for compositevalues

@tminglei
Copy link
Owner

Well, as @DylanArnold told in #89, you can try activator start.

@DylanArnold
Copy link

@Jacke Yeah it is probably the same problem. I'm using sbt-revolver now as mentioned in the play issue, now it runs (I haven't actually tested the composite stuff yet but I assume it works). I'm missing some of the nice IDE integration too.

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

3 participants