Announcement Announcement Module
Collapse
No announcement yet.
LinkedIn access token request, 401 Unauthorized Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I believe the problem here is a mixed up set of versions between Spring Social Core and Spring Social LinkedIn. Which versions of each are you using?

    The gist of it is that you're probably using a milestone release of LinkedIn with a 1.0.0 release of Spring Social Core. In that milestone release, LinkedInTemplate directly used ProtectedResourceClientFactory, but that is no longer public in Spring Social 1.0.0. Instead, LinkedInTemplate (and other API bindings for that matter) should extend either AbstractOAuth1ApiBinding or AbstractOAuth2ApiBinding which will work with ProtectedResourceClientFactory without exposing that class directly to the API binding.

    The more recently snapshot builds of Spring Social LinkedIn are updated to match up with the latest in Spring Social Core. Using the 1.0.0.BUILD-SNAPSHOT version of Spring Social LinkedIn will probably clear up this problem. There hasn't been another milestone release of the LinkedIn module to include these changes, because there hasn't been any significant milestone-worthy improvements to that module (however, it may be worthwhile to push a milestone just to avoid these kinds of mismatch problems).

    Comment


    • #17
      If Possible can you please modify the pom with working code.

      changed POM as below:
      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>org.springframework.social</groupId>
      <artifactId>spring-social-quickstart-30x</artifactId>
      <name>Spring Social Quickstart - Spring 3.0.x Compatible</name>
      <packaging>war</packaging>
      <version>1.0.0</version>
      <properties>
      <java-version>1.6</java-version>
      <org.springframework.social-version>1.0.1.BUILD-SNAPSHOT</org.springframework.social-version>
      <org.springframework.social.linkedin-version>1.0.0</org.springframework.social.linkedin-version>
      <org.springframework-version>3.0.6.RELEASE</org.springframework-version>
      <org.springframework.security.crypto-version>3.1.0.RC2.crypto</org.springframework.security.crypto-version>
      </properties>
      <dependencies>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${org.springframework-version}</version>
      </dependency>
      <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>${org.springframework-version}</version>
      </dependency>
      <dependency>
      <groupId>org.springframework.social</groupId>
      <artifactId>spring-social-core</artifactId>
      <version>${org.springframework.social-version}</version>
      </dependency>
      <dependency>
      <groupId>org.springframework.social</groupId>
      <artifactId>spring-social-web</artifactId>
      <version>${org.springframework.social-version}</version>
      </dependency>
      <dependency>
      <groupId>org.springframework.social</groupId>
      <artifactId>spring-social-linkedin</artifactId>
      <version>${org.springframework.social.linkedin-version}</version>
      </dependency>
      <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-crypto</artifactId>
      <version>${org.springframework.security.crypto-version}</version>
      </dependency>
      <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>1.3.159</version>
      </dependency>
      <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
      </dependency>
      <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
      </dependency>
      <dependency>
      <groupId>javax.servlet.jsp.jstl</groupId>
      <artifactId>jstl-api</artifactId>
      <version>1.2</version>
      </dependency>
      <dependency>
      <groupId>org.glassfish.web</groupId>
      <artifactId>jstl-impl</artifactId>
      <version>1.2</version>
      </dependency>
      <!-- CGLIB, only required and used for @Configuration usage: could be removed in future release of Spring -->
      <dependency>
      <groupId>cglib</groupId>
      <artifactId>cglib-nodep</artifactId>
      <version>2.2</version>
      </dependency>
      </dependencies>
      <repositories>
      <repository>
      <id>org.springframework.maven.release</id>
      <name>Spring Maven Release Repository</name>
      <url>http://maven.springframework.org/release</url>
      <releases><enabled>true</enabled></releases>
      <snapshots><enabled>false</enabled></snapshots>
      </repository>
      <!-- For testing against latest Spring snapshots -->
      <repository>
      <id>org.springframework.maven.snapshot</id>
      <name>Spring Maven Snapshot Repository</name>
      <url>http://maven.springframework.org/snapshot</url>
      <releases><enabled>false</enabled></releases>
      <snapshots><enabled>true</enabled></snapshots>
      </repository>
      <!-- For developing against latest Spring milestones -->
      <repository>
      <id>org.springframework.maven.milestone</id>
      <name>Spring Maven Milestone Repository</name>
      <url>http://maven.springframework.org/milestone</url>
      <snapshots><enabled>false</enabled></snapshots>
      </repository>
      </repositories>
      <build>
      <resources>
      <resource>
      <directory>src/main/java</directory>
      </resource>
      </resources>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.3.2</version>
      <configuration>
      <source>${java-version}</source>
      <target>${java-version}</target>
      </configuration>
      </plugin>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <version>2.1.1</version>
      <configuration>
      <warName>spring-social-quickstart-30x</warName>
      </configuration>
      </plugin>
      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>tomcat-maven-plugin</artifactId>
      <version>1.1</version>
      </plugin>
      </plugins>
      </build>
      </project>

      gives error during maven package

      Comment


      • #18
        This is your pom.xml file (our quickstart doesn't have LinkedIn in it), so you'll have to change it. Just change the org.springframework.social.linkedin-version propert from "1.0.0" to "1.0.0.BUILD-SNAPSHOT". (It shouldn't work at all the way you have it now...there isn't a 1.0.0 version.)

        Comment


        • #19
          have already tried 1.0.0.BUILD-SNAPSHOT before the previous post. It can not find LinkedInAPI class

          Comment


          • #20
            The LinkedInAPI interface is now named simply "LinkedIn". You'll have to adjust your SocialConfig accordingly.

            Comment


            • #21
              Thanks for your help. It started working as i just wanted to see basic workflow of spring social to fetch basic details from profile. I appreciate your patience in reading all posts and helping me.

              --Gaurav
              Last edited by gauravj; Oct 20th, 2011, 12:34 AM.

              Comment

              Working...
              X