我的Play 2.2.1应用程序可以在我的家用计算机上完美运行。

推送到Cloudbees后,它已成功编译和部署。

但是在运行时,当我访问应用程序的URL时,有时会收到502 Bad Gateway。然后,我可以做蜜蜂app:restart,问题可能会消失或无法消失。然后我做蜜蜂app:restart,它可能会再次出现。

我看不出背后有任何逻辑。重新启动50%之后,它会出现。

这是日志中的堆栈跟踪:

Play server process ID is 782
[[37minfo[0m] play - database [default] connected at jdbc:mysql://ec2-23-21-211-172.compute-1.amazonaws.com:3306/totointer
Exception in thread "main" java.lang.NoSuchMethodError: com.avaje.ebean.config.AutofetchConfig.isGarbageCollectionOnShutdown()Z
    at com.avaje.ebeaninternal.server.autofetch.DefaultAutoFetchManager.setOwner(DefaultAutoFetchManager.java:98)
    at com.avaje.ebeaninternal.server.autofetch.AutoFetchManagerFactory.createAutoFetchManager(AutoFetchManagerFactory.java:29)
    at com.avaje.ebeaninternal.server.autofetch.AutoFetchManagerFactory.create(AutoFetchManagerFactory.java:23)
    at com.avaje.ebeaninternal.server.core.InternalConfiguration.createAutoFetchManager(InternalConfiguration.java:154)
    at com.avaje.ebeaninternal.server.core.DefaultServer.<init>(DefaultServer.java:237)
    at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:207)
    at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:65)
    at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:59)
    at play.db.ebean.EbeanPlugin.onStart(EbeanPlugin.java:79)
    at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
    at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
    at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
    at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
    at play.api.Play$.start(Play.scala:87)
    at play.core.StaticApplication.<init>(ApplicationProvider.scala:52)
    at play.core.server.NettyServer$.createServer(NettyServer.scala:243)
    at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:279)
    at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:274)
    at scala.Option.map(Option.scala:145)
    at play.core.server.NettyServer$.main(NettyServer.scala:274)
    at play.core.server.NettyServer.main(NettyServer.scala)


有什么想法吗?

最佳答案

看起来是类路径中同一jar的冲突版本,其中之一具有AutofetchConfig类,但没有isGarbageCollectionOnShutdown方法。我注意到API doc上的示例此方法在2.6.0中不存在,但在3.2.2中存在

10-08 16:34