[1.5] intermittent exception using activate with play 2.2

60 views
Skip to first unread message

erich oliphant

unread,
Jun 19, 2014, 9:54:13 AM6/19/14
to activate-p...@googlegroups.com
Hi i'm seeing this when I run my app on my server, but not when I run it locally.  I've tried few things like calling 'transactional{}' on the onStart() etc but that is inconsistent and doesn't seem to always help. Beyond that I was thinking that that might not be good if it conflicts with the action of the plugin

  •  ssprelaunch i-3a840e59: java.lang.ExceptionInInitializerError
  •  ssprelaunch i-3a840e59:  at com.soundscry.web.play.Global$$anonfun$onStart$2.apply$mcV$sp(Global.scala:121)
  •  ssprelaunch i-3a840e59:  at akka.actor.Scheduler$$anon$9.run(Scheduler.scala:80)
  •  ssprelaunch i-3a840e59:  at akka.actor.LightArrayRevolverScheduler$$anon$3$$anon$2.run(Scheduler.scala:241)
  •  ssprelaunch i-3a840e59:  at scala.concurrent.impl.ExecutionContextImpl$$anon$3.exec(ExecutionContextImpl.scala:107)
  •  ssprelaunch i-3a840e59:  at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
  •  ssprelaunch i-3a840e59:  at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
  •  ssprelaunch i-3a840e59:  at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
  •  ssprelaunch i-3a840e59:  at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
  •  ssprelaunch i-3a840e59: Caused by: java.lang.IllegalStateException: Can't find the entity 'id' property for class models.Player, probably the entity class was loaded before the persistence context. Try to add a 'transactional{}' call on the application startup to force the persistence context load.Please also make sure that there aren't instance variables or methods referencing entities inside the main class.

Michał Jurczuk

unread,
May 8, 2015, 4:18:45 AM5/8/15
to activate-p...@googlegroups.com
You have to first load your context in Scala and Play Framework you can do something like:

class ActivateStartPlugin(app: play.Application) extends Plugin {

 
override def onStart = {
    models
.appPersistenceContext.context
  }
}


And add this to play.plugins

100:net.fwbrasil.activate.play.ActivatePlayPlugin
110:utils.plugin.ActivateStartPlugin
Reply all
Reply to author
Forward
0 new messages