Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Spring Social Linkedin Connection: 400 Bad Request

  1. #1
    Join Date
    Oct 2011
    Location
    Dhaka, Bangladesh
    Posts
    13

    Default Spring Social Linkedin Connection: 400 Bad Request

    I have connected to facebook and twitter using spring social (spring-social-showcase demo) and it working as very nice. Now I am trying to integrate linkedin api into it.

    The pom.xml file is shown bellow.

    <properties>
    <org.springframework.social.linkedin-version>1.0.0.BUILD-SNAPSHOT</org.springframework.social.linkedin-version>
    </properties>

    <dependency>
    <groupId>org.springframework.social</groupId>
    <artifactId>spring-social-linkedin</artifactId><version>${org.springframework.social.l inkedin-version}</version>
    </dependency>


    SocialConfig file is shown bellow.

    @Bean
    @Scope(value="singleton", proxyMode=ScopedProxyMode.INTERFACES)
    public ConnectionFactoryLocator connectionFactoryLocator() {
    ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();

    registry.addConnectionFactory(new LinkedInConnectionFactory(environment.getProperty( "linkedin.apikey"),
    environment.getProperty("linkedin.secretkey")));
    return registry;
    }

    @Bean
    @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
    public LinkedIn linkedin() {
    Connection<LinkedIn> linkedin = connectionRepository().findPrimaryConnection(Linke dIn.class);
    return linkedin != null ? linkedin.getApi() : null;
    }


    And application.properties file is shown bellow
    #Linkedin properties
    linkedin.apikey=#########
    linkedin.secretkey=####################

    When I try to connect linkedin using the <form action="<c:url value="/connect/linkedin" />" method="POST"> then it generates the following error

    org.springframework.web.client.HttpClientErrorExce ption: 400 Bad Request
    org.springframework.web.client.DefaultResponseErro rHandler.handleError(DefaultResponseErrorHandler.j ava:75)
    org.springframework.web.client.RestTemplate.handle ResponseError(RestTemplate.java:486)
    org.springframework.web.client.RestTemplate.doExec ute(RestTemplate.java:443)
    org.springframework.web.client.RestTemplate.execut e(RestTemplate.java:415)
    org.springframework.web.client.RestTemplate.exchan ge(RestTemplate.java:391)
    org.springframework.social.oauth1.OAuth1Template.e xchangeForToken(OAuth1Template.java:194)
    org.springframework.social.oauth1.OAuth1Template.f etchRequestToken(OAuth1Template.java:116)
    org.springframework.social.connect.web.ConnectSupp ort.fetchRequestToken(ConnectSupport.java:143)
    org.springframework.social.connect.web.ConnectSupp ort.buildOAuth1Url(ConnectSupport.java:136)
    org.springframework.social.connect.web.ConnectSupp ort.buildOAuthUrl(ConnectSupport.java:95)
    org.springframework.social.connect.web.ConnectCont roller.connect(ConnectController.java:161)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)

    I want to connect linkedin like twitter. Please help.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,072

    Default

    Looking at your pasted code, I see nothing obvious that would cause the problem, but I'm leaning toward it being a case of an incorrect consumer key or secret. It's hard to say for sure.

    But, to help out, I've added LinkedIn functionality to the Spring Social Showcase in a "linkedin" branch at https://github.com/SpringSource/spri.../tree/linkedin. I put it in a separate branch so that the main branch wouldn't depend upon the unreleased LinkedIn module. I ran it through the normal paces of testing the showcase and it worked fine with LinkedIn.

    Have a look. And let us know if you figure out what wasn't working for you...it'd be good to know for future reference.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Oct 2011
    Location
    Dhaka, Bangladesh
    Posts
    13

    Default

    I downloaded the new code you given. I run it, twitter and facebook is okay but linkedin is not working. The error is same. The error is given bellow.

    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.web.client.HttpClientErrorExce ption: 400 Bad Request
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:886)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:790)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.springframework.web.filter.HiddenHttpMethodFil ter.doFilterInternal(HiddenHttpMethodFilter.java:7 7)
    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 312)
    org.springframework.security.web.access.intercept. FilterSecurityInterceptor.invoke(FilterSecurityInt erceptor.java:116)
    org.springframework.security.web.access.intercept. FilterSecurityInterceptor.doFilter(FilterSecurityI nterceptor.java:83)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.access.ExceptionT ranslationFilter.doFilter(ExceptionTranslationFilt er.java:113)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.session.SessionMa nagementFilter.doFilter(SessionManagementFilter.ja va:101)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.authentication.An onymousAuthenticationFilter.doFilter(AnonymousAuth enticationFilter.java:113)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.servletapi.Securi tyContextHolderAwareRequestFilter.doFilter(Securit yContextHolderAwareRequestFilter.java:54)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.savedrequest.Requ estCacheAwareFilter.doFilter(RequestCacheAwareFilt er.java:45)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:182)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.authentication.lo gout.LogoutFilter.doFilter(LogoutFilter.java:105)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:87)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:174)
    org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:346)
    org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:259)
    org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :88)
    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)

    root cause

    org.springframework.web.client.HttpClientErrorExce ption: 400 Bad Request
    org.springframework.web.client.DefaultResponseErro rHandler.handleError(DefaultResponseErrorHandler.j ava:75)
    org.springframework.web.client.RestTemplate.handle ResponseError(RestTemplate.java:486)
    org.springframework.web.client.RestTemplate.doExec ute(RestTemplate.java:443)
    org.springframework.web.client.RestTemplate.execut e(RestTemplate.java:415)
    org.springframework.web.client.RestTemplate.exchan ge(RestTemplate.java:391)
    org.springframework.social.oauth1.OAuth1Template.e xchangeForToken(OAuth1Template.java:194)
    org.springframework.social.oauth1.OAuth1Template.f etchRequestToken(OAuth1Template.java:116)
    org.springframework.social.connect.web.ConnectSupp ort.fetchRequestToken(ConnectSupport.java:143)
    org.springframework.social.connect.web.ConnectSupp ort.buildOAuth1Url(ConnectSupport.java:136)
    org.springframework.social.connect.web.ConnectSupp ort.buildOAuthUrl(ConnectSupport.java:95)
    org.springframework.social.connect.web.ConnectCont roller.connect(ConnectController.java:161)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:597)
    org.springframework.web.method.support.InvocableHa ndlerMethod.invoke(InvocableHandlerMethod.java:212 )
    org.springframework.web.method.support.InvocableHa ndlerMethod.invokeForRequest(InvocableHandlerMetho d.java:126)
    org.springframework.web.servlet.mvc.method.annotat ion.ServletInvocableHandlerMethod.invokeAndHandle( ServletInvocableHandlerMethod.java:96)
    org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerAdapter.invokeHandlerMeth od(RequestMappingHandlerAdapter.java:629)
    org.springframework.web.servlet.mvc.method.annotat ion.RequestMappingHandlerAdapter.handleInternal(Re questMappingHandlerAdapter.java:590)
    org.springframework.web.servlet.mvc.method.Abstrac tHandlerMethodAdapter.handle(AbstractHandlerMethod Adapter.java:80)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:900)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:827)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:874)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:790)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.springframework.web.filter.HiddenHttpMethodFil ter.doFilterInternal(HiddenHttpMethodFilter.java:7 7)
    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 312)
    org.springframework.security.web.access.intercept. FilterSecurityInterceptor.invoke(FilterSecurityInt erceptor.java:116)
    org.springframework.security.web.access.intercept. FilterSecurityInterceptor.doFilter(FilterSecurityI nterceptor.java:83)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.access.ExceptionT ranslationFilter.doFilter(ExceptionTranslationFilt er.java:113)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.session.SessionMa nagementFilter.doFilter(SessionManagementFilter.ja va:101)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.authentication.An onymousAuthenticationFilter.doFilter(AnonymousAuth enticationFilter.java:113)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.servletapi.Securi tyContextHolderAwareRequestFilter.doFilter(Securit yContextHolderAwareRequestFilter.java:54)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.savedrequest.Requ estCacheAwareFilter.doFilter(RequestCacheAwareFilt er.java:45)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.authentication.Ab stractAuthenticationProcessingFilter.doFilter(Abst ractAuthenticationProcessingFilter.java:182)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.authentication.lo gout.LogoutFilter.doFilter(LogoutFilter.java:105)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:87)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 324)
    org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:174)
    org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:346)
    org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:259)
    org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :88)
    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)

    I am waiting for your response.
    Thanks
    Rafiq

  4. #4
    Join Date
    Aug 2004
    Posts
    1,072

    Default

    Honestly, I'm stumped. Assuming you are running the LinkedIn-enabled showcase unchanged after pulling it from GitHub, it *should* just work. It works for me and I've had a few others try it and they've had no trouble connecting to LinkedIn, either. Given that, it seems that the problem isn't in the code, but is probably something environmental on your end. I don't know for sure what it might be.

    Just trying to narrow it down, could you try running the following code (in a main method or JUnit test):

    Code:
    String consumerKey = "8U1nfplbpkkBTIKDcuonVY_gZ_9Pl0UOhbXr6qNIL1ByPz4ZietgM92sR-mMzpTM";
    String consumerSecret = "zFIPCSMPVy9Bg5P1NFhxlTXniXX9pPDBPru2WGZqegYUQHHPTMpAr26vBPbb6iQ6";		
    LinkedInConnectionFactory licf = new LinkedInConnectionFactory(consumerKey, consumerSecret);
    OAuth1Operations oauth = licf.getOAuthOperations();
    OAuthToken requestToken = oauth.fetchRequestToken("http://localhost:8080/spring-social-showcase/connect/linkedin", null);		
    System.out.println(requestToken.getValue() + "  ::  " + requestToken.getSecret());
    I'm not interested in what values are printed, but am interested in whether you get an exception or if you get a request token/secret.
    Last edited by habuma; Nov 28th, 2011 at 09:09 AM.
    Craig Walls
    Spring Social Project Lead

  5. #5
    Join Date
    Oct 2011
    Location
    Dhaka, Bangladesh
    Posts
    13

    Default

    I have got the same error messages in browser. I have also tested this in another pc (sts 2.8.0) but the result is same. I could not get request token/secret.

    Please help me.
    Rafiq
    Last edited by rafiq; Nov 27th, 2011 at 10:23 PM.

  6. #6
    Join Date
    Aug 2004
    Posts
    1,072

    Default

    Rafiq: Are you saying that when running the code snippet that I gave you in a main method or test method you get the same exception and stack trace as you did in the browser? Again, I'm stumped...because that very same chunk of code gives me a request token and secret.

    At this point I'm wondering if it's a matter of dependencies not lining up. Of course, if you've pulled the LinkedIn-enabled Spring Social Showcase that I gave you, then you *should* be running with the same set of dependencies as I am. That is, unless your local Maven repo is holding on to some bad dependencies (shouldn't happen, but I've seen it happen plenty of times). Perhaps you could try moving/renaming your local Maven repo and building/running the LinkedIn-enabled showcase again? No guarantees, but it's worth a shot.
    Craig Walls
    Spring Social Project Lead

  7. #7
    Join Date
    Jul 2010
    Location
    Dublin, Ireland
    Posts
    17

    Default

    I'd various problems with dependencies being out of date while developing new API's for spring-social-linkedin. Mostly due to conflicts against milestone releases of spring-webmvc where code has changed significantly.

    I finally got everything moved to 3.1.0.RC1 and it worked fine.

    If you're feeling brave you could try my dev version at https://github.com/robdrysdale/spring-social-linkedin
    You'll need to check it out and build it yourself.
    Builds and installs to mvn repo as 1.0.1.BUILD-SNAPSHOT using './gradlew install'

    Also if you can with specific requests wrap code in (obviously you need to get connected first):
    You could use habuma's code above and wrap it though.
    LinkedIn returns error info in body of request which this will print out.

    Code:
    try {
    			List<LinkedInProfile> profiles = linkedIn.connectionOperations().getConnections();
    			System.out.println(profiles.size());
    		}
    		catch(HttpClientErrorException e) {
    			System.out.println("JSON Error: " + e.getStatusCode() + " - " + e.getStatusText());
    			System.out.println(e.getResponseBodyAsString());
    			throw e;
    		}
    		catch(HttpServerErrorException e) {
    			System.out.println("JSON Error: " + e.getStatusCode() + " - " + e.getStatusText());
    			System.out.println(e.getResponseBodyAsString());
    			throw e;
    		}

  8. #8
    Join Date
    Oct 2011
    Location
    Dhaka, Bangladesh
    Posts
    13

    Default

    Thanks habuma to supporting me for long time. Now I can connect to linkedin from my pc. I don’t know the exact problem but when I run the same code from another pc, it is working.

    Thanks again,
    Rafiq

  9. #9
    Join Date
    Dec 2011
    Location
    Belgrade, Serbia
    Posts
    2

    Default

    Hi to all,

    I'm getting the same 400 Bad Request Error when I'm trying to call the search method on profiles.
    Here's the code I'm using:

    Code:
     
    LinkedInTemplate template = createLinkedInTemplate(request);
    List<LinkedInProfile> connections = template.connectionOperations().getConnections();
    for (LinkedInProfile linkedInProfile : connections) {
    	System.out.println(linkedInProfile.getSummary());
    }
            
    List<Company> companies = template.companyOperations().getFollowing();
    for (Company company : companies) {
    	System.out.println(company.getDescription());
    }
       
    SearchParameters searchParams = new SearchParameters();
    searchParams.setKeywords("java");
    searchParams.setPostalCode("75001");
    searchParams.setSort(Sort.RECOMMENDORS);
            
    SearchResultPeople searchRes =  template.profileOperations().search(searchParams);
    List<LinkedInProfile> searchPeople = searchRes.getPeople();
    for (LinkedInProfile linkedInProfile : searchPeople) {
    System.out.println("::Proposition " + linkedInProfile.getFirstName() + " " +  linkedInProfile.getLastName() + " -> " + linkedInProfile.getSummary());
    }
    The first two api calls, getting the connections of a logged in user and companies that the user follows work like a charm but the search isn't.

    I'm getting the following error:
    Code:
    [INFO] WARN : org.springframework.web.client.RestTemplate - GET request for "https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,headline,industry,site-standard-profile-request,public-profile-url,picture-url,summary,api-standard-profile-request))?&keywords=java&&postal-code=75001&start=0&count=10&sort=recommendors" resulted in 400 (Bad Request); invoking error handler
    [INFO] ERROR: rs.co.neotech.server.SemsegServer - Exception caught by aspect: 400 Bad Request
    [ERROR] org.springframework.web.client.HttpClientErrorException: 400 Bad Request
    [ERROR] 	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:76)
    [ERROR] 	at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:486)
    [ERROR] 	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:443)
    [ERROR] 	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415)
    [ERROR] 	at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213)
    [ERROR] 	at org.springframework.social.linkedin.api.impl.ProfileTemplate.search(ProfileTemplate.java:87)
    [ERROR] 	at rs.co.neotech.server.SemsegServiceImpl.linkedInLogin_aroundBody26(SemsegServiceImpl.java:200)
    [ERROR] 	at rs.co.neotech.server.SemsegServiceImpl$AjcClosure27.run(SemsegServiceImpl.java:1)
    [ERROR] 	at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
    [ERROR] 	at rs.co.neotech.server.aspectj.SemsegAspects.doRpcCall(SemsegAspects.java:103)
    [ERROR] 	at rs.co.neotech.server.SemsegServiceImpl.linkedInLogin(SemsegServiceImpl.java:180)
    [ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [ERROR] 	at java.lang.reflect.Method.invoke(Method.java:597)
    [ERROR] 	at org.gwtwidgets.server.spring.GWTRPCServiceExporter.invokeMethodOnService(GWTRPCServiceExporter.java:169)
    [ERROR] 	at org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:338)
    [ERROR] 	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    [ERROR] 	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    [ERROR] 	at org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest(GWTRPCServiceExporter.java:407)
    [ERROR] 	at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
    [ERROR] 	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    [ERROR] 	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    [ERROR] 	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    [ERROR] 	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
    [ERROR] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    [ERROR] 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    [ERROR] 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    [ERROR] 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    [ERROR] 	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    [ERROR] 	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    [ERROR] 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    [ERROR] 	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    [ERROR] 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    [ERROR] 	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    [ERROR] 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    [ERROR] 	at org.mortbay.jetty.Server.handle(Server.java:324)
    [ERROR] 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    [ERROR] 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    [ERROR] 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    [ERROR] 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    [ERROR] 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    [ERROR] 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    [ERROR] 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
    As I can see your HTTP builder is behaving strange as it adds & before the keywords in the uri and also after the keywords it adds one extra &.

    Is it me who doesn't know how to create the SearchParameters object or is there something else? I haven't found any documentation on how the query should be built.

    Thanks in advance!

  10. #10
    Join Date
    Jul 2010
    Location
    Dublin, Ireland
    Posts
    17

    Default

    Although the & is technically not correct here it works fine.

    The problem can be diagnosed by surrounding your call to .profileOperations().search(searchParams) with a try catch as per my last post.

    This will yield the following detailed error from linkedin

    JSON Error: 400 - Bad Request
    {
    "errorCode": 0,
    "message": "Value {recommendors} is not valid for parameter {sort<String>}",
    "requestId": "A9UW04M8OZ",
    "status": 400,
    "timestamp": 1325067377262
    }

    recommenders is not supported for this type of search. Change to say DISTANCE and it works fine.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •