Announcement Announcement Module
Collapse
No announcement yet.
Building and using Spring Social example (showcase) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Building and using Spring Social example (showcase)

    Hi all,
    I've imported the spring-social-showcase project to Eclipse (from here: https://github.com/SpringSource/spring-social-samples).
    While running a Maven build (mvn clean install), I get the following build errors:

    Downloading: http://maven.springframework.org/mil...b-3.1.0.M2.pom
    Downloading: http://repo1.maven.org/maven2/org/sp...b-3.1.0.M2.pom
    Downloading: http://maven.springframework.org/rel...c-3.1.0.M2.pom
    Downloading: http://maven.springframework.org/mil...c-3.1.0.M2.pom
    Downloading: http://repo1.maven.org/maven2/org/sp...c-3.1.0.M2.pom
    Downloading: http://maven.springframework.org/rel...b-3.1.0.M2.pom
    Downloading: http://maven.springframework.org/mil...b-3.1.0.M2.pom
    Downloading: http://repo1.maven.org/maven2/org/sp...b-3.1.0.M2.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.214s
    [INFO] Finished at: Wed Sep 21 15:38:59 IDT 2011
    [INFO] Final Memory: 3M/15M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project spring-social-showcase: Could not resolve dependencies for project org.springframework.social.samples:spring-social-showcase:war:1.0.0: Failed to collect dependencies for [org.springframework:spring-context:jar:3.1.0.BUILD-SNAPSHOT (compile), org.springframework:spring-webmvc:jar:3.1.0.BUILD-SNAPSHOT (compile), org.springframework:spring-jdbc:jar:3.1.0.BUILD-SNAPSHOT (compile), org.springframework:spring-tx:jar:3.1.0.BUILD-SNAPSHOT (compile), org.springframework.security:spring-security-web:jar:3.1.0.RC3 (compile), org.springframework.security:spring-security-taglibs:jar:3.1.0.RC3 (compile), org.springframework.security:spring-security-config:jar:3.1.0.RC3 (compile), org.springframework.social:spring-social-core:jar:1.0.0.RELEASE (compile), org.springframework.social:spring-social-facebook:jar:1.0.0.RELEASE (compile), org.springframework.social:spring-social-twitter:jar:1.0.0.RELEASE (compile), org.springframework.social:spring-social-web:jar:1.0.0.RELEASE (compile), org.apache.httpcomponents:httpclient:jar:4.1.2 (compile), javax.validation:validation-api:jar:1.0.0.GA (compile), org.hibernate:hibernate-validator:jar:4.1.0.Final (compile), org.slf4j:slf4j-api:jar:1.6.1 (compile), org.slf4j:jcl-over-slf4j:jar:1.6.1 (runtime), org.slf4j:slf4j-log4j12:jar:1.6.1 (runtime), log4j:log4j:jar:1.2.16 (runtime), com.h2database:h2:jar:1.3.159 (compile), cglib:cglib-nodep:jar:2.2 (compile), org.apache.tiles:tiles-jsp:jar:2.2.2 (compile), org.apache.tiles:tiles-el:jar:2.2.2 (compile), javax.inject:javax.inject:jar:1 (compile), javax.servlet:servlet-api:jar:2.5 (provided), javax.servlet.jsp:jsp-api:jar:2.1 (provided), javax.servlet.jsp.jstl:jstl-api:jar:1.2 (compile), org.glassfish.web:jstl-impl:jar:1.2 (compile)]: Failed to read artifact descriptor for org.springframework:spring-context:jar:3.1.0.BUILD-SNAPSHOT: Could not transfer artifact org.springframework:spring-contextom:3.1.0.BUILD-SNAPSHOT from/to org.springframework.maven.snapshot (http://maven.springframework.org/snapshot): ConnectException: UnresolvedAddressException -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/d...utionException
    It seems like it can't find some dependencies such org.springframework.security:spring-security-taglibs:jar:3.1.0.RC3 (compile), org.springframework.security:spring-security-config:jar:3.1.0.RC3 and more.
    What can be the problem here? It can be that these jars are missing in the repository I'm searching in?

    The repositories that defined in the pom.xml are:
    <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>
    Thanks,
    Tomer

  • #2
    It is odd that you can't build and resolve those dependencies. For grins, I just removed my local Maven repo and did a build on the showcase (mvn clean install) and it resolved everything perfectly. Furthermore, I've looked in the repository and can see that those dependencies are there.

    Looking at your error, it appears that all (or almost all) of the dependencies, including those that should be available in the central repo (such as javax.inject). My guess is that your build is failing because of network reasons...it can't see the repos to fetch the dependencies. But that's just a guess and I can't confirm that from here.

    Comment


    • #3
      You were right. It was a problem with my proxy settings... Thanks!

      I have another problem:
      When I run the showcase app, and trying to connecting my Facebook account, I get this response:
      Code:
      {
         "error": {
            "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
            "type": "OAuthException"
         }
      }
      I run it on a local Tomcat. Maybe I need to configure the referrer URL somewhere?
      I manage to connect Twitter though.

      Tomer

      Comment


      • #4
        When you registered your app with Facebook, you had to give it a site URL. This URL must be the base URL of the redirect URI. For example, the Spring Social Showcase is configured in Facebook with "http://localhost:8080/spring-social-showcase/" as its site URL. And, when running it locally, the redirect URI is "http://localhost:8080/spring-social-showcase/connect/facebook", so it matches up and Facebook doesn't complain.

        So, my guess is that you just need to go into your app's settings on Facebook and adjust the site URL.

        Comment


        • #5
          I'm not using my own Facebook app, but the showcase's sample app.
          For some reason I only manage to access the application from: http://localhost:8080/spring-social-...nnect/facebook
          And when I'm trying from: http://localhost:8080/spring-social-...nnect/facebook, I get 404. Do you know why (i'm running it on a Tomcat 7)?

          Thank you.

          Comment


          • #6
            Ah, I'm guessing that you did a "mvn package" (or some such Maven goal that gave you a WAR file) and that WAR file is named spring-social-showcase-1.0.0.war. Then when you deploy it into Tomcat, the app is given a context name based on the WAR file's name, thus "spring-social-showcase-1.0.0".

            I should probably tweak the pom.xml file to produce a war file without the version number in it. In the meantime, you have a couple of options: (1) Run it with "mvn tomcat:run" which will use the Maven Tomcat plugin to run it or (2) rename the war file to spring-social-showcase.war before deploying it. There are other options, too, but those are probably the easiest for now.

            Comment


            • #7
              Got you. Thanks a lot!

              Comment


              • #8
                Tomer, if you'd rather tweak your pom so that it generate a war without the version number add a plugin to your pom:

                Code:
                <plugin>
                	<groupId>org.apache.maven.plugins</groupId>
                	<artifactId>maven-war-plugin</artifactId>
                	<version>2.1.1</version>
                	<configuration>
                		<warName>spring-social-showcase</warName>
                	</configuration>
                </plugin>

                Comment


                • #9
                  That's exactly what I did. Thank you anyway

                  Comment


                  • #10
                    I've also applies the same change to each of the sample apps.

                    Comment


                    • #11
                      hello,

                      it seems that i have the same problem of maven build. i used maven version 3.

                      i try to build the sample : spring-social-quickstart-3.0.x

                      this is the pom.xml :

                      <?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.facebook-version>1.0.0.RELEASE</org.springframework.social.facebook-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-facebook</artifactId>
                      <version>${org.springframework.social.facebook-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>

                      When i lanch a mvn clean install this build failure appear :

                      [INFO] ------------------------------------------------------------------------
                      [INFO] BUILD FAILURE
                      [INFO] ------------------------------------------------------------------------
                      [INFO] Total time: 0.772s
                      [INFO] Finished at: Mon Nov 21 08:56:04 CET 2011
                      [INFO] Final Memory: 2M/5M
                      [INFO] ------------------------------------------------------------------------
                      [ERROR] Failed to execute goal on project spring-social-quickstart-30x: Could not resolve dependencies for project org.s
                      pringframework.social:spring-social-quickstart-30x:war:1.0.0: The following artifacts could not be resolved: org.springf
                      ramework.social:spring-social-core:jar:1.0.1.BUILD-SNAPSHOT, org.springframework.social:spring-social-web:jar:1.0.1.BUIL
                      D-SNAPSHOT, org.springframework.security:spring-security-crypto:jar:3.1.0.RC2.crypto: Could not find artifact org.spring
                      framework.social:spring-social-core:jar:1.0.1.BUILD-SNAPSHOT in proxy-nexus (http://57.200.1.171:9090/nexus/content/grou
                      ps/ecom-all/) -> [Help 1]
                      [ERROR]
                      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
                      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
                      [ERROR]
                      [ERROR] For more information about the errors and possible solutions, please read the following articles:
                      [ERROR] [Help 1] http://cwiki.apache.org/confluence/d...utionException

                      i have check on the server repo, the snapshot jar files are not dowloaded on the server. but, i can find them in my local repo.

                      How can is fixe it ?

                      Comment

                      Working...
                      X