-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnrecognizedPropertyException #49
Comments
Have you tried adding
As a class annotation on |
Thanks Jesper. I did try that, and strangely, it still throws an error.
…Sent from my iPhone
On Sep 25, 2017, at 9:23 AM, Jesper Joergensen <notifications@github.com<mailto:notifications@github.com>> wrote:
Have you tried adding
@JsonIgnoreProperties(ignoreUnknown = true)
As a class annotation on com.test.Account?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#49 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Aa9mQL5S66vZQgJIZcE7jzRXEy4xmJKbks5sl9N2gaJpZM4Pecuj>.
|
Also, do you plan on every adding the DTO objects as part of the library?
…-- Edgar
From: Jesper Joergensen <notifications@github.com<mailto:notifications@github.com>>
Reply-To: jesperfj/force-rest-api <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, September 25, 2017 at 9:23 AM
To: jesperfj/force-rest-api <force-rest-api@noreply.github.com<mailto:force-rest-api@noreply.github.com>>
Cc: Edgar Castanedo <edgar.castanedo@tollfreeforwarding.com<mailto:edgar.castanedo@tollfreeforwarding.com>>, Author <author@noreply.github.com<mailto:author@noreply.github.com>>
Subject: Re: [jesperfj/force-rest-api] UnrecognizedPropertyException (#49)
Have you tried adding
@JsonIgnoreProperties(ignoreUnknown = true)
As a class annotation on com.test.Account?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#49 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Aa9mQL5S66vZQgJIZcE7jzRXEy4xmJKbks5sl9N2gaJpZM4Pecuj>.
|
Which API version are you using? I am getting similar (but not necessarily same) errors when running tests with API version 40. |
I am sorry but I can you clarify your question on DTO objects? |
Oh sure. I just meant objects like account, lead, contact, etc. So that we don’t have to create them.
…Sent from my iPhone
On Sep 25, 2017, at 9:26 PM, Jesper Joergensen <notifications@github.com<mailto:notifications@github.com>> wrote:
I am sorry but I can you clarify your question on DTO objects?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#49 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Aa9mQOMDsgKTGQF7WYI_FJUlQ00ocDPTks5smHzXgaJpZM4Pecuj>.
|
I see. No. It is explicitly not in scope for this project to maintain class representations of those objects. My hope is to make force-rest-api interoperate seamlessly with other projects that seek to autogenerate and maintain class representations of various Salesforce projects. |
@edgartff I faced the same issue, due to the code recommendation suggested by my IDE. My mapper class was fasterxml.jackson but the IDE imported codehaus.jackson which conflicted with the @JsonProperty annotation. |
Hello,
I followed the instructions in the README file in order to make a call to get an Account object and I received the following error. Is this a bug or am I doing something wrong?
2017-09-20 20:31:35,559 ERROR [http-nio-8080-exec-10] GrailsExceptionResolver - UnrecognizedPropertyException occurred when processing request: [GET] /api/test/testSalesforce
Unrecognized field "attributes" (class com.test.Account), not marked as ignorable (6 known properties: "tffAccountNumber", "metaClass", "externalId", "id", "name", "annualRevenue"])
at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@68b2688d; line: 1, column: 16] (through reference chain: com.test.Account["attributes"]). Stacktrace follows:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "attributes" (class com.test.Account), not marked as ignorable (6 known properties: "tffAccountNumber", "metaClass", "externalId", "id", "name", "annualRevenue"])
at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@68b2688d; line: 1, column: 16] (through reference chain: com.test.Account["attributes"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)
at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:817)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:954)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1324)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1302)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:249)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:136)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3562)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2648)
at com.force.api.ResourceRepresentation.as(ResourceRepresentation.java:31)
at com.test.TestController$$EQVncaRc.testSalesforce(TestController.groovy:116)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at net.bull.javamelody.JspWrapper.invoke(JspWrapper.java:150)
at net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler.invoke(JdbcWrapper.java:286)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:201)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.rest.RestAuthenticationFilter.doFilter(RestAuthenticationFilter.groovy:139)
at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
at grails.plugin.springsecurity.rest.RestLogoutFilter.doFilter(RestLogoutFilter.groovy:80)
at com.AssetFilter.doFilter(AssetFilter.groovy:55)
at com.security.XssFilter.doFilterInternal(XssFilter.groovy:17)
at grails.plugin.databasesession.SessionProxyFilter.doFilterInternal(SessionProxyFilter.java:60)
The text was updated successfully, but these errors were encountered: