Google Groups

Re: [play-framework] [2.0] Project play-scala and Ebean


Zoro Apr 20, 2012 5:51 AM
Posted in group: play-framework
I have @Entity annotation. 

Replace ebean.default="models.*" with ebean.default="models.Model1, models.Model2, etc."  also didn't work for me.

I read all posts in thread https://groups.google.com/forum/#!msg/play-framework/Ojn4EcR6Yns/ga2ZYDys5mgJ . And at the end i found answer. Now this bug fixed in master branch. So i just building play from source.  https://github.com/playframework/Play20/wiki/BuildingFromSource And everything works fine.

Thanks.

On Thursday, April 19, 2012 12:05:26 AM UTC+4, Leonard Punt wrote:
Hi,


Your problem is:
- You have a class 'models.ParameterValue' which is not an entity (not annotated with @Entity).
- In your application.conf you have set the following parameter:
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
ebean.default="models.*"

To fix your error you should either:
- Make an entity from your class 'models.ParameterValue'.
- Replace ebean.default="models.*" with ebean.default="models.Model1, models.Model2, etc."

Leonard

Op woensdag 18 april 2012 20:57:12 UTC+2 schreef Zoro het volgende:
I opened a bug https://play.lighthouseapp.com/projects/82401/tickets/371-deployment-fail

