Announcement Announcement Module
Collapse
No announcement yet.
Not able to build first surf project Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not able to build first surf project

    I was trying to go through the Spring-Surf tutorial, but I got hung up when I got to:
    1.3. First Steps: Your Own Spring Surf App in Under 5 Minutes

    Everything worked until I got to the point where I run:

    mvn tomcat:deploy

    It writes out many lines, and finally ends with this:

    [many lines ........]
    [INFO] Unable to find resource 'org.springframework.extensions.surf:spring-surf-
    api:jar:1.0.0.M2' in repository com.springsource.repository.bundles.external (ht
    tp://repository.springsource.com/maven/bundles/external)
    Downloading: http://repository.springsource.com/m...stone/org/spri
    ngframework/extensions/surf/spring-surf-api/1.0.0.M2/spring-surf-api-1.0.0.M2.ja
    r
    [INFO] Unable to find resource 'org.springframework.extensions.surf:spring-surf-
    api:jar:1.0.0.M2' in repository com.springsource.repository.bundles.milestone (h
    ttp://repository.springsource.com/maven/bundles/milestone)
    Downloading: http://repository.springsource.com/m...shot/org/sprin
    gframework/extensions/surf/spring-surf-api/1.0.0.M2/spring-surf-api-1.0.0.M2.jar

    [INFO] Unable to find resource 'org.springframework.extensions.surf:spring-surf-
    api:jar:1.0.0.M2' in repository com.springsource.repository.bundles.snapshot (ht
    tp://repository.springsource.com/maven/bundles/snapshot)
    Downloading: http://repo1.maven.org/maven2/org/sp...ensions/surf/s
    pring-surf-api/1.0.0.M2/spring-surf-api-1.0.0.M2.jar
    [INFO] Unable to find resource 'org.springframework.extensions.surf:spring-surf-
    api:jar:1.0.0.M2' in repository central (http://repo1.maven.org/maven2)
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] Failed to resolve artifact.

    Missing:
    ----------
    1) org.springframework.extensions.surf:spring-surf:jar:1.0.0.M2

    Try downloading the file manually from the project website.

    Then, install it using the command:
    mvn install:install-file -DgroupId=org.springframework.extensions.surf -Da
    rtifactId=spring-surf -Dversion=1.0.0.M2 -Dpackaging=jar -Dfile=/path/to/file

    Alternatively, if you host your own repository you can deploy the file there:

    mvn deploy:deploy-file -DgroupId=org.springframework.extensions.surf -Dart
    ifactId=spring-surf -Dversion=1.0.0.M2 -Dpackaging=jar -Dfile=/path/to/file -Dur
    l=[url] -DrepositoryId=[id]

    Path to dependency:
    1) org.app.surf:surf:war:0.1.0-SNAPSHOT
    2) org.springframework.extensions.surf:spring-surf:jar:1.0.0.M2

    2) org.springframework.extensions.surf:spring-surf-api:jar:1.0.0.M2

    Try downloading the file manually from the project website.

    Then, install it using the command:
    mvn install:install-file -DgroupId=org.springframework.extensions.surf -Da
    rtifactId=spring-surf-api -Dversion=1.0.0.M2 -Dpackaging=jar -Dfile=/path/to/fil
    e

    Alternatively, if you host your own repository you can deploy the file there:

    mvn deploy:deploy-file -DgroupId=org.springframework.extensions.surf -Dart
    ifactId=spring-surf-api -Dversion=1.0.0.M2 -Dpackaging=jar -Dfile=/path/to/file
    -Durl=[url] -DrepositoryId=[id]

    Path to dependency:
    1) org.app.surf:surf:war:0.1.0-SNAPSHOT
    2) org.springframework.extensions.surf:spring-surf-api:jar:1.0.0.M2

    ----------
    2 required artifacts are missing.

    for artifact:
    org.app.surf:surf:war:0.1.0-SNAPSHOT

    from the specified remote repositories:
    com.springsource.repository.bundles.release (http://repository.springsource.co
    m/maven/bundles/release),
    com.springsource.repository.bundles.external (http://repository.springsource.c
    om/maven/bundles/external),
    central (http://repo1.maven.org/maven2),
    com.springsource.repository.bundles.milestone (http://repository.springsource.
    com/maven/bundles/milestone),
    com.springsource.repository.bundles.snapshot (http://repository.springsource.c
    om/maven/bundles/snapshot)



    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 7 seconds
    [INFO] Finished at: Fri Jan 08 20:54:37 PST 2010
    [INFO] Final Memory: 10M/17M
    [INFO] ------------------------------------------------------------------------
    C:\temp\surf-app>

  • #2
    Hi,

    It seems to have an issue with the roo addon zip file we put on springsurf.org. We just posted an update one which should fix this issue.

    Can you try to re-download the zip from springsurf.org and resintall Surf addon?

    1) Download http://www.springsurf.org/downloads/...-roo-addon.zip

    2) Startup Roo and remove existing surf addon

    >> addon uninstall *surf*.zip

    3) Reinstall surf addon using the zip file you just download

    >> addon install file:/[Path-to-your-zip-file]

    Please let us know how it goes.

    Thanks!

    Yong

    Comment


    • #3
      I've updated the addon as you suggested.
      But I still have a problem. The maven deploy gets into an endless download retry process and never seems to download the required files.
      It eventually reports "Connection timed out".

      The message also reports 'Authorization Failure'.
      Did I miss something somewhere where I need to set up credentials to allow the download?

      I also researched and found that somewhat similar errors can be seen when a proxy server is not configured properly in the Maven settings.xml file, but I'm not running with a proxy server.

      Thanks for any assistance with this.

      ---------------------------------


      Downloading: http://private.repository.springsour...les/external/o
      rg/springframework/spring-beans/3.0.0.RELEASE/spring-beans-3.0.0.RELEASE.jar
      [WARNING] Unable to get resource 'org.springframework:spring-beans:jar:3.0.0.REL
      EASE' from repository com.springsource.private.repository.bundles.releas e (http://private.repository.springsour...les/external): Authorization failed: Access denied to: http://private.repository.springsour...maven/bundles/
      external/org/springframework/spring-beans/3.0.0.RELEASE/spring-beans-3.0.0.RELEASE.jar
      Downloading: http://maven.springframework.org/mil...framework/spri
      ng-beans/3.0.0.RELEASE/spring-beans-3.0.0.RELEASE.jar
      [INFO] Unable to find resource 'org.springframework:spring-beans:jar:3.0.0.RELEASE' in repository maven.springframework.org.milestone (http://maven.springframework.org/milestone)
      Downloading: http://maven.springframework.org/sna...ramework/sprin
      g-beans/3.0.0.RELEASE/spring-beans-3.0.0.RELEASE.jar

      Downloading: http://repository.springsource.com/m...ase/org/apache
      /abdera/abdera-extensions-json/0.4.0-incubating/abdera-extensions-json-0.4.0-inc
      ubating.jar
      [INFO] Unable to find resource 'org.springframework:spring-beans:jar:3.0.0.RELEA
      SE' in repository maven.springframework.org.snapshot (http://maven.springframewo
      rk.org/snapshot)
      Downloading: http://people.apache.org/repo/m2-inc...y//org/springf
      ramework/spring-beans/3.0.0.RELEASE/spring-beans-3.0.0.RELEASE.jar
      Downloading: http://repository.springsource.com/m...ase/org/apache
      /ws/commons/axiom/axiom-api/1.2.5/axiom-api-1.2.5.jar
      [INFO] Unable to find resource 'org.apache.abdera:abdera-extensions-json:jar:0.4
      .0-incubating' in repository com.springsource.repository.bundles.release (http:/
      /repository.springsource.com/maven/bundles/release)
      Downloading: http://repository.springsource.com/m...rnal/org/apach
      e/abdera/abdera-extensions-json/0.4.0-incubating/abdera-extensions-json-0.4.0-in
      cubating.jar
      [INFO] Unable to find resource 'org.springframework:spring-beans:jar:3.0.0.RELEA
      SE' in repository apache-incubating (http://people.apache.org/repo/m2-incubating
      -repository/)
      Downloading: http://repo1.maven.org/maven2/org/sp...ring-beans/3.0.
      0.RELEASE/spring-beans-3.0.0.RELEASE.jar
      [INFO] Unable to find resource 'org.apache.ws.commons.axiom:axiom-api:jar:1.2.5'
      in repository com.springsource.repository.bundles.release (http://repository.sp
      ringsource.com/maven/bundles/release)

      Comment


      • #4
        Hi,

        In your roo project pom.xml, do you have

        ...

        <repositories>
        <repository>
        <id>com.springsource.repository.bundles.release</id>
        <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
        <url>http://repository.springsource.com/maven/bundles/release</url>
        </repository>
        <repository>
        <id>com.springsource.repository.bundles.external </id>
        <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
        <url>http://repository.springsource.com/maven/bundles/external</url>
        </repository>
        <repository>
        <id>com.springsource.repository.bundles.mileston e</id>
        <name>SpringSource Enterprise Bundle Repository - External Bundle Milestones</name>
        <url>http://repository.springsource.com/maven/bundles/milestone</url>
        </repository>
        <!-- required for some plugins that depend on snapshots -->
        <repository>
        <id>com.springsource.repository.bundles.snapshot </id>
        <name>SpringSource Enterprise Bundle Repository - External Bundle Snapshots</name>
        <url>http://repository.springsource.com/maven/bundles/snapshot</url>
        </repository>
        <repository>
        <id>spring-extensions-milestone</id>
        <name>Spring Extensions Milestone Repository</name>
        <url>http://extensions.springframework.org/milestone</url>
        </repository>
        <repository>
        <id>spring-extensions-snapshot</id>
        <name>Spring Extensions Snapshot Repository</name>
        <url>http://extensions.springframework.org/snapshot</url>
        </repository>
        </repositories>
        ...

        If that is the case, you can see we are using public spring maven repo to pull down spring jars. From your error message, I can see it is trying to get things from

        http://private.repository.springsour...ndles/external

        No sure how we get that. Maybe your want to check setting.xml of your maven installation?

        All Surf repo don't require credentials. And for my maven install, I have not setup any proxy.

        Yong

        Comment


        • #5
          This may help as well

          http://forum.springsource.org/showthread.php?t=81359

          I think you may want to try Roo 1.0.0.release instead of RC4.

          Or if you want to use Roo RC4, change the following dependency in pom.xml

          <!-- ROO dependencies -->
          <dependency>
          <groupId>org.springframework.roo</groupId>
          <artifactId>org.springframework.roo.annotations</artifactId>
          <version>1.0.0.RC4</version>
          <scope>provided</scope>
          </dependency>

          to

          <!-- ROO dependencies -->
          <dependency>
          <groupId>org.springframework.roo</groupId>
          <artifactId>org.springframework.roo.annotations</artifactId>
          <version>1.0.0.RELEASE</version>
          <scope>provided</scope>
          </dependency>

          By the way, that dependency was generated by Roo new project command (in other words, it is actually a spring Roo issue :-) )
          Yong

          Comment


          • #6
            My .pom file contents looked identical to what you have.

            I changed 1.0.0.RC4 to 1.0.0.RELEASE in the .pom file,
            but I still see very similar if not the same results when I run maven.

            I also tried
            mvn clean tomcat:deploy

            The settings.xml file for maven has basically nothing in it. The timestamp on it shows that I have not changed it. And the default settings file has everything commented out in it.

            Comment


            • #7
              Hi,

              Which version of Roo are you using? I would suggest to use 1.0.0.RELEASE.

              Another thing you can try is

              1) Create a new folder.

              2) Run roo

              3) project --topLevelPackage xxx.yyy

              4) Exit roo and run mvnackage

              If you still get same error, then it will definitely a spring roo issue.

              Yong

              Comment


              • #8
                You can also run maven commands without exiting roo:

                Roo also has a command for maven package. Just run

                Code:
                perform package
                from within roo. You can also call out any undefined perform maven commands by calling:

                Code:
                perform command --mavenCommand <single command>
                If all things fail with maven, you can download the required jar and do a local maven install. I will see if I can try to reproduce this issue, but currently I have not run into any issues.

                I am however running with a manually installed version of spring roo 1.0.0.RELEASE and I have checked out the entire spring-surf source tree and have run a mvn install on my source to get it into my local maven repository.

                You may want to venture down that route. if you download the source, run mvn install and you'll have all necessary jars installed into your local maven repository. Also, you'll also have access to the petclinic and spring-travel sample projects which I do not believe are bundled into the current distribution releases.

                Comment


                • #9
                  I ran the test against the spring 'bare bones' roo_test package.
                  I ran into the same problems.

                  Then I downloaded the 1.0.0.RELEASE version of roo and tried that.
                  The roo_test package was then able to build.

                  Then I tried it against the directory used for the 5-minute spring surf tutorial.
                  The previous problem is gone and it finished build and the deployment to tomcat.

                  But at the tomcat console, I saw one error:

                  INFO: validateJarFile(C:\dev\apache-tomcat-6.0.20\webapps\surf\WEB-INF\lib\servl
                  et-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
                  Jan 11, 2010 9:44:06 AM org.apache.catalina.session.StandardManager doLoad
                  SEVERE: ClassNotFoundException while loading persisted sessions: java.lang.Class
                  NotFoundException: org.alfresco.connector.ConnectorSession
                  java.lang.ClassNotFoundException: org.alfresco.connector.ConnectorSession

                  Should I be concerned about that?

                  A 3.3 version war of Alfresco repository is installed on the tomcat that I am deploying to.

                  I'm able to view the new surf application on http://localhost:8080/surf !

                  I haven't finished the tutorial, but this step seems now to be very close to successful.

                  Comment


                  • #10
                    Cool.

                    You shouldn't worry about that error message.

                    Thanks!

                    Yong

                    Comment

                    Working...
                    X