Comments (15)
I think you need to give bit more information, as there are no known issues with @JsonProperty
with latest Jackson version (2.2).
So:
- What is the Jackson version?
- What does the whole Java class look like (not just field declaration)
- How are you serializing the object?
from jackson-annotations.
Hi
1). I use version 2.2.2 defined in Maven config
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.2</version>
</dependency>
2). My class looks like:
public class EditUserProfileTrigger extends SyncCRMTrigger implements Serializable {
private static final String ACTION = "updateCustomer";
@JsonProperty("internalid")
private Long crmId;
private String action = ACTION;
private CreateUserDataBean data;
public Long getCrmId() {
return crmId;
}
public void setCrmId(Long crmId) {
this.crmId = crmId;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public CreateUserDataBean getData() {
return data;
}
public void setData(CreateUserDataBean data) {
this.data = data;
}
}
3). Serialization has been done using interface Serializable
Field "crmId" must be replaced with "internalid" in result JSON string.
from jackson-annotations.
My class-service for serialization:
import com.fasterxml.jackson.databind.ObjectMapper;
import org.jboss.logging.Logger;
import ru.dz.wishlist.spring.controller.BaseController;
import java.io.IOException;
public class JsonService {
protected static Logger LOGGER = Logger.getLogger(BaseController.class);
private ObjectMapper mapper;
public JsonService() {
mapper = new ObjectMapper();
}
public String toJson(Object pojo) throws IOException {
return mapper.writeValueAsString(pojo);
}
public Object fromJson(String jsonString, Class classForMapping) throws IOException {
return mapper.readValue(jsonString, classForMapping);
}
}
Maven dependencies:
com.fasterxml.jackson.core
jackson-annotations
2.2.2
org.codehaus.jackson
jackson-core-asl
1.9.13
com.fasterxml.jackson.core
jackson-databind
2.2.2
from jackson-annotations.
That last bit is the thing that's happening:
- Jackson v1 is getting used by the thing doing the serialization.
- Jackson v2 annotations are on the objects, which Jackson v1 is ignoring.
from jackson-annotations.
It has been tried to use annotation from
org.codehaus.jackson
jackson-core-asl
1.9.13
In this case versions of dependencies are the same and equals to 1.9.13
But, there is no effect. Field "crmId" are not replaced with "internalid". It seems that annotation @JsonProperty is ignored again.
from jackson-annotations.
I has done such correction in Maven configuration:
Dependency for annotation
com.fasterxml.jackson.core
jackson-annotations
2.2.3
and other dependency:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
There is no effect. @JsonProperty annotation is being ignored.
from jackson-annotations.
Can you past in the output of mvn dependency:tree
?
from jackson-annotations.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:jboss:jar:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 107, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:common:jar:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 107, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:ejb:ejb:1.0.0
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.slf4j:slf4j-log4j12:jar -> duplicate declaration of version 1.5.6 @ line 63, column 21
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 107, column 12
[WARNING] The expression ${version} is deprecated. Please use ${project.version} instead.
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:service:sar:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 107, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:webapp-public:war:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 107, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:application:ear:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ ru.dz.wishlist:root:1.0.0, /mnt/mydisk/my/projects/project_wishlist/wishlist/pom.xml, line 107, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ru.dz.wishlist:root:pom:1.0.0
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ line 111, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 107, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] wishlist
[INFO] wishlist.jboss
[INFO] wishlist.common
[INFO] wishlist.ejb
[INFO] wishlist.service
[INFO] wishlist.webapp-public
[INFO] wishlist.application
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ root ---
[INFO] ru.dz.wishlist:root:pom:1.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist.jboss 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ jboss ---
[INFO] ru.dz.wishlist:jboss:jar:1.0.0
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- org.apache.tomcat:catalina:jar:6.0.33:provided
[INFO] | +- org.apache.tomcat:servlet-api:jar:6.0.33:provided
[INFO] | +- org.apache.tomcat:juli:jar:6.0.33:provided
[INFO] | - org.apache.tomcat:annotations-api:jar:6.0.33:provided
[INFO] +- org.jboss.logging:jboss-logging:jar:3.0.1.GA:provided
[INFO] - jboss:jbosssx:jar:3.2.3:provided
[INFO] - jboss:jboss-common:jar:3.2.3:provided
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist.common 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ common ---
[INFO] ru.dz.wishlist:common:jar:1.0.0
[INFO] +- ru.dz.wishlist:jboss:jar:1.0.0:provided
[INFO] +- jboss:jbosssx:jar:3.2.3:provided
[INFO] | - jboss:jboss-common:jar:3.2.3:provided
[INFO] +- org.hibernate:hibernate:jar:3.2.1.ga:provided
[INFO] | +- net.sf.ehcache:ehcache:jar:1.2.3:provided
[INFO] | +- javax.transaction:jta:jar:1.0.1B:provided
[INFO] | +- commons-logging:commons-logging:jar:1.0.4:provided
[INFO] | +- asm:asm-attrs:jar:1.5.3:provided
[INFO] | +- dom4j:dom4j:jar:1.6.1:provided
[INFO] | +- antlr:antlr:jar:2.7.6:provided
[INFO] | +- cglib:cglib:jar:2.1_3:provided
[INFO] | +- asm:asm:jar:1.5.3:provided
[INFO] | - commons-collections:commons-collections:jar:2.1.1:provided
[INFO] +- oro:oro:jar:2.0.8:compile
[INFO] +- commons-validator:commons-validator:jar:1.3.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.5:compile
[INFO] - com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist.ejb 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ ejb ---
[INFO] ru.dz.wishlist:ejb:ejb:1.0.0
[INFO] +- ru.dz.wishlist:common:jar:1.0.0:provided
[INFO] | +- oro:oro:jar:2.0.8:provided
[INFO] | +- commons-validator:commons-validator:jar:1.3.1:provided
[INFO] | +- commons-lang:commons-lang:jar:2.5:provided
[INFO] | - com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:provided
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:provided
[INFO] +- org.hibernate:hibernate-annotations:jar:3.4.0.GA:provided
[INFO] | +- org.hibernate:ejb3-persistence:jar:1.0.2.GA:provided
[INFO] | +- org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:provided
[INFO] | +- org.hibernate:hibernate-core:jar:3.3.0.SP1:provided
[INFO] | | +- antlr:antlr:jar:2.7.6:provided
[INFO] | | - commons-collections:commons-collections:jar:3.1:provided
[INFO] | - dom4j:dom4j:jar:1.6.1:provided
[INFO] | - xml-apis:xml-apis:jar:1.0.b2:provided
[INFO] +- org.slf4j:slf4j-api:jar:1.5.6:provided
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.6:provided
[INFO] | - log4j:log4j:jar:1.2.14:provided
[INFO] +- javax.ejb:ejb-api:jar:3.0:provided
[INFO] +- javax.transaction:jta:jar:1.1:provided
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.0.0.CR2:provided
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.0.1.GA:provided
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.0.CR2:provided
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:provided
[INFO] | - javassist:javassist:jar:3.12.0.GA:provided
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- org.jboss.arquillian.junit:arquillian-junit-container:jar:1.0.3.Final:test
[INFO] | +- org.jboss.arquillian.junit:arquillian-junit-core:jar:1.0.3.Final:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-api:jar:1.0.3.Final:test
[INFO] | | - org.jboss.arquillian.core:arquillian-core-api:jar:1.0.3.Final:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-spi:jar:1.0.3.Final:test
[INFO] | | - org.jboss.arquillian.core:arquillian-core-spi:jar:1.0.3.Final:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.0.3.Final:test
[INFO] | | - org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.1:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.0.3.Final:test
[INFO] | | - org.jboss.arquillian.container:arquillian-container-spi:jar:1.0.3.Final:test
[INFO] | | - org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0-alpha-3:test
[INFO] | +- org.jboss.arquillian.core:arquillian-core-impl-base:jar:1.0.3.Final:test
[INFO] | +- org.jboss.arquillian.test:arquillian-test-impl-base:jar:1.0.3.Final:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-impl-base:jar:1.0.3.Final:test
[INFO] | | +- org.jboss.arquillian.config:arquillian-config-api:jar:1.0.3.Final:test
[INFO] | | +- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.0.3.Final:test
[INFO] | | - org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0-alpha-3:test
[INFO] | +- org.jboss.arquillian.container:arquillian-container-test-impl-base:jar:1.0.3.Final:test
[INFO] | - org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.1:test
[INFO] | - org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.0.1:test
[INFO] +- org.jboss.spec:jboss-javaee-6.0:pom:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.resource:jboss-connector-api_1.5_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.0.Final:provided
[INFO] | | - javax.xml:jaxrpc-api:jar:1.1:provided
[INFO] | +- org.jboss.spec.javax.el:jboss-el-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.servlet.jsp:jboss-jsp-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.rpc:jboss-jaxrpc-api_1.1_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:jar:1.0.0.Final:provided
[INFO] | +- org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:jar:1.0.0.Final:provided
[INFO] | +- javax.activation:activation:jar:1.1:provided
[INFO] | +- javax.enterprise:cdi-api:jar:1.0-SP4:provided
[INFO] | +- com.sun.faces:jsf-api:jar:2.0.3-b05:provided
[INFO] | +- javax.inject:javax.inject:jar:1:provided
[INFO] | +- javax.jws:jsr181-api:jar:1.0-MR1:provided
[INFO] | +- javax.servlet:jstl:jar:1.2:provided
[INFO] | +- org.jboss.resteasy:jaxrs-api:jar:2.1.0.GA:provided
[INFO] | +- stax:stax-api:jar:1.0.1:provided
[INFO] | - javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO] +- com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO] +- jboss:jboss-system:jar:4.2.2.GA:provided
[INFO] +- jboss:jboss-common:jar:4.2.2.GA:provided
[INFO] +- jboss:jboss-jmx:jar:4.2.2.GA:provided
[INFO] - javax.mail:mail:jar:1.4.4:provided
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist.service 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ service ---
[INFO] ru.dz.wishlist:service:sar:1.0.0
[INFO] +- ru.dz.wishlist:common:jar:1.0.0:provided
[INFO] | +- oro:oro:jar:2.0.8:provided
[INFO] | +- commons-validator:commons-validator:jar:1.3.1:provided
[INFO] | +- commons-lang:commons-lang:jar:2.5:provided
[INFO] | - com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:provided
[INFO] +- ru.dz.wishlist:ejb:ejb:1.0.0:provided
[INFO] | - com.googlecode.json-simple:json-simple:jar:1.1:provided
[INFO] +- jboss:jboss-common:jar:4.2.2.GA:provided
[INFO] +- jboss:jboss-system:jar:4.2.2.GA:provided
[INFO] +- jboss:jboss-jmx:jar:4.2.2.GA:provided
[INFO] +- javax.mail:mail:jar:1.4.4:provided
[INFO] | - javax.activation:activation:jar:1.1:provided
[INFO] - org.jboss.logging:jboss-logging:jar:3.0.1.GA:provided
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist.webapp-public 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ webapp-public ---
[INFO] ru.dz.wishlist:webapp-public:war:1.0.0
[INFO] +- ru.dz.wishlist:jboss:jar:1.0.0:provided
[INFO] +- ru.dz.wishlist:common:jar:1.0.0:provided
[INFO] | +- oro:oro:jar:2.0.8:provided
[INFO] | +- commons-lang:commons-lang:jar:2.5:compile
[INFO] | - com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:compile
[INFO] +- ru.dz.wishlist:ejb:ejb:1.0.0:provided
[INFO] | - com.googlecode.json-simple:json-simple:jar:1.1:provided
[INFO] +- javax.ejb:ejb-api:jar:3.0:provided
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:provided
[INFO] +- org.hibernate:hibernate-core:jar:4.0.0.CR2:provided
[INFO] | +- antlr:antlr:jar:2.7.7:provided
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.0.CR2:provided
[INFO] | +- dom4j:dom4j:jar:1.6.1:provided
[INFO] | | - xml-apis:xml-apis:jar:1.0.b2:provided
[INFO] | +- commons-collections:commons-collections:jar:3.1:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:provided
[INFO] | +- com.fasterxml:classmate:jar:0.5.4:provided
[INFO] | +- javassist:javassist:jar:3.12.0.GA:provided
[INFO] | - javax.transaction:jta:jar:1.1:provided
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- org.springframework:spring-web:jar:3.0.6.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:3.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:3.0.6.RELEASE:compile
[INFO] | - org.springframework:spring-core:jar:3.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-asm:jar:3.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:3.0.6.RELEASE:compile
[INFO] | - org.springframework:spring-expression:jar:3.0.6.RELEASE:compile
[INFO] +- org.apache.tiles:tiles-core:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-api:jar:2.2.2:compile
[INFO] | - commons-digester:commons-digester:jar:2.0:compile
[INFO] +- org.apache.tiles:tiles-jsp:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-servlet:jar:2.2.2:compile
[INFO] | - org.apache.tiles:tiles-template:jar:2.2.2:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2:compile
[INFO] +- commons-io:commons-io:jar:2.1:runtime
[INFO] +- taglibs:standard:jar:1.1.2:provided
[INFO] +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:runtime
[INFO] +- com.octo.captcha:jcaptcha-integration-simple-servlet:jar:2.0-alpha-1:compile
[INFO] | - com.octo.captcha:jcaptcha:jar:2.0-alpha-1:compile
[INFO] | +- com.octo.captcha:jcaptcha-api:jar:2.0-alpha-1:compile
[INFO] | - com.jhlabs:filters:jar:2.0.235:compile
[INFO] +- org.apache.velocity:velocity:jar:1.7:compile
[INFO] +- org.apache.tomcat:catalina:jar:6.0.33:provided
[INFO] | +- org.apache.tomcat:servlet-api:jar:6.0.33:provided
[INFO] | +- org.apache.tomcat:juli:jar:6.0.33:provided
[INFO] | - org.apache.tomcat:annotations-api:jar:6.0.33:provided
[INFO] +- commons-validator:commons-validator:jar:1.4.0:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] | - commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.jsoup:jsoup:jar:1.7.2:compile
[INFO] +- com.google.api.client:google-api-client:jar:1.4.1-beta:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- com.google.code.gson:gson:jar:1.6:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.0.3:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.0.1:compile
[INFO] | | - commons-codec:commons-codec:jar:1.3:compile
[INFO] | +- org.codehaus.jackson:jackson-core-asl:jar:1.6.7:compile
[INFO] | - xpp3:xpp3:jar:1.1.4c:compile
[INFO] +- com.google.api.client:google-api-client-googleapis:jar:1.4.1-beta:compile
[INFO] +- com.google.api.client:google-api-client-json:jar:1.2.3-alpha:compile
[INFO] | +- com.google.api.client:google-api-client-http:jar:1.2.3-alpha:compile
[INFO] | | +- com.google.api.client:google-api-client-escape:jar:1.2.3-alpha:compile
[INFO] | | - com.google.api.client:google-api-client-repackaged-com-google-common-base:jar:1.2.3-alpha:compile
[INFO] | - com.google.api.client:google-api-client-util:jar:1.2.3-alpha:compile
[INFO] +- com.google.gdata:core:jar:1.47.1:compile
[INFO] | +- com.google.oauth-client:google-oauth-client-jetty:jar:1.11.0-beta:compile
[INFO] | | +- com.google.oauth-client:google-oauth-client-java6:jar:1.11.0-beta:compile
[INFO] | | | - com.google.oauth-client:google-oauth-client:jar:1.11.0-beta:compile
[INFO] | | | - com.google.http-client:google-http-client:jar:1.11.0-beta:compile
[INFO] | | - org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | | - org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | - javax.mail:mail:jar:1.4:compile
[INFO] | - javax.activation:activation:jar:1.1:compile
[INFO] +- com.google.guava:guava:jar:14.0.1:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] | - org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hornetq:hornetq-core:jar:2.2.21.Final:compile
[INFO] +- org.hornetq:hornetq-jms:jar:2.2.21.Final:compile
[INFO] +- org.hornetq:hornetq-logging:jar:2.2.21.Final:compile
[INFO] +- org.hornetq:hornetq-transports:jar:2.0.0.GA:compile
[INFO] +- org.hornetq:hornetq-spring-integration:jar:2.3.0.Final:compile
[INFO] +- org.hornetq:hornetq-core-client:jar:2.3.0.Final:compile
[INFO] | +- org.jgroups:jgroups:jar:3.2.5.Final:compile
[INFO] | +- org.hornetq:hornetq-commons:jar:2.3.0.Final:compile
[INFO] | +- org.hornetq:hornetq-journal:jar:2.3.0.Final:compile
[INFO] | | - org.jboss.logmanager:jboss-logmanager:jar:1.2.2.GA:compile
[INFO] | - io.netty:netty:jar:3.6.2.Final:compile
[INFO] +- org.hornetq:hornetq-server:jar:2.3.0.Final:compile
[INFO] +- org.hornetq:hornetq-jms-client:jar:2.3.0.Final:compile
[INFO] | - org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] +- org.hornetq:hornetq-jms-server:jar:2.3.0.Final:provided
[INFO] | +- org.jboss.jbossts:jbossjts:jar:4.16.4.Final:provided
[INFO] | +- org.jboss:jboss-transaction-spi:jar:7.0.0.Final:provided
[INFO] | | - org.jboss.spec.javax.resource:jboss-connector-api_1.5_spec:jar:1.0.0.Final:provided
[INFO] | - org.jboss.naming:jnpserver:jar:5.0.3.GA:provided
[INFO] +- org.jboss.netty:netty:jar:3.2.9.Final:provided
[INFO] +- org.jboss.javaee:jboss-jms-api:jar:1.1.0.GA:provided
[INFO] +- org.jboss:jboss-common-core:jar:2.2.10.GA:provided
[INFO] +- org.jboss.logging:jboss-logging-spi:jar:2.1.0.GA:provided
[INFO] +- jboss:jnpserver:jar:4.2.2.GA:provided
[INFO] +- org.springframework:spring-jms:jar:3.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.0.6.RELEASE:compile
[INFO] | - org.springframework:spring-tx:jar:3.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.0.6.RELEASE:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.2.3:compile
[INFO] - com.fasterxml.jackson.core:jackson-databind:jar:2.2.3:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wishlist.application 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ application ---
[INFO] ru.dz.wishlist:application:ear:1.0.0
[INFO] +- ru.dz.wishlist:common:jar:1.0.0:compile
[INFO] | +- oro:oro:jar:2.0.8:compile
[INFO] | +- commons-validator:commons-validator:jar:1.3.1:compile
[INFO] | +- commons-lang:commons-lang:jar:2.5:compile
[INFO] | - com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:compile
[INFO] +- ru.dz.wishlist:ejb:ejb:1.0.0:compile
[INFO] | - com.googlecode.json-simple:json-simple:jar:1.1:compile
[INFO] - ru.dz.wishlist:webapp-public:war:1.0.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] wishlist .......................................... SUCCESS [0.848s]
[INFO] wishlist.jboss .................................... SUCCESS [0.053s]
[INFO] wishlist.common ................................... SUCCESS [0.065s]
[INFO] wishlist.ejb ...................................... SUCCESS [0.324s]
[INFO] wishlist.service .................................. SUCCESS [0.379s]
[INFO] wishlist.webapp-public ............................ SUCCESS [0.322s]
[INFO] wishlist.application .............................. SUCCESS [0.025s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.606s
[INFO] Finished at: Fri Oct 25 11:15:20 MSK 2013
[INFO] Final Memory: 14M/309M
[INFO] ------------------------------------------------------------------------
from jackson-annotations.
With org.springframework:spring-webmvc:jar:3.0.6.RELEASE
, I think it's set up to use Jackson v1 if it's on the classpath but doesn't have autodetection for Jackson v2. Try this SO post:
http://stackoverflow.com/questions/10420040/jackson-2-0-with-spring-3-1
from jackson-annotations.
Jackson is not used in controller class.
I think, that problem appear independently from Spring.
from jackson-annotations.
Problem has been solved using @xmlelement(name = "internalid") annotation imported as
import javax.xml.bind.annotation.XmlElement;
Thanks for the response.
from jackson-annotations.
I should have suggested from beginning one problem: discrepancy between Jackson 1.x and 2.x annotations & library itself is relatively common problem.
So you must use matching version of Jackson and annotations: 1.x annotations will not work with Jackson 2.x.
If you need to have compatibility with both versions (which is doable; they can co-exist), you need to either add both annotations, or use a custom AnnotationIntrospector
that recognizes both (also doable). There is an open-source impementation of such introspector, but I don't have link at hand.
Use of JAXB annotation as work-around works too, but the root cause seems to be version incompatibility.
from jackson-annotations.
I tried to use the same version 2.2.3 for all libraries, but this had no effect.
from jackson-annotations.
One thing you can try to rule out Jackson problems is to run simple stand-alone test, construction ObjectMapper
and using annotated classes, directly serializing instances into JSON. This should confirm whether the problem is with Jackson, or with version incompatibility via Spring. Class as shown should work as you expect; although usually I would put @JsonProperty
on getter method, not private field. But that should not cause problems that you describe, either way.
from jackson-annotations.
@cowtowncoder - I am having the same problem as mentioned here. Here is my SO question with sample app. http://stackoverflow.com/questions/40169084/jsonproperty-not-working-weblogic-12-2-1-and-java-8
from jackson-annotations.
Related Issues (20)
- [FEATURE] Using Jackson Annotations simultaneously: @JsonNaming @JsonAlias HOT 4
- remove (alias) "Json" from annotations HOT 1
- FEATURE : add annotation support to generate dependencies / dependentRequired into a schema file HOT 1
- Document that @JsonAlias can be used on enum values HOT 3
- enable @jsonignores ignore property of property of and more... HOT 1
- @JsonIgnore usage instead of @JsonManagedReference and @JsonBackReference HOT 1
- Add @Inherited annotation to all Jackson annotations HOT 2
- `@JsonIgnore` on `public boolean isSomething()` methods: Bug or feature ? HOT 4
- Add support for prefix and suffix on @JsonAnySetter annotation HOT 3
- Allow explicit `JsonSubTypes` repeated names check HOT 1
- A interface has annodationed (@JsonTypeInfo/@JsonSubTypes) , but got a Exception HOT 1
- Multiple Variable Declarations (Single Line) HOT 11
- Add NOTICE file with copyright information HOT 20
- @JsonProperty on a boolean field results into two fields in the final JSON HOT 2
- Add `JsonFormat.Feature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS`
- Add "require type id for subtypes" property for `JsonTypeInfo.Value` in 3.0 HOT 8
- @JsonCreator with constuctor, whitch parameters annotated with @JsonProperty
- Rename ambiguous `JsonProperty.Access.*` constants HOT 1
- Allow `@JsonAnySetter` on `ElementType.PARAMETER` (for use on constructor parameters)
- Convert unit tests to JUnit5 (from JUnit4) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-annotations.