• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Creating new field in a bean

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to add a new field (losowner) to a bean but apparently I'm doing it wrong because JBOSS gives me the following error:

ey.api.client.ClientHandlerException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "losowner" (Class com.voxportal.web.asset.LineOfServiceBean), not marked as ignorable
at [Source: java.io.ByteArrayInputStream@2e81863b; line: 1, column: 830] (through reference chain: com.voxportal.web.asset.AssetSearchBean["assetBeans"]->com.voxportal.web.asset.AssetBean["lineOfServiceBean"]->com.voxportal.web.asset.LineOfServiceBean["losowner"])

The code for LineOfServiceBean and VoxLineOfService are below:



 
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will probably do better in the JBoss forum, moving.
 
Marshal
Posts: 15887
265
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a JBoss issue. It has to do with Jackson, the JSON libary you are using.


ey.api.client.ClientHandlerException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "losowner" (Class com.voxportal.web.asset.LineOfServiceBean),


Search the internet for that error message and I'm sure it'll turn up suggestions on what you can do to resolve the issue.

Try to learn how to spot things like that in stack traces -- these kind of things happen all the time and being able to diagnose a problem is the first step towards self-sufficiency. If you get really stuck, at least you will be able to ShowSomeEffort (←click on that link) before asking for help.
 
Michael Piaser
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't post this in JBOSS - it was moved there for me. I saw the error and I have spent many hours trying to figure out why it says that field is not in the bean when I am adding it there. Hence, the question of how do you add a field into a bean. If a bean is inheriting it's "beanship" from other beans, does the field have to be defined to the other beans too?
 
Knute Snortum
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Michael Piaser wrote:I didn't post this in JBOSS - it was moved there for me.



Would you like me to move it to Java in General?
 
Michael Piaser
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably General is a better placement unless there is a forum specifically for Beans.
 
Junilu Lacar
Marshal
Posts: 15887
265
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only thing I can think of is that you have an older LineOfServiceBean.class file hanging around somewhere. Try cleaning out your target directory of all .class files and rebuild/recompile everything. If you're using Maven then do mvn clean first.
 
Sheriff
Posts: 22001
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu may be right, because I don't see any other reason you'd get this error. Besides checking for .class files, also check for any lingering .jar files you forgot you placed that include the class.
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic