- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将我的应用程序从 play 2.2.6 升级到 play 2.6.3,但我遇到了这个问题。
我已阅读 @KdgDev's 的答案和 @NikolajPL's问题,听起来很相似,但到目前为止没有任何帮助。
我不确定这个问题的根源,但我认为它可能与Redis DB连接有关,因为它使用不同的缓存方法,并且从play 2.5开始默认ehcahce应该被禁用。
我的conf文件:
# Mongo configuration
# ~~~~~~~~~~~~~~~~~
mongodb.name=mongoAbc
mongodb.host=localhost
mongodb.port=27017
application.global=api.abc
# Spring configuration
# ~~~~~
# Define what spring context should be used.
spring.context="components.xml"
# Router
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `conf/my.application.Router`,
# you may need to define a router file `my.application.controllers`.
# Default to Routes in the root package (and `conf/controllers`)
# application.router=my.application.Routes
# Test configuration
# ~~~~~
# To create test/1.sql uncomment following lines:
#ebean.test="model.*"
#db.test.driver=org.postgresql.Driver
#db.test.url="postgres://abc:def@localhost:5432/abc"
#applyEvolutions.test=true
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""
db.default.driver=org.postgresql.Driver
db.default.url="postgres://abc:def@localhost:5432/abc"
# DB Pooling
# --------------
# In order to reduce lock contention and thus improve performance,
# each incoming connection request picks off a connection from a
# pool that has thread-affinity.
# The higher this number, the better your performance will be for the
# case when you have plenty of short-lived threads.
# Beyond a certain threshold, maintenance of these pools will start
# to have a negative effect on performance (and only for the case
# when connections on a partition start running out).
db.default.partitionCount=7
# The number of connections to create per partition. Setting this to
# 5 with 3 partitions means you will have 15 unique connections to the
# database. Note that BoneCP will not create all these connections in
# one go but rather start off with minConnectionsPerPartition and
# gradually increase connections as required.
db.default.maxConnectionsPerPartition=30
# The number of initial connections, per partition.
db.default.minConnectionsPerPartition=5
# When the available connections are about to run out, BoneCP will
# dynamically create new ones in batches. This property controls
# how many new connections to create in one go (up to a maximum of
# maxConnectionsPerPartition). Note: This is a per-partition setting.
db.default.acquireIncrement=1
# After attempting to acquire a connection and failing, try to
# connect this number of times before giving up.
db.default.acquireRetryAttempts=10
# How long to wait before attempting to obtain a
# connection again after a failure.
db.default.acquireRetryDelay=5 seconds
# The maximum time to wait before a call
# to getConnection is timed out.
db.default.connectionTimeout=1 second
# Idle max age
db.default.idleMaxAge=10 seconds
# This sets the time for a connection to remain idle before sending a test query to the DB.
# This is useful to prevent a DB from timing out connections on its end.
db.default.idleConnectionTestPeriod=5 minutes
# An initial SQL statement that is run only when
# a connection is first created.
db.default.initSQL="SELECT 1"
# If enabled, log SQL statements being executed.
db.default.logStatements=false
# The maximum connection age.
db.default.maxConnectionAge=20 seconds
# You can expose this datasource via JNDI if needed (Useful for JPA)
# db.default.jndiName=DefaultDS
# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
ebean.default="model.*"
applyEvolutions.default=true
applyDownEvolutions.default=true
# MailGun configuration
# ~~~~~~~~~~~~~~~~~
mailgun.api.key=${?MAILGUN_API_KEY}
mailgun.domain=${?MAILGUN_DOMAIN}
# Uncomment to prevent sending real emails
# mail.disabled=true
# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/),
# by providing an application-log.xml file in the conf directory.
#logger=OFF
#log.application=OFF
#log.play=OFF
# Redis
# ~~~~~
ehcacheplugin=disabled
redis.uri=${?REDISCLOUD_URL}
# The default cache module (EhCache) will be used for all non-named cache UNLESS this module (RedisModule)
# is the only cache module that was loaded. If this module is the only cache module being loaded,
# it will work as expected on named and non-named cache. To disable the default cache module so that this Redis Module
# can be the default cache you must put this in your configuration
# See https://github.com/playframework/play-plugins/tree/master/redis for reference
play.modules.disabled += "play.api.cache.EhCacheModule"
# Redis module supports play 2.5 NamedCaches through key namespacing on a single Sedis pool.
# To add additional namepsaces besides the default (play), the configuration would
# look like play.cache.redis.bindCaches = ["db-cache", "user-cache", "session-cache"]
# See https://github.com/playframework/play-plugins/tree/master/redis for reference
play.cache.redis.bindCaches = ["db-cache", "user-cache", "session-cache"]
# Amazon
# ~~~~~
youtube.api.key=${?ABC_YOUTUBE_API_KEY}
# Akka
# Threadpool
# ~~~~~~~~~~
play {
akka {
akka.loggers = ["akka.event.slf4j.Slf4jLogger"]
loglevel = DEBUG
jvm-exit-on-fatal-error = off
log-config-on-start = off
actor {
default-dispatcher = {
fork-join-executor {
parallelism-min = 50
parallelism-max = 120
}
}
download-context = {
fork-join-executor {
parallelism-min = 50
parallelism-max = 50
}
}
conversion-context {
fork-join-executor {
parallelism-min = 1
parallelism-factor = 1.0
parallelism-max = 10
}
}
}
}
}
akka.log-dead-letters = off
akka.log-dead-letters-during-shutdown = off
# Modules
# ~~~~~~~
play.modules.enabled += "module.MongoDBModule"
play.modules.enabled += "module.S3Module"
play.cache.defaultCache=default
play.cache.dispatcher = "contexts.blockingCacheDispatcher"
contexts {
blockingCacheDispatcher {
fork-join-executor {
parallelism-factor = 3.0
}
}
}
构建.sbt
name := "abc-api"
version := "0.27.7"
lazy val abc_api = (project in file(".")).enablePlugins(PlayJava, PlayEbean)
scalaVersion := "2.11.1"
lazy val akkaVersion = "2.5.3"
libraryDependencies ++= Seq(
javaJdbc,
guice,
ehcache,
cacheApi,
evolutions,
"org.avaje.ebeanorm" % "avaje-ebeanorm-api" % "3.1.1",
"com.jolbox" % "bonecp" % "0.8.0.RELEASE",
// https://mvnrepository.com/artifact/io.rest-assured/rest-assured
"io.rest-assured" % "rest-assured" % "3.0.3" % "test",
// https://mvnrepository.com/artifact/postgresql/postgresql
"postgresql" % "postgresql" % "9.1-901-1.jdbc4",
// https://mvnrepository.com/artifact/org.springframework/spring-context
"org.springframework" % "spring-context" % "4.3.10.RELEASE",
// https://mvnrepository.com/artifact/org.springframework/spring-test
"org.springframework" % "spring-test" % "4.3.10.RELEASE" % "test",
// https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk
"com.amazonaws" % "aws-java-sdk" % "1.11.188",
"org.imgscalr" % "imgscalr-lib" % "4.2",
// https://mvnrepository.com/artifact/org.apache.tika/tika-core
"org.apache.tika" % "tika-core" % "1.16",
// https://mvnrepository.com/artifact/org.apache.tika/tika-parsers
"org.apache.tika" % "tika-parsers" % "1.16",
// https://mvnrepository.com/artifact/commons-io/commons-io
"commons-io" % "commons-io" % "2.5",
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
"org.apache.commons" % "commons-lang3" % "3.6",
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
"org.apache.commons" % "commons-collections4" % "4.1",
// https://mvnrepository.com/artifact/commons-validator/commons-validator
"commons-validator" % "commons-validator" % "1.6",
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
"org.apache.httpcomponents" % "httpclient" % "4.5.3",
// Deprecated - ? "commons-httpclient" % "commons-httpclient" % "3.1" exclude("org.apache.commons", "httpclient"),
// https://mvnrepository.com/artifact/org.mockito/mockito-core
"org.mockito" % "mockito-core" % "2.9.0" % "test",
// https://mvnrepository.com/artifact/org.mockito/mockito-all
"org.mockito" % "mockito-all" % "2.0.2-beta" % "test",
// https://mvnrepository.com/artifact/org.mindrot/jbcrypt
"org.mindrot" % "jbcrypt" % "0.4",
// https://mvnrepository.com/artifact/org.jcodec/jcodec
"org.jcodec" % "jcodec" % "0.2.1",
// https://mvnrepository.com/artifact/com.mashape.unirest/unirest-java
"com.mashape.unirest" % "unirest-java" % "1.4.9",
// https://mvnrepository.com/artifact/com.github.spullara.mustache.java/compiler
"com.github.spullara.mustache.java" % "compiler" % "0.9.5",
// https://mvnrepository.com/artifact/xerces/xercesImpl
"xerces" % "xercesImpl" % "2.11.0",
// https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver
"org.mongodb" % "mongo-java-driver" % "3.6.0-beta1",
// https://mvnrepository.com/artifact/com.github.tomakehurst/wiremock
"com.github.tomakehurst" % "wiremock" % "2.8.0" % "test" pomOnly(),
// https://mvnrepository.com/artifact/com.sun.mail/javax.mail
"com.sun.mail" % "javax.mail" % "1.6.0",
// https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-core
"io.dropwizard.metrics" % "metrics-core" % "3.2.4",
// https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-healthchecks
"io.dropwizard.metrics" % "metrics-healthchecks" % "3.2.4",
// https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-jvm
"io.dropwizard.metrics" % "metrics-jvm" % "3.2.4",
// https://mvnrepository.com/artifact/org.jsoup/jsoup
"org.jsoup" % "jsoup" % "1.10.3",
// https://mvnrepository.com/artifact/com.helger/ph-css
"com.helger" % "ph-css" % "5.0.4",
// https://mvnrepository.com/artifact/de.vandermeer/asciitable
"de.vandermeer" % "asciitable" % "0.3.2",
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion,
"com.typesafe.play" %% "play-iteratees" % "2.6.1",
// https://mvnrepository.com/artifact/com.typesafe.play.modules/play-modules-redis_2.11
"com.typesafe.play.modules" % "play-modules-redis_2.11" % "2.5.0",
"org.easytesting" % "fest-assert" % "1.4" % "test",
filters
)
javaOptions in Test ++= Seq(
"-Dtest.timeout=10000000",
"-Dconfig.file=conf/application-test.conf",
"-XX:MaxPermSize=2048M",
"-XX:+UseConcMarkSweepGC",
"-XX:+CMSClassUnloadingEnabled"
)
javacOptions in (Compile, compile) ++= Seq(
"-Xlint",
"-source",
"1.8",
"-target",
"1.8"
)
scalacOptions += "-Yresolve-term-conflict:package"
插件.sbt
// Comment to get more information during initialization
logLevel := Level.Warn
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.3")
// Play enhancer - this automatically generates getters/setters for public fields
// and rewrites accessors of these fields to use the getters/setters. Remove this
// plugin if you prefer not to have this feature, or disable on a per project
// basis using disablePlugins(PlayEnhancer) in your build.sbt
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")
// In order for DataService to work with spring we need to include the dependency here (see: https://groups.google.com/forum/#!topic/play-framework/UIsRqnQ8x3g)
// https://mvnrepository.com/artifact/org.springframework/spring-context
libraryDependencies += "org.springframework" % "spring-context" % "4.3.10.RELEASE"
// https://mvnrepository.com/artifact/org.javassist/javassist
libraryDependencies += "org.javassist" % "javassist" % "3.21.0-GA"
我正在使用 sbt 运行我的项目并获取以下堆栈跟踪:
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
(Server started, use Enter to stop and go back to the console...)
[error] application -
! @758h3g5n5 - Internal server error, for (GET) [/] ->
play.api.UnexpectedException: Unexpected exception[NoClassDefFoundError: play/cache/DefaultCacheApi]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1.reload(DevServerStart.scala:190)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1.get(DevServerStart.scala:124)
at play.core.server.AkkaHttpServer.play$core$server$AkkaHttpServer$$modelConversion(AkkaHttpServer.scala:183)
at play.core.server.AkkaHttpServer.play$core$server$AkkaHttpServer$$handleRequest(AkkaHttpServer.scala:189)
at play.core.server.AkkaHttpServer$$anonfun$5.apply(AkkaHttpServer.scala:106)
at play.core.server.AkkaHttpServer$$anonfun$5.apply(AkkaHttpServer.scala:106)
at akka.stream.impl.fusing.MapAsync$$anon$23.onPush(Ops.scala:1172)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:499)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:462)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:368)
Caused by: java.lang.NoClassDefFoundError: play/cache/DefaultCacheApi
at com.typesafe.play.redis.RedisModule.bindings(RedisModule.scala:61)
at play.api.inject.guice.GuiceableModuleConversions$class.guice(GuiceInjectorBuilder.scala:339)
at play.api.inject.guice.GuiceableModule$.guice(GuiceInjectorBuilder.scala:273)
at play.api.inject.guice.GuiceableModuleConversions$$anon$3$$anonfun$guiced$2.apply(GuiceInjectorBuilder.scala:318)
at play.api.inject.guice.GuiceableModuleConversions$$anon$3$$anonfun$guiced$2.apply(GuiceInjectorBuilder.scala:318)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.immutable.List.foreach(List.scala:383)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.immutable.List.map(List.scala:286)
Caused by: java.lang.ClassNotFoundException: play.cache.DefaultCacheApi
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.typesafe.play.redis.RedisModule.bindings(RedisModule.scala:61)
at play.api.inject.guice.GuiceableModuleConversions$class.guice(GuiceInjectorBuilder.scala:339)
at play.api.inject.guice.GuiceableModule$.guice(GuiceInjectorBuilder.scala:273)
at play.api.inject.guice.GuiceableModuleConversions$$anon$3$$anonfun$guiced$2.apply(GuiceInjectorBuilder.scala:318)
at play.api.inject.guice.GuiceableModuleConversions$$anon$3$$anonfun$guiced$2.apply(GuiceInjectorBuilder.scala:318)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply
最佳答案
您正在引用 Typesafe Redis 模块,该模块适用于 2.3、2.4 或 2.5。它与 2.6 不兼容,因为 Play 2.6 中的缓存实现与 2.5 中的实现不二进制兼容。
您有 3 个选择:
1) 使用默认的EHCache2)更新Redis模块兼容2.63)编写您自己的实现。
关于java - Play Framework 2.6 : NoClassDefFoundError: play/cache/DefaultCacheApi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46058138/
所以我的应用程序的评论显示在我的游戏控制台中,但是由于某种原因,当我在 google Play 商店上访问我的应用程序链接并以普通用户的身份查看它时,我没有收到新评论的通知,我的显示了 13 条评论,
一旦我在 2.3 play 项目上运行 'sbt compile',我就不能再使用 'sbt compile' 来编译任何 Play 2.2.x 项目。这是我运行 sbt 命令时的错误。 [info]
我有点困惑,想得到一个解释。 我正在使用 Java Play 2 和 Akka Actor 。我使用 play run 启动系统。 不过,我刚刚看到一个视频,使用了命令: play akka star
当我玩游戏时,我遇到两个选择play.api.mvc和 play.mvc包裹 有什么不同? 最佳答案 从戏! 2 文档: The API available in the play.api packa
从 2.3 迁移到 2.4 后,我收到此错误。我应该使用的正确导入语句是什么? error: value routesImport is not a member of object play.Pla
所以我在 google play 上有一个应用程序已经将近 6 个月了,最近两个月我更新了我的应用程序屏幕截图,从那时起,每次我更新我的应用程序时,我都开始收到应用程序拒绝。 上次我提出上诉并被接受,
我有以下代码: Snapshots.OpenSnapshotResult result; result = Games.Snapshots.open(googleApiClient, "save",
在过去 72 小时内,我为 Google Play 开发者计划支付的 Google 电子钱包付款显示为“您的购买正在处理中”。我知道这可能需要长达 48 小时,但这是他们处理时间最坏情况之后的一整天。
我在 Play 商店发布了应用程序,我不知道为什么应用程序显示预注册,我想为我的用户提供直接下载选项。伸出援手将不胜感激。 最佳答案 instructions for pre-registration
我有一个 PHP 后端,它与 Google Play 服务集成以验证从 APP 进行的购买。购买信息返回收据和签名,我需要验证购买是否正确。 我收到: { ...rest of the data
我在 Google Play Developer Console 上创建了我的 Android 应用程序的草稿。我已经填写了所有需要的信息。必需的步骤之一是“内容评级”。我已填写表格以自动分配 Goo
我已经设置好了 com.typesafe.play play_2.13 2.7.4 在项目 pom.xml 中。但是,当我尝试遵循this tutorial时,语句 pla
我在 Play 商店上发布了一个应用程序,并收到了一些评论。在Google Play开发者控制台中,我在一些评论中看不到应用程序的版本。这是我在“应用程序”标题下找到的内容。 版本代码 — 版本名称
假设 A 是所有者。我希望我们团队的 B、C 和 D 用户能够上传我们应用程序的新版本。这可能吗?来自 this我不太清楚用户有什么样的权限。如果有人对这部分有任何经验,欢迎。 最佳答案 您需要 go
我正在尝试将应用重新提交到 Google Play,但我似乎可以找到一种技术上的方法来实现此目的。 我对“您的应用主要针对 COPPA 定义的 13 岁以下 child 吗?”的回答是肯定的,然后在不
我想分享一下我在分析 Google Play 控制台的新功能时遇到的情况,并尝试找到解决方案。 正如你们许多人可能已经知道的那样,Google 已在 Google Play 控制台上发布了更新并引入了
我有两个用 playframework 编写的应用程序。我想加入另一个。我有一个数据库,我想在它们之间共享我的登录类。应用程序对类、方法、变量使用不同的名称。 我怎样才能实现它?我应该创建 jar 版
对于我的硕士论文,我需要自动将来自 Google Play 的不同 Android 应用程序的信息写入一个文本文件。所以我使用 perl 脚本语言来实现这种自动化。我的 perl 脚本可以在 Goog
我想测试子项目是如何工作的,尤其是 routes在主项目 ( this was not visible before ) 中考虑了子项目的数量。 我在这里阅读了文档: https://github.c
我正在使用 Play 框架 2.1.2,我有一个 handlere 方法返回一个 Promise,如 Play 的 2.1.2 documentation 中所述 但是 Play 抛出编译错误说: C
我是一名优秀的程序员,十分优秀!