1

这是我的项目链接 https://github.com/jstar88/LibreTitan

我在 localhost 中编译了这个异常:play framework 2.1

意外异常

RuntimeException: Error reading annotations for models.User 没有可用的源,这里是异常堆栈跟踪:

->java.lang.RuntimeException:读取模型的注释时出错。用户

 com.avaje.ebeaninternal.server.deploy.parse.ReadAnnotations.readAssociations(ReadAnnotations.java:54)

 com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssociations(BeanDescriptorManager.java:1034)

 com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentAssociations(BeanDescriptorManager.java:565)

 com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:252)

 com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:124)

 com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:210)

 com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:64)

 com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:59)

 play.db.ebean.EbeanPlugin.onStart(EbeanPlugin.java:79)

 play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)

 play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)

 scala.collection.immutable.List.foreach(List.scala:309)

 play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:63)

 play.api.Play$$anonfun$start$1.apply(Play.scala:63)

 play.api.Play$$anonfun$start$1.apply(Play.scala:63)

 play.utils.Threads$.withContextClassLoader(Threads.scala:18)

 play.api.Play$.start(Play.scala:62)

 play.core.ReloadableApplication$$anonfun$get$1$$anonfun$1.apply(ApplicationProvider.scala:133)

 play.core.ReloadableApplication$$anonfun$get$1$$anonfun$1.apply(ApplicationProvider.scala:106)

 scala.Option.map(Option.scala:145)

 play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:106)

 play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:104)

 scala.util.Either$RightProjection.flatMap(Either.scala:523)

 play.core.ReloadableApplication.get(ApplicationProvider.scala:104)

 play.core.server.Server$class.sendHandler$1(Server.scala:56)

 play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:88)

 play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:87)

 scala.util.Either$RightProjection.flatMap(Either.scala:523)

 play.core.server.Server$class.getHandlerFor(Server.scala:87)

 play.core.server.NettyServer.getHandlerFor(NettyServer.scala:34)

 play.core.server.netty.PlayDefaultUpstreamHandler.messageReceived(PlayDefaultUpstreamHandler.scala:103)

 org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)

 org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:565)

 org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:793)

 org.jboss.netty.handler.codec.http.HttpContentDecoder.messageReceived(HttpContentDecoder.java:104)

 org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)

 org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:565)

 org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:793)

 org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)

 org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:455)

 org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:538)

 org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:437)

 org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:75)

 org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:565)

 org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)

 org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)

 org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)

 org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:84)

 org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:472)

 org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:333)

 org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)

 org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:102)

 org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)

 java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

 java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

 java.lang.Thread.run(Unknown Source)
4

2 回答 2

-1

当我在字段中使用@MappedSuperclassClass时遇到了这个问题。List<?>更改它以@Entity使异常消失。

于 2013-11-03T15:10:14.513 回答
-1

在类的顶部添加@Entity

于 2017-04-17T14:13:46.157 回答