Announcement Announcement Module
No announcement yet.
Integration with Facebook - java.lang.NoSuchMethodError: Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integration with Facebook - java.lang.NoSuchMethodError:


    I have downloaded Spring Facebook integration demo using

    However when I try to implement, faced lot of issues.
    a) Does any one have a working example with appropriate libraries.
    b) If not, I am having issue with the code I have downloaded. when I run the app, I am getting the following problem

    SEVERE: Servlet.service() for servlet appServlet threw exception
    java.lang.NoSuchMethodError: le(Lorg/codehaus/jackson/map/ModuleV
    at ookTemplate.getJsonMessageConverter(FacebookTempla
    at iBinding.getMessageConverters(AbstractOAuth2ApiBin
    at iBinding.<init>(
    at ookTemplate.<init>(
    at okServiceProvider.getApi(FacebookServiceProvider.j ava:33)
    at okServiceProvider.getApi(FacebookServiceProvider.j ava:26)
    at onnection.initApi(
    at onnection.<init>(
    at onnectionFactory.createConnection(OAuth2Connection
    at ort.completeConnection(
    at nInController.oauth2Callback(ProviderSignInControl
    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 ndlerMethod.invoke( )
    at ndlerMethod.invokeForRequest(InvocableHandlerMetho
    at org.springframework.web.servlet.mvc.method.annotat ion.ServletInvocableHandlerMethod.invokeAndHandle(
    at org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerAdapter.invokeHandlerMeth od(
    at org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerAdapter.handleInternal(Re
    at org.springframework.web.servlet.mvc.method.Abstrac tHandlerMethodAdapter.handle(AbstractHandlerMethod
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(
    at org.springframework.web.servlet.DispatcherServlet. doService(
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    at org.springframework.web.servlet.FrameworkServlet.d oGet(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at ternalDoFilter(
    at Filter(
    at org.apache.catalina.core.StandardWrapperValve.invo ke(
    at org.apache.catalina.core.StandardContextValve.invo ke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke (
    at org.apache.catalina.core.StandardEngineValve.invok e(
    at org.apache.catalina.connector.CoyoteAdapter.servic e(
    at org.apache.coyote.http11.Http11Processor.process(H
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(

    Did anyone encounter this issue? I tried with various versions of Jackson jars but no luck.. Please suggest what options I have..


  • #2
    I know nothing about that particular example...perhaps the author of that example is listening and could chime in.

    But, I'd recommend Jackson version 1.9.9. The Spring Social samples at ( use that version with no issues. I should probably upgrade to depend on Jackson 2, but that's still on the TODO list.


    • #3

      Even am also getting the same error. I tried with jackson 1.9.9 also as as you said above but still am seeing the same error.
      Can you suggest me how to resolve this issue. I tried with all other versions of jackson jars also.

      I have one more question,how to get the access code from the url which is redirected from FB to our controller through OAuth2 params and how Connect Controller will work. Do i need code some for this.

      I downloaded the app from

      Last edited by [email protected]; Apr 17th, 2013, 12:00 AM.


      • #4

        This is the problem am facing...When i run the app
        org.springframework.web.util.NestedServletExceptio n: Handler processing failed; nested exception is java.lang.NoSuchMethodError: le(Lorg/codehaus/jackson/map/ModuleV
        org.springframework.web.servlet.DispatcherServlet. doDispatch(
        org.springframework.web.servlet.DispatcherServlet. doService(
        org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
        org.springframework.web.servlet.FrameworkServlet.d oGet(
        javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
        javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

        root cause

        java.lang.NoSuchMethodError: le(Lorg/codehaus/jackson/map/ModuleV ookTemplate.getJsonMessageConverter(FacebookTempla iBinding.getMessageConverters(AbstractOAuth2ApiBin iBinding.<init>( ookTemplate.<init>( okServiceProvider.getApi(FacebookServiceProvider.j ava:33) okServiceProvider.getApi(FacebookServiceProvider.j ava:26) onnection.initApi( onnection.<init>( onnectionFactory.createConnection(OAuth2Connection
        com.techgene.poc.springsocial.FacebookPostsControl ler.getUserInfo(
        com.techgene.poc.springsocial.FacebookPostsControl ler.showUser(
        sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
        java.lang.reflect.Method.invoke( ndlerMethod.invoke( ) ndlerMethod.invokeForRequest(InvocableHandlerMetho
        org.springframework.web.servlet.mvc.method.annotat ion.ServletInvocableHandlerMethod.invokeAndHandle(
        org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerAdapter.invokeHandlerMeth od(
        org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerAdapter.handleInternal(Re
        org.springframework.web.servlet.mvc.method.Abstrac tHandlerMethodAdapter.handle(AbstractHandlerMethod
        org.springframework.web.servlet.DispatcherServlet. doDispatch(
        org.springframework.web.servlet.DispatcherServlet. doService(
        org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
        org.springframework.web.servlet.FrameworkServlet.d oGet(
        javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
        javax.servlet.http.HttpServlet.service(HttpServlet .java:803)



        • #5
          Well, if you go look at the code for Jackson 1.9.9 or if you do code completion on the ObjectMapper type, you'll see that the method being complained about *does* exist. Moreover, the Spring Social samples (showcase, et al) all use it with no problem.

          Therefore, my instinct tells me that there's something awry with your project's classpath. Either you have an older version of Jackson in the classpath, you have more than one Jackson in your classpath, or there's something else missing. And, narrowing it down further, I suspect that it's a case where you have more than one Jackson in your classpath.

          I've seen this kind of thing before (not with Jackson, necessarily, but with Java libraries in general). Here's how it plays out:

          Let's say you have Jackson 1.9.9 in your classpath, but you *also* have an older version of Jackson in the classpath. Both have ObjectMapper.registerModule(Module) and both have Module. But for whatever reason, Module is being resolved from one version while ObjectMapper is being resolved from another. Those two are incompatible and you get the exception you see.

          Again, this is all just speculation based on what I see here. I can't know for certain because I don't see your code, nor can I do a dependency analysis on it to find evidence to support or deny my theory. If you're building with Maven, use the dependency:tree goal to see what dependencies are resolved. If you build it into a WAR file, crack the WAR file open and see what's in WEB-INF/lib. If there are two Jacksons, then that's your problem.

          If that's not your problem, then I'm at a loss. Unless you can put your code somewhere in GitHub or elsewhere for me to look at, I am not sure what further help I can offer.


          • #6
            hi, Thanks for the update. Am sure that in build path i have only jackson 1.9.9 jar. Please find the attachment of my code.

            Even am getting the same error in Twitter integration also.



            • #7
              Again, this is very much a dependency issue, specifically with Jackson. I thank you for sharing your code with me, but you've only shared Java code and some Eclipse metadata. There's no Maven pom.xml, Gradle build.gradle, or even an Eclipse .classpath file for me to examine for dependency details.

              How are you building this? If you're using the IDE's build facilities, then share your .classpath file. That said, I do *NOT* recommend that build approach and do recommend Maven or Gradle. If you're using one of those, then can I see your pom.xml or build.gradle file?

              Once more, this is likely not an issue with Spring Social. The samples projects work fine and don't have this kind of Jackson dependency issue. The issue is very likely a dependency issue and to be able to help you, I'll need to better understand how you're resolving dependencies in your project.