io.dropwizard.configuration.ConfigurationParsingException

/home/developer/projects/employee-service/employee-service-parent/employee-service/target/test-classes/config.yml has an error: * Failed to parse configuration at: metrics.reporters; Must call method with a container type (got [reference type, class java.util.Optional<io.dropwizard.util.Duration<[simple type, class io.dropwizard.util.Duration]>]) at [Source: N/A; line: -1, column: -1] (through reference chain: coop.employee.EmployeeServiceConfiguration["metrics"]->io.dropwizard.metrics.MetricsFactory["reporters"])

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web6

  • via Google Groups by Adrian Riley, 6 months ago
    /home/developer/projects/employee-service/employee-service-parent/employee-service/target/test-classes/config.yml has an error: * Failed to parse configuration at: metrics.reporters; Must call method with a container type (got [reference type
  • /path/to/test/factory-test-innerclass.yml has an error: * Failed to parse configuration at: inner.bigNumber; Can not deserialize instance of long out of END_OBJECT token at [Source: N/A; line: -1, column: -1] (through reference chain: io.dropwizard.configuration.ExampleWithInnerClasses["inner"]->io.dropwizard.configuration.Inner["bigNumber"])
  • token at [Source: N/A; line: -1, column: -1] (through reference chain: jackson.polymorphic.test.TestDropwizardConfiguration["persistence"]->jackson.polymorphic.test.TestPersistenceServiceConfigurationBuilder["strings"])
  • Stack trace

    • io.dropwizard.configuration.ConfigurationParsingException: /home/developer/projects/employee-service/employee-service-parent/employee-service/target/test-classes/config.yml has an error: * Failed to parse configuration at: metrics.reporters; Must call method with a container type (got [reference type, class java.util.Optional<io.dropwizard.util.Duration<[simple type, class io.dropwizard.util.Duration]>]) at [Source: N/A; line: -1, column: -1] (through reference chain: coop.employee.EmployeeServiceConfiguration["metrics"]->io.dropwizard.metrics.MetricsFactory["reporters"]) at com.google.common.base.Throwables.propagate(Throwables.java:160) at io.dropwizard.testing.DropwizardTestSupport.startIfRequired(DropwizardTestSupport.java:196) at io.dropwizard.testing.DropwizardTestSupport.before(DropwizardTestSupport.java:112) at io.dropwizard.testing.junit.DropwizardAppRule.before(DropwizardAppRule.java:128) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84) Caused by: io.dropwizard.configuration.ConfigurationParsingException: /home/developer/projects/employee-service/employee-service-parent/employee-service/target/test-classes/config.yml has an error: * Failed to parse configuration at: metrics.reporters; Must call method with a container type (got [reference type, class java.util.Optional<io.dropwizard.util.Duration<[simple type, class io.dropwizard.util.Duration]>]) at [Source: N/A; line: -1, column: -1] (through reference chain: coop.employee.EmployeeServiceConfiguration["metrics"]->io.dropwizard.metrics.MetricsFactory["reporters"]) at io.dropwizard.configuration.ConfigurationParsingException$Builder.build(ConfigurationParsingException.java:276) at io.dropwizard.configuration.YamlConfigurationFactory.build(YamlConfigurationFactory.java:152) at io.dropwizard.configuration.YamlConfigurationFactory.build(YamlConfigurationFactory.java:87) at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:124) at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:72) at io.dropwizard.testing.DropwizardTestSupport.startIfRequired(DropwizardTestSupport.java:194) ... 18 more Caused by: com.fasterxml.jackson.databind.JsonMappingException: Must call method with a container type (got [reference type, class java.util.Optional<io.dropwizard.util.Duration<[simple type, class io.dropwizard.util.Duration]>]) at [Source: N/A; line: -1, column: -1] (through reference chain: coop.employee.EmployeeServiceConfiguration["metrics"]->io.dropwizard.metrics.MetricsFactory["reporters"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:290) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:269) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:444) at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:183) at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:106) at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:91) at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:142) at com.fasterxml.jackson.datatype.guava.deser.GuavaImmutableCollectionDeserializer._deserializeContents(GuavaImmutableCollectionDeserializer.java:44) at com.fasterxml.jackson.datatype.guava.deser.GuavaImmutableCollectionDeserializer._deserializeContents(GuavaImmutableCollectionDeserializer.java:14) at com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.deserialize(GuavaCollectionDeserializer.java:103) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95) at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:156) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:95) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:224) at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:152) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3779) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2050) at io.dropwizard.configuration.YamlConfigurationFactory.build(YamlConfigurationFactory.java:123) ... 22 more Caused by: java.lang.IllegalArgumentException: Must call method with a container type (got [reference type, class java.util.Optional<io.dropwizard.util.Duration<[simple type, class io.dropwizard.util.Duration]>]) at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.findPropertyContentTypeResolver(JaxbAnnotationIntrospector.java:567) at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findPropertyContentTypeResolver(AnnotationIntrospectorPair.java:233) at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findPropertyContentTypeResolver(AnnotationIntrospectorPair.java:233) at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findPropertyContentTypeDeserializer(BasicDeserializerFactory.java:1516) at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.resolveType(BasicDeserializerFactory.java:1886) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.constructSettableProperty(BeanDeserializerFactory.java:717) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:504) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:228) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:406) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:352) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264) ... 42 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.