• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Annotation not converting results to JSON  RSS feed

 
Ranch Hand
Posts: 174
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: 2508
321
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a Jackson dependency?
 
John Morgan
Ranch Hand
Posts: 174
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added that in, and still not change.  
 
John Morgan
Ranch Hand
Posts: 174
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: 2508
321
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • 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: 174
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: 2508
321
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • 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: 174
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.
 
Have you no shame? Have you no decency? Have you no tiny ad?
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!