You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"docStore has type OBJECT rather than LIST" error when Elastic configuration is in application.conf #104
changed the title [-]"docStore has type OBJECT rather than LIST" when Elastic configuration in application.conf[/-][+]"docStore has type OBJECT rather than LIST" when Elastic configuration is in application.conf[/+]on Nov 10, 2016
changed the title [-]"docStore has type OBJECT rather than LIST" when Elastic configuration is in application.conf[/-][+]"docStore has type OBJECT rather than LIST" error when Elastic configuration is in application.conf[/+]on Nov 10, 2016
To use DocStore, You have to put these lines on conf/ebean.properties. The file application.conf is only used to configure datasource and model location (for enhancement and register classes with Ebean server).
I could, but I would have to put all ebean configuration in this file (I tried to mix configuration between the ebean.properties and application.conf, but it doesn't work) and the way I deal with different environnement doesn't really allow that. A fix would be more than welcome :)
...of course it doesn't work. It's an example of what play-ebean configuration could looks like in the future. I just said "could be a good approach to handle configuration of all Ebean functionalities.".
I can propose a PR this weekend or next weekend... I don't promise all configuration keys will be implemented, but the docstore related keys should working.
# Ebean
# ~~~~~
ebean {
servers {
# You can declare as many servers as you want.
# By convention, the default server is named `default`
default {
# Locations of the classes to enhance
enhancement = ["models.*"]
# Extra server settings
settings {
# Set to true if this server is Document store only
onlyUseDocStore = false
# Encryption key manager to use for fields annotated with @Encrypted
#encryptKeyManager = "com.zero_x_baadf00d.ebean.encryption.StandardEncryptKeyManager"
}
# Document store
docstore {
# URL of the ElasticSearch server to use
url = "http://127.0.0.1:9200"
# Enable document store integration
active = true
# Set the relative file system path to resources when generating mapping files
pathToResources = "conf"
# Generate mapping files for each index and these will by default be
# generated into ${pathToResources} under "elastic-mapping"
generateMapping = false
# Drop and re-create all indexes
dropCreate = false
# Create only indexes that have not already been defined
create = false
}
}
}
}
@cpoissonnier I tried this plugin addSbtPlugin("com.payintech" % "sbt-play-ebean" % "16.12"
& still got this error /application.conf:** 87-90: docstore has type OBJECT rather than LIST]
Anyone else who is able to run this successfully...please share the config format.
@ethereal-sandeep have you upgraded your application.conf file ? If you have in develop mode, think to restart server after editing project/plugins.sbt.
# Ebean
# ~~~~~
ebean {
servers {
# You can declare as many servers as you want.
# By convention, the default server is named `default`
default {
# Locations of the classes to enhance
enhancement = ["models.*"]
# Extra server settings
settings {
# Set to true if this server is Document store only
onlyUseDocStore = false
# Encryption key manager to use for fields annotated with @Encrypted
#encryptKeyManager = "com.zero_x_baadf00d.ebean.encryption.StandardEncryptKeyManager"
}
# Document store
docstore {
# URL of the ElasticSearch server to use
url = "http://127.0.0.1:9200"
# Enable document store integration
active = true
# Set the relative file system path to resources when generating mapping files
pathToResources = "conf"
# Generate mapping files for each index and these will by default be
# generated into ${pathToResources} under "elastic-mapping"
generateMapping = false
# Drop and re-create all indexes
dropCreate = false
# Create only indexes that have not already been defined
create = false
}
}
}
}
@ethereal-sandeep Could copy / past your application.conf (gist) ? have you try to clean ivy cache ?
Guys, i know this must have started irritating you all but bear with me for a while. @cpoissonnier i added the settings and also clears ivy2/cache and tried a fresh compile..got this in return.
java.lang.RuntimeException: com.typesafe.config.ConfigException$WrongType: application.conf @ file:/home/user/projects/server/conf/application.conf: 86-93: servers has type OBJECT rather than LIST
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:159)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getList(SimpleConfig.java:252)
at com.typesafe.config.impl.SimpleConfig.getHomogeneousUnwrappedList(SimpleConfig.java:323)
at com.typesafe.config.impl.SimpleConfig.getStringList(SimpleConfig.java:381)
at play.db.ebean.EbeanParsedConfig.lambda$parseFromConfig$0(EbeanParsedConfig.java:68)
at java.util.Map.forEach(Map.java:630)
at play.db.ebean.EbeanParsedConfig.parseFromConfig(EbeanParsedConfig.java:62)
at play.db.ebean.ModelsConfigLoader.apply(ModelsConfigLoader.java:28)
at play.db.ebean.ModelsConfigLoader.apply(ModelsConfigLoader.java:21)
at play.ebean.sbt.PlayEbean$$anonfun$configuredEbeanModels$1$$anonfun$apply$1.apply(PlayEbean.scala:133)
at play.ebean.sbt.PlayEbean$$anonfun$configuredEbeanModels$1$$anonfun$apply$1.apply(PlayEbean.scala:130)
at play.ebean.sbt.PlayEbean$$anonfun$configuredEbeanModels$1.withClassLoader$1(PlayEbean.scala:109)
at play.ebean.sbt.PlayEbean$$anonfun$configuredEbeanModels$1.apply(PlayEbean.scala:130)
at play.ebean.sbt.PlayEbean$$anonfun$configuredEbeanModels$1.apply(PlayEbean.scala:98)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (compile:playEbeanModels) com.typesafe.config.ConfigException$WrongType: application.conf @ file:/home/user/projects/server/conf/application.conf: 86-93: servers has type OBJECT rather than LIST
[error] application -
! @72ejhm9ge - Internal server error, for (POST) [/test] ->
play.sbt.PlayExceptions$UnexpectedException: Unexpected exception[RuntimeException: com.typesafe.config.ConfigException$WrongType: application.conf @ file:/home/user/projects/server/conf/application.conf: 86-93: servers has type OBJECT rather than LIST]
at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:51)
at play.sbt.run.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
at scala.Option.map(Option.scala:145)
at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:44)
at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:40)
at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
at play.sbt.run.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
at scala.util.Either$LeftProjection.map(Either.scala:377)
at play.sbt.run.PlayReload$.compile(PlayReload.scala:17)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3$$anonfun$2.apply(PlayRun.scala:61)
Caused by: java.lang.RuntimeException: com.typesafe.config.ConfigException$WrongType: application.conf @ file:/home/user/projects/server/conf/application.conf: 86-93: servers has type OBJECT rather than LIST
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:159)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:170)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:184)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:189)
at com.typesafe.config.impl.SimpleConfig.getList(SimpleConfig.java:252)
at com.typesafe.config.impl.SimpleConfig.getHomogeneousUnwrappedList(SimpleConfig.java:323)
at com.typesafe.config.impl.SimpleConfig.getStringList(SimpleConfig.java:381)
at play.db.ebean.EbeanParsedConfig.lambda$parseFromConfig$0(EbeanParsedConfig.java:68)
at java.util.Map.forEach(Map.java:630)
at play.db.ebean.EbeanParsedConfig.parseFromConfig(EbeanParsedConfig.java:62)
my application.conf
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
#
ebean.servers.default.enhancement=["models.*"] #Must be a LIST
# Ebean elastic search
ebean.servers.default.docstore.url="http://127.0.0.1:9200"
ebean.servers.default.docstore.active=true
ebean.servers.default.docstore.generateMapping=false
ebean.servers.default.docstore.dropCreate=false
ebean.servers.default.docstore.create=true
ebean.servers.default.docstore.pathToResources="conf"
#
@ethereal-sandeep I think you don't use our plugin, cause you have an error on the file EbeanParsedConfig.java who has been removed since the version 16.12.
Are you sure addSbtPlugin("com.payintech" % "sbt-play-ebean" % "16.12") is in your project\plugins.sbt file ? Have you clean your project (rm targetdirectory) ?
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10")
// Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using "PlayEbean"
// https://github.com/playframework/play-ebean/issues/104
addSbtPlugin("com.payintech" % "sbt-play-ebean" % "16.11")
@ethereal-sandeep You don't use the right version. 16.11 don't allow configuration of document store via application.conf. You can upgrade to release/16.12.
@0xBAADF00D, @cpoissonnier Thanks man!! it finally compiled . but strangely [info] c.z.h.HikariDataSource - HikariPool-1 - Started.
then again HikariPool-1 closed and HikariPool-2 started..then HikariPool-2 closed and HikariPool-3 started...this for once went till 33..
gist of it is mentioned below...
[info] application - Shutting down connection pool.
[info] c.z.h.p.HikariPool - HikariPool-2 - Close initiated...
[info] c.z.h.p.HikariPool - HikariPool-2 - Closed.
[warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
[info] application - Creating Pool for datasource 'default'
[info] c.z.h.HikariDataSource - HikariPool-3 - Started.
Seems not related to sbt-play-ebean module. Maybe try to fix the following warning and check our datasource configuration (db.default.driver, db.default.url, db.default.username, ...)
[warn] application - Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead.
which will be part of the next releases. Since this issue is about two things, here's a summary:
1. The error docStore has type OBJECT rather than LIST: fixed
Play Ebean reads the lists of models from ebean.<server> in Play's configuration, and took every entry below ebean. for such a list. So any other setting there, like ebean.docstore.url, made it fail, at runtime as well as in the sbt plugin when loading the models to enhance. Now Play Ebean only uses strings and lists below ebean. as models, and ignores everything else.
2. Configuring Ebean in application.conf: not supported
Ebean doesn't read Play's application.conf. It reads its own settings from conf/application.yaml or conf/application.properties (ebean.properties is deprecated). So Ebean settings in application.conf have no effect, and Play Ebean now logs a warning for such ignored settings from a .conf file. Put them into conf/application.yaml instead, which only Ebean reads, e.g.:
Alternatively, a ServerConfigStartup (like in the comment above) can set them programmatically. Make sure it's covered by an ebean. config line, e.g. by putting it into the models package, otherwise Ebean doesn't pick it up.
The docs now explain where Ebean's own settings go.
Activity
[-]"docStore has type OBJECT rather than LIST" when Elastic configuration in application.conf[/-][+]"docStore has type OBJECT rather than LIST" when Elastic configuration is in application.conf[/+][-]"docStore has type OBJECT rather than LIST" when Elastic configuration is in application.conf[/-][+]"docStore has type OBJECT rather than LIST" error when Elastic configuration is in application.conf[/+]cpoissonnier commentedon Nov 10, 2016
I managed to make it work thanks to the ServerConfigStartup, by adding :
marcospereira commentedon Nov 29, 2016
Problem is here:
play-ebean/play-ebean/src/main/java/play/db/ebean/EbeanParsedConfig.java
Lines 49 to 54 in 34ec6cf
This is just accepting/parsing String and List configurations.
thibaultmeyer commentedon Nov 29, 2016
To use DocStore, You have to put these lines on
conf/ebean.properties. The fileapplication.confis only used to configure datasource and model location (for enhancement and register classes with Ebean server).cpoissonnier commentedon Dec 2, 2016
I could, but I would have to put all ebean configuration in this file (I tried to mix configuration between the
ebean.propertiesandapplication.conf, but it doesn't work) and the way I deal with different environnement doesn't really allow that. A fix would be more than welcome :)thibaultmeyer commentedon Dec 2, 2016
I see, it make sense, something like that (see below) could be a good approach to handle configuration of all Ebean functionalities.
application.conf
thibaultmeyer commentedon Dec 2, 2016
...of course it doesn't work. It's an example of what play-ebean configuration could looks like in the future. I just said "could be a good approach to handle configuration of all Ebean functionalities.".
cpoissonnier commentedon Dec 2, 2016
My bad !
That would be perfect
thibaultmeyer commentedon Dec 2, 2016
I can propose a PR this weekend or next weekend... I don't promise all configuration keys will be implemented, but the docstore related keys should working.
thibaultmeyer commentedon Dec 10, 2016
@cpoissonnier
I have rewritted so many files, not sure it will be merged in this project. So we are published our version under our organization.
in your
project/plugins.sbtfile, you can override sbt-play-ebean with :And use this
application.confcpoissonnier commentedon Dec 10, 2016
Great ! Thank you so much, I'll try this monday !
ethereal-sandeep commentedon Dec 19, 2016
@cpoissonnier I tried this plugin
addSbtPlugin("com.payintech" % "sbt-play-ebean" % "16.12"& still got this error
/application.conf:** 87-90: docstore has type OBJECT rather than LIST]Anyone else who is able to run this successfully...please share the config format.
thibaultmeyer commentedon Dec 19, 2016
@ethereal-sandeep have you upgraded your
application.conffile ? If you have in develop mode, think to restart server after editingproject/plugins.sbt.@ethereal-sandeep Could copy / past your application.conf (gist) ? have you try to clean ivy cache ?
12 remaining items
cpoissonnier commentedon Dec 21, 2016
https://gist.github.com/cpoissonnier/66c8f4689d4ddae6b4ea6447315430cd
ethereal-sandeep commentedon Dec 22, 2016
Guys, i know this must have started irritating you all but bear with me for a while. @cpoissonnier i added the settings and also clears ivy2/cache and tried a fresh compile..got this in return.
my application.conf
thibaultmeyer commentedon Dec 22, 2016
@ethereal-sandeep I think you don't use our plugin, cause you have an error on the file
EbeanParsedConfig.javawho has been removed since the version 16.12.Are you sure
addSbtPlugin("com.payintech" % "sbt-play-ebean" % "16.12")is in yourproject\plugins.sbtfile ? Have you clean your project (rmtargetdirectory) ?ethereal-sandeep commentedon Dec 22, 2016
my plugins.sbt
thibaultmeyer commentedon Dec 22, 2016
@ethereal-sandeep You don't use the right version. 16.11 don't allow configuration of document store via
application.conf. You can upgrade to release/16.12.ethereal-sandeep commentedon Dec 22, 2016
@0xBAADF00D Seriously thats was the only thing ... My Bad .Let me check
ethereal-sandeep commentedon Dec 22, 2016
@0xBAADF00D, @cpoissonnier Thanks man!! it finally compiled . but strangely
[info] c.z.h.HikariDataSource - HikariPool-1 - Started.then again HikariPool-1 closed and HikariPool-2 started..then HikariPool-2 closed and HikariPool-3 started...this for once went till 33..
gist of it is mentioned below...
thibaultmeyer commentedon Dec 22, 2016
Seems not related to
sbt-play-ebeanmodule. Maybe try to fix the following warning and check our datasource configuration (db.default.driver,db.default.url,db.default.username, ...)You can read more at https://www.playframework.com/documentation/2.5.x/JavaDatabase and https://www.playframework.com/documentation/2.5.x/SettingsLogger
ethereal-sandeep commentedon Dec 22, 2016
@0xBAADF00D okay, thanks !!
cpoissonnier commentedon Feb 23, 2017
Is this issue gonna be resolved in the 4.0.0 version?
allnash commentedon Mar 28, 2018
Which release is this going to be in?
mkurz commentedon Oct 8, 2026
This got closed by
8.x, [7.x] Ignore Ebean settings below ebean.* that are no lists of models #908 for7.x)which will be part of the next releases. Since this issue is about two things, here's a summary:
1. The error
docStore has type OBJECT rather than LIST: fixedPlay Ebean reads the lists of models from
ebean.<server>in Play's configuration, and took every entry belowebean.for such a list. So any other setting there, likeebean.docstore.url, made it fail, at runtime as well as in the sbt plugin when loading the models to enhance. Now Play Ebean only uses strings and lists belowebean.as models, and ignores everything else.2. Configuring Ebean in
application.conf: not supportedEbean doesn't read Play's
application.conf. It reads its own settings fromconf/application.yamlorconf/application.properties(ebean.propertiesis deprecated). So Ebean settings inapplication.confhave no effect, and Play Ebean now logs a warning for such ignored settings from a.conffile. Put them intoconf/application.yamlinstead, which only Ebean reads, e.g.:Alternatively, a
ServerConfigStartup(like in the comment above) can set them programmatically. Make sure it's covered by anebean.config line, e.g. by putting it into themodelspackage, otherwise Ebean doesn't pick it up.The docs now explain where Ebean's own settings go.