Announcement Announcement Module
Collapse
No announcement yet.
Problems Installing Spring Security from Source. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems Installing Spring Security from Source.

    Hi there,

    I have a problem which I really hope you may be able to help me with.

    I needed the actual source code for spring security so I could put "System.out.println()" in certain areas to debug the code. So I decided to do the below:

    1. Created a Gitorious account to get the source code I was after
    2. Cloned the repository to my local: git clone [email protected]:~markabruce...g-security.git
    3. Updated the version: git checkout 3.0.5.RELEASE (Then add System.outs to the two classes: TokenBasedRememberMeServices.java & AbstractRememberMeServices.java)
    4. Used Gradle to build
    5. Hit an error during build.

    I am getting the error when trying to build with the following command: gradle --stacktrace --debug --info

    The error (pasted below) shows that the package: org.springframework.stereotype does not exist, I think then it falls over because it doesn't recognise any of the annotations. I was thinking of maybe using spring framework 3.0.5.RELEASE? Is this changed in one of the build files? (i.e. build.gradle)
    - I have also noticed places in the pom.xml, but I have changed where things were spring framework 3.0.3.RELEASE to 3.0.5.RELEASE and it seems like it has not taken effect in all places. (It also does not solve the problem)

    ERROR:
    Code:
    12:00:38.559 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] File to be compiled:
        /Users/markabrucey/Desktop/GitSpringSecurity/markabruceys-spring-security/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java
    12:00:38.762 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] /Users/markabrucey/Desktop/GitSpringSecurity/markabruceys-spring-security/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java:7: package org.springframework.stereotype does not exist
    12:00:38.762 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] import org.springframework.stereotype.Controller;
    12:00:38.762 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac]                                      ^
    12:00:38.763 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] /Users/markabrucey/Desktop/GitSpringSecurity/markabruceys-spring-security/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java:8: package org.springframework.web.bind.annotation does not exist
    12:00:38.763 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] import org.springframework.web.bind.annotation.RequestMapping;
    12:00:38.764 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac]                                               ^
    12:00:38.764 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] /Users/markabrucey/Desktop/GitSpringSecurity/markabruceys-spring-security/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java:9: package org.springframework.web.bind.annotation does not exist
    12:00:38.764 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] import org.springframework.web.bind.annotation.RequestMethod;
    12:00:38.765 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac]                                               ^
    12:00:38.765 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] /Users/markabrucey/Desktop/GitSpringSecurity/markabruceys-spring-security/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java:11: cannot find symbol
    12:00:38.765 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] symbol: class Controller
    12:00:38.765 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] @Controller
    12:00:38.766 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac]  ^
    12:00:38.768 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] /Users/markabrucey/Desktop/GitSpringSecurity/markabruceys-spring-security/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java:14: cannot find symbol
    12:00:38.768 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] symbol  : class RequestMapping
    12:00:38.768 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] location: class org.springframework.security.itest.web.TestController
    12:00:38.768 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac]     @RequestMapping(value="/secure/file?with?special?chars.htm", method=RequestMethod.GET)
    12:00:38.769 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac]      ^
    12:00:38.775 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:javac] 5 errors
    12:00:38.776 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':itest-web:compileJava'
    12:00:38.779 [ERROR] [org.gradle.BuildExceptionReporter] 
    12:00:38.780 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
    12:00:38.780 [ERROR] [org.gradle.BuildExceptionReporter] 
    12:00:38.780 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
    12:00:38.781 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':itest-web:compileJava'.
    12:00:38.782 [ERROR] [org.gradle.BuildExceptionReporter] Cause: Compile failed; see the compiler error output for details.
    12:00:38.782 [ERROR] [org.gradle.BuildExceptionReporter] 
    12:00:38.782 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
    12:00:38.783 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':itest-web:compileJava'.
    12:00:38.783 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:71)
    12:00:38.783 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:48)
    12:00:38.783 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
    12:00:38.783 [ERROR] [org.gradle.BuildExceptionReporter] 	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
    ...
    Any help is greatly appreciated!
    I pretty much followed the instructions from this page: http://static.springsource.org/sprin...ite/build.html

    Other thoughts:
    - Is there anything special I may need to do to my ".m2" folder?

    Mark
    Last edited by markabrucey; Dec 20th, 2011, 10:18 AM.

  • #2
    Fixed.

    "spring 3.0.3.RELEASE" in my ".m2" file only had the poms and no jars, this is sorted now

    Thanks for reading.

    Comment


    • #3
      The 3.0.x code is actually still built using Maven, so "mvn install" is the way to go there. We didn't move fully to gradle until 3.1.x.

      Also, I would recommend you use the latest release rather than 3.0.5.

      Comment


      • #4
        Thanks for the reply Luke.

        I am just testing this because in an earlier sprint we used 3.0.5, though in the next we have upgraded to 3.1.0

        Thanks,
        Mark

        Comment


        • #5
          I agree that spring 3.0.3.RELEASE was the problem and responsible for the installation of the Spring security was not success. Review and check out again the codings so you'd know what's the other problem regarding with this.

          Comment

          Working...
          X