• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Annotation not converting results to JSON

 
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working through a maven project and was running some test and found that my Jackson annotations were not converting the results to JSON. I cannot figure out what I am doing wrong.



POM.XML


I do know that I am getting:

resultObject "com.dotComIt.learnWith.vos.UserVO@32f8813f"

What I was expecting to get :

{
"resultObject":
    {"roleID":1,
     "username":"me",
     "userID":1},
"error":false
}


Any suggestions?
 
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a Jackson dependency?
 
John Morgan
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added that in, and still not change.  
 
John Morgan
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the complete POM... I did find that the project is using Jersey framework (not something I am familiar with).

 
Ron McLeod
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Morgan wrote:


That looks like a MOXy provider, not Jackson.  


The equivalent Jackson dependency would be:
Disclaimer: I am still learning Maven
 
John Morgan
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added that to my pom and still not converting to JSON. Not sure what I am doing wrong.
 
Ron McLeod
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the pom.xml file that you posted (no changes), added a resource and entity, compiled the project, ran in on TomEE 1.7.0 (Tomcat 8.5), called it from Chrome, and it did return a JSON representation.
 
John Morgan
Ranch Hand
Posts: 184
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you... evidently it is something with my set up then and I will have to look deeper into what could cause it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!