com.fasterxml.jackson.databind.JsonMappingException
See original GitHub issueI am getting ‘The username may not be null or empty’ error message when I started jmxtrans using the following command.
./jmxtrans.sh start ~/jmx_influx.json
json file content:
{
"servers" : [ {
"port" : "8999",
"host" : "10.10.90.54",
"username" : "vganta",
"queries" : [ {
"obj" : "java.lang:type=Memory",
"attr" : [ "HeapMemoryUsage", "NonHeapMemoryUsage" ],
"resultAlias":"jvmMemory",
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory",
"url" : "http://10.10.90.54:8086/",
"database" : "jmxDB"
} ]
} ]
} ]
}
Logs:
[17 Nov 2016 16:24:22] [main] 167 ERROR (com.googlecode.jmxtrans.JmxTransformer:190) - Error parsing json: /home/vganta/jmx_influx.json
com.googlecode.jmxtrans.exceptions.LifecycleException: Error parsing json: /home/vganta/jmx_influx.json
at com.googlecode.jmxtrans.ConfigurationParser.parseServers(ConfigurationParser.java:62)
at com.googlecode.jmxtrans.JmxTransformer.processFilesIntoServers(JmxTransformer.java:354)
at com.googlecode.jmxtrans.JmxTransformer.startupSystem(JmxTransformer.java:322)
at com.googlecode.jmxtrans.JmxTransformer.start(JmxTransformer.java:187)
at com.googlecode.jmxtrans.JmxTransformer.doMain(JmxTransformer.java:157)
at com.googlecode.jmxtrans.JmxTransformer.main(JmxTransformer.java:138)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Instantiation of [simple type, class com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory] value failed (java.lang.IllegalArgumentExcep
tion): The username may not be null or empty.
at [Source: N/A; line: -1, column: -1] (through reference chain: com.googlecode.jmxtrans.model.JmxProcess["servers"]->java.util.ArrayList[0]->com.googlecode.jmxtrans.model.Server["queries"]->java.util.Arr
ayList[0]->com.googlecode.jmxtrans.model.Query["outputWriters"]->java.util.ArrayList[0])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:262)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.wrapAsJsonMappingException(StdValueInstantiator.java:445)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.rewrapCtorProblem(StdValueInstantiator.java:464)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:258)
at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:135)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:444)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1123)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:298)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:168)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:135)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:120)
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.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:279)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:465)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:380)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1123)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:298)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:277)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:490)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:465)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:380)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1123)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:298)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:277)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
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.vanillaDeserialize(BeanDeserializer.java:260)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3779)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2050)
at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:2547)
at com.googlecode.jmxtrans.util.JsonUtils.parseProcess(JsonUtils.java:54)
at com.googlecode.jmxtrans.ConfigurationParser.parseServers(ConfigurationParser.java:55)
... 5 more
Caused by: java.lang.IllegalArgumentException: The username may not be null or empty.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at org.influxdb.InfluxDBFactory.connect(InfluxDBFactory.java:33)
at com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory.<init>(InfluxDbWriterFactory.java:100)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:114)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:256)
... 44 more
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
com.fasterxml.jackson.databind.JsonMappingException: Can ...
Following is the code I am using to convert. ObjectMapper mapper = new ObjectMapper(); TypeFactory typeFactory = TypeFactory.defaultInstance ...
Read more >Jackson Exceptions - Problems and Solutions - Baeldung
First, let's take a look at JsonMappingException: Can Not Construct Instance Of. This exception is thrown if Jackson can't create an ...
Read more >JsonMappingException (jackson-databind 2.8.0 API)
Checked exception used to signal fatal problems with mapping of content, distinct from low-level I/O problems (signaled using simple IOException s) or data ......
Read more >com.fasterxml.jackson.databind.JsonMappingException java ...
Best Java code snippets using com.fasterxml.jackson.databind.JsonMappingException (Showing top 20 results out of 1,404) ...
Read more >com.fasterxml.jackson.databind.JsonMappingException ...
Hi, I'm getting this error in incubator-zeppellin: com.fasterxml.jackson.databind.JsonMappingException: Could not find creator property with name 'id' (in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for pointing out the problem. I am able to successfully start jmxtrans process using the following json.
Just open an issue describing what new feature you want.