Search code examples
playorm

Installing PlayOrm in PlayFramework 2.1?


Steps I took:

  1. Started a new Play application.
  2. Created a lib folder.
  3. Copied to lib: playOrm/output/jardist/*.jar + playorm/output/libs/playorm.jar + playorm/src/resources/play2plugin/plugin2.1jar
  4. Changed the conf and added play.plugins.conf as per: http://buffalosw.com/wiki/PlayFramework-2.x-support/
  5. At this point, I started play and got a missing class exception for google gson. I added that to the lib as well.

Now, when I run the play app I get:

Plugin [play.CorePlugin] cannot been instantiated. java.lang.NoSuchMethodException: play.CorePlugin.(play.Application)

What am I missing?

UPDATE: Corrected the filename in my original post from plugin.conf to play.plugins and adding the stack trace:

java.lang.NoSuchMethodException: play.CorePlugin.<init>(play.Application)
   java.lang.Class.getConstructor0(Unknown Source)
   java.lang.Class.getConstructor(Unknown Source)
       play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:137)
       play.api.WithDefaultPlugins$$anonfun$plugins$1$$anonfun$apply$9.apply(Application.scala:130)
   scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
   scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
   ...

Solution

  • Ok. It seems that play1.x.jar is in your classpath. As CorePlugin exist in Play1.x only. Please remove that.