On Apr 18, 9:44 pm, Zoro <khandra...@gmail.com> wrote:
> I have the same problem as described here ->https://github.com/li-o/Play20Exceptions
> I spent several days trying to solve it. It may be a bug in my code,
> but I do not know where.
> Appreciate any help.
>
> On Apr 18, 9:03 pm, Zoro <khandra...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I have the same problem. I added ebeanEnabled := true to Build.scala
> > (i use JAVA), but it doesn't work for me.
>
> > Have any suggestions?
>
> > Log:
>
> > 2012-04-18 21:00:29,959 - [INFO] - from play in main
> > Listening for HTTP on port 9000...
>
> > 2012-04-18 21:00:35,980 - [INFO] - from play in play-
> > akka.actor.default-dispatcher-1
> > database [default] connected at jdbc:mysql://localhost/artengi
>
> > 2012-04-18 21:00:37,345 - [ERROR] - from
> > com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager in play-
> > akka.actor.default-dispatcher-1
> > Error in deployment
> > javax.persistence.PersistenceException: Error with
> > [models.ParameterValue] It has not been enhanced but it's superClass
> > [class play.db.ebean.Model] is? (You are not allowed to mix
> > enhancement in a single inheritance hierarchy)
> > marker[play.db.ebean.Model] className[models.ParameterValue]
> >         at
> > com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.setEntityBeanCl ass(BeanDescriptorManager.java:
> > 1532) ~[ebean-2.7.3.jar:na]
> >         at
> > com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.createByteCode( BeanDescriptorManager.java:
> > 1204) ~[ebean-2.7.3.jar:na]
> >         at
> > com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssoc iations(BeanDescriptorManager.java:
> > 1124) ~[ebean-2.7.3.jar:na]
> >         at
> > com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeplo ymentAssociations(BeanDescriptorManager.java:
> > 630) ~[ebean-2.7.3.jar:na]
> >         at
> > com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDesc riptorManager.java:
> > 277) ~[ebean-2.7.3.jar:na]
> >         at
> > com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalCo nfiguration.java:
> > 150) [ebean-2.7.3.jar:na]
> >         ...
>
> > 2012-04-18 21:00:37,353 - [ERROR] - from application in New I/O server
> > worker #1-1
>
> > ! @6a4l61ck9 - Internal server error, for request [GET /] ->
>
> > play.api.UnexpectedException: Unexpected exception
> > [PersistenceException: Error with [models.ParameterValue] It has not
> > been enhanced but it's superClass [class play.db.ebean.Model] is? (You
> > are not allowed to mix enhancement in a single inheritance hierarchy)
> > marker[play.db.ebean.Model] className[models.ParameterValue]]
> >         at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$
> > $anonfun$1.apply(ApplicationProvider.scala:134) ~[play_2.9.1-2.0.jar:
> > 2.0]
> >         at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$
> > $anonfun$1.apply(ApplicationProvider.scala:112) ~[play_2.9.1-2.0.jar:
> > 2.0]
> >         at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2]
> >         at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply
> > $3.apply(ApplicationProvider.scala:112) ~[play_2.9.1-2.0.jar:2.0]
> >         at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply
> > $3.apply(ApplicationProvider.scala:110) ~[play_2.9.1-2.0.jar:2.0]
> >         at scala.Either$RightProjection.flatMap(Either.scala:277) ~[scala-
> > library.jar:0.11.2]
> >         ...
>
> > On Mar 17, 9:20 pm, Miuler <miu...@gmail.com> wrote:
>
> > > masterly :D thanks
>
> > > El sábado 17 de marzo de 2012 10:11:56 UTC-5, Freewind escribió:
>
> > > > I forget we should also add in Build.sbt:
>
> > > >   val main = PlayProject(appName, appVersion, appDependencies, mainLang =
> > > > SCALA).settings(
> > > >     ebeanEnabled := true
> > > >   )
>
> > > > And you can also port my demo in github:
> > > >https://github.com/freewind/play2_scala_ebean
>
> > > > You will see the `model can't be updated` issue of play2+scala+ebean
>
> > > > On Saturday, March 17, 2012 10:13:45 PM UTC+8, Miuler wrote:
>
> > > >> already added  :'(
>
> > > >> *application.conf*
> > > >> ebean.default="models.*"
> > > >> db.default.driver=org.h2.Driver
> > > >> db.default.url="jdbc:h2:mem:play"
>
> > > >> same problem:
>
> > > >> *PersistenceException*: Error with [*models.Persona*] *It has not been
> > > >> enhanced but it's superClass [class play.db.ebean.Model] is? *(You are
> > > >> not allowed to mix enhancement in a single inheritance hierarchy)
> > > >> marker[play.db.ebean.Model] className[models.Persona]
>
> > > >> El sábado 17 de marzo de 2012 09:05:06 UTC-5, Freewind escribió:
>
> > > >>> Add this to `application.conf`:
>
> > > >>>     # Ebean
> > > >>>     # ~~~~~
> > > >>>     ebean.default = "models.*"
>
> > > >>> But ....
>
> > > >>> Don't use play2-scala with ebean, there are many issues because play2
> > > >>> don't enhance scala code as Java code. You will find a lot of strange
> > > >>> things soon.
>
> > > >>> On Saturday, March 17, 2012 9:58:49 PM UTC+8, Miuler wrote:
>
> > > >>>> *Hi, i have a problem:*
>
> > > >>>> *PersistenceException*: Error with [*models.Persona*] *It has not been
> > > >>>> enhanced but it's superClass [class play.db.ebean.Model] is? *(You are
> > > >>>> not allowed to mix enhancement in a single inheritance hierarchy)
> > > >>>> marker[play.db.ebean.Model] className[models.Persona]
> > > >>>> No source available, here is the exception stack trace:
> > > >>>> ->javax.persistence.PersistenceException: Error with [models.Persona]
> > > >>>> It has not been enhanced but it's superClass [class play.db.ebean.Model]
> > > >>>> is? (You are not allowed to mix enhancement in a single inheritance
> > > >>>> hierarchy) marker[play.db.ebean.Model] className[models.Persona]
>
> > > >>>> *app/models/Persona.java*
> > > >>>> package models;
>
> > > >>>> import javax.persistence.Entity;
> > > >>>> import javax.persistence.Id;
>
> > > >>>> import play.db.ebean.Model;
>
> > > >>>> @Entity
> > > >>>> public class Persona extends Model {
>
> > > >>>>   @Id
> > > >>>>   public Long id;
>
> > > >>>>   public String nombre;
>
> > > >>>> }
>
> > > >>>> *application.conf*
> > > >>>> ebean.default="models.*"
> > > >>>> db.default.driver=org.h2.Driver
> > > >>>> db.default.url="jdbc:h2:mem:play"