Results 1 to 6 of 6

Thread: Unable to build Spring MVC project in Spring STS 3.1.0

  1. #1
    Join Date
    Jan 2013
    Posts
    5

    Exclamation Unable to build Spring MVC project in Spring STS 3.1.0

    Hi,

    I am a newbie to spring and Maven and i am facing the following problems in the Spring MVC project that i created using 'Spring Template Project' in STS:

    1. The default HomeController java class cannot resolve the following import
      • import org.springframework.stereotype.Controller
      • import org.springframework.ui.Model
      • import org.springframework.web.bind.annotation.RequestMap ping
    2. The servlet-context.xml cannot resolve the class org.springframework.web.servlet.view.InternalResou rceViewResolver
    3. While starting the vFabric tc server it throws the error 'Failed to scan JAR [some path/vfabric-tc-server-developer-2.7.2.RELEASE/base-instance/wtpwebapps/TestSpringMVC/WEB-INF/lib/spring-webmvc-3.1.1.RELEASE.jar] from WEB-INF/lib


    I have registered maven bin in the PATH variable and executing the command mvn --version gives the proper output. Any help is highly appreciated.

    Regards,
    Royz

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey Royz,

    sorry for the late reply, holiday season... And Happy New Year!!! :-)

    The problem you are describing sounds a lot like the Maven support in STS is not working as it should be. Are you using the full STS distribution download or did you install the tooling from the Marketplace into an existing Eclipse installation?

    In the latter case, you should also install the Maven Integration for Eclipse as well as the Maven Integration for Eclipse WTP into your Eclipse. Many of the Spring template projects are using Maven.

    In case you are using the standard STS distribution download, this must be something different. Do you see a "Maven Dependencies" item in the project explorer? And if so, what does it list when you expand that node?

    HTH,
    Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3
    Join Date
    Jan 2013
    Posts
    5

    Default

    Hi Martin,

    Wish you a very Happy New Year!!

    Actually i have installed STS and the Maven dependencies structure is present in the project folder structure. The Maven dependencies folder looks like the following:
    MavenDependency.JPG

    Also the errors are resolved if i manually download the required jars and place them in the directory as mentioned in the 'Maven Dependencies' folder.

    Waiting for your suggestion....

    Regards,
    Royz

  4. #4
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey Royz!

    I would suggest to close STS, wipe out the local Maven repository under ~/.m2/repository and then restart STS/Eclipse download. This should trigger STS/Eclipse/Maven to download fresh copies of those dependencies. It looks like your local Maven repository got corrupted somehow.

    You can also try to activate "Update project..." from the Maven context menu after you restarted STS/Eclipse, if the download doesn't happen automatically.

    HTH,
    Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  5. #5
    Join Date
    Jan 2013
    Posts
    5

    Default

    Hi Martin,

    Thanks for the suggestion. It worked..

    Regards,
    Royz

  6. #6
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey Royz,

    great to hear that. And thanks for letting us know!!!

    Cheers,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

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
  •