Announcement Announcement Module
No announcement yet.
TwitterTemplate - jackson VerifyError Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • TwitterTemplate - jackson VerifyError

    I am trying to use spring-social to post status to Twitter via TwitterTemplate, getting this error. I dont have any jackson jar in the classpath. Any clue?

    Exception in thread "main" java.lang.VerifyError: (class: org/codehaus/jackson/map/ObjectMapper, method: writeValueAsBytes signature: (Ljava/lang/Object[B) Incompatible argument to function
    at org.springframework.http.converter.json.MappingJac ksonHttpMessageConverter.<init>(MappingJacksonHttp
    at org.springframework.web.client.RestTemplate.<init> (
    at org.springframework.web.client.RestTemplate.<init> (
    at eClientFactory.create(ProtectedResourceClientFacto
    at iBinding.<init>(
    at rTemplate.<init>(
    at SocialMain.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
    at java.lang.reflect.Method.invoke(
    at com.intellij.rt.execution.application.AppMain.main (

  • #2
    VerifyError indicates that the JVM found some inconsistency or security problem with the given class file; typically the case when you compile against one version of a class and then run against a different and incompatible version. From this, it appears to be complaining about the ObjectMapper.writeValueAsBytes() method from the Jackson library.

    You say you don't have the Jackson JAR in your classpath, but you must for it to be complaining this way--it's likely be complaining with a different exception. Even so, you *should* have Jackson in your classpath or else you'll have troubles working with TwitterTemplate (it needs Jackson to do the JSON parsing of results coming back from the Twitter API). If you're using Maven or Gradle, then Jackson should be pulled in transitively as it is a required dependency of spring-social-twitter (and it should pull in the correct version).

    I see you're running this via IntelliJ, but I don't know how you've created your project in your IDE. Are you importing a Maven/Gradle project or using any sort of IntelliJ support for Maven/Gradle dependency resolution? (Admittedly, I'm not an IntelliJ user, so I'm at a disadvantage to help out much with that aspect of your project.)