Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

org.codehaus.jackson.map.JsonMappingException on Domain URL #29

Open
websterlkc opened this issue Sep 7, 2018 · 3 comments
Open

org.codehaus.jackson.map.JsonMappingException on Domain URL #29

websterlkc opened this issue Sep 7, 2018 · 3 comments

Comments

@websterlkc
Copy link

Hi All,

This is weird situation, I hit org.codehaus.jackson.map.JsonMappingException while i access via the
curl -vk "https://domain/dept/apiwebservices/requestToken/?params={%22type%22:%22internal%22}" or
curl -vk "https://192.168.1.50:443/dept/apiwebservices/requestToken/?params={%22type%22:%22internal%22}"

but if i try access from browser then below URL is working.
https://192.168.1.50:443/dept/apiwebservices/requestToken/?params={%22type%22:%22internal%22}
The domain URL is not working in browser as well
https://domain/dept//apiwebservices/requestToken/?params={%22type%22:%22internal%22}

Any idea?

Error from log

org.codehaus.jackson.map.JsonMappingException: Can not instantiate value of type [simple type, class com.test.model.TokenRequest] from JSON String; no single-String constructor/factory method
at org.codehaus.jackson.map.deser.std.StdValueInstantiator._createFromStringFallbacks(StdValueInstantiator.java:379) ~[jackson-mapper-asl-1.9.13.jar:1.9.13]
at org.codehaus.jackson.map.deser.std.StdValueInstantiator.createFromString(StdValueInstantiator.java:268) ~[jackson-mapper-asl-1.9.13.jar:1.9.13]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromString(BeanDeserializer.java:765) ~[jackson-mapper-asl-1.9.13.jar:1.9.13]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:585) ~[jackson-mapper-asl-1.9.13.jar:1.9.13]
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732) ~[jackson-mapper-asl-1.9.13.jar:1.9.13]
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863) ~[jackson-mapper-asl-1.9.13.jar:1.9.13]
at com.test.utils.JSonConverter.jsonToObject(JSonConverter.java:39) ~[classes:na]
at com.test.controller.TokenController.getToken(TokenController.java:100) [classes:na]

@cowtowncoder
Copy link
Member

I would need a reproduction of problem to help, in general; but also this is for Jackson 1.x which is not supported any more.

@websterlkc
Copy link
Author

websterlkc commented Sep 7, 2018

I using the jaskson version as below

<dependency>
	<groupId>com.fasterxml.jackson.core</groupId>
	<artifactId>jackson-core</artifactId>
	<version>2.8.10</version>
</dependency>
		
<dependency>
	<groupId>com.fasterxml.jackson.core</groupId>
	<artifactId>jackson-annotations</artifactId>
	<version>2.8.0</version>
</dependency>

<dependency>
	<groupId>com.fasterxml.jackson.core</groupId>
	<artifactId>jackson-databind</artifactId>
	<version>2.8.11.1</version>
</dependency>

@cowtowncoder
Copy link
Member

@websterlkc You may also include these (which are fine), but exception message clearly spells out class names (under package org.codehaus.) as well as actual jar name and version number. So system is running on Jackson 1.9.13, regardless of dependencies.
To run on Jackson 2.x, JSonConverter needs to be upgraded to use classes under com.fasterxml.jackson (jackson 2); they are on different Java package from Jackson 1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants