Announcement Announcement Module
Collapse
No announcement yet.
Unable to build Spring MVC project in Spring STS 3.1.0 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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:
      Attachment

      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
      Attached Files

      Comment


      • #4
        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

        Comment


        • #5
          Hi Martin,

          Thanks for the suggestion. It worked..

          Regards,
          Royz

          Comment


          • #6
            Hey Royz,

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

            Cheers,
            -Martin

            Comment

            Working...
            X