0

I have downloaded and installed Spring Tool Suite 3.4. I am trying to create a Spring MVC project. I am able to create the project but the project already has errors and I have not modified or added any code. Is anyone else having this issue or have a work around?

I have tried running

Maven -> Update Project
Run As -> Maven Clean
Run As -> Maven Install

Many of the tutorials I am looking at are using Spring Tool Suite so I would like to use STS for consistency purposes but this is kind of a show stopper.

Here are the errors I am seeing

Archive for required library: 'C:/Users/Joseph/.m2/repository/org/springframework/spring-context/3.1.1.RELEASE/spring-context-3.1.1.RELEASE.jar' in project 'Example1' cannot be read or is not a valid ZIP file

Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment.

The project cannot be built until build path errors are resolved

Error occured processing XML 'Unable to load schema mappings from location [META-INF/spring.schemas]'. See Error Log for more details root-context.xml

Error occured processing XML 'Unable to load schema mappings from location [META-INF/spring.schemas]'. See Error Log for more details servlet-context.xml

greyfox
  • 6,426
  • 23
  • 68
  • 114
  • Can you be more specific? What type of errors are you getting etc. – Mustafa Oct 31 '13 at 23:48
  • Archive for required library: 'C:/Users/Joseph/.m2/repository/org/springframework/spring-context/3.1.1.RELEASE/spring-context-3.1.1.RELEASE.jar' in project 'Example1' cannot be read or is not a valid ZIP file Example1 Build path Build Path Problem Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment. Error occured processing XML 'Unable to load schema mappings from location [META-INF/spring.schemas]'. See Error Log for more details root-context.xml – greyfox Oct 31 '13 at 23:52

2 Answers2

0

From your comment, it seems like the problem is caused by the JVM installed on your machine. It might be an older version than the Spring Tool Suite requires. Or if you only have JRE installed but not the JDK it can also cause problems.

You can download the latest JDK from oracle at http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

After the installation, simply point STS to the new version at

Preferences -> Java -> Installed JREs -> Add
Mustafa
  • 2,447
  • 23
  • 31
  • I had JDK7u25 installed but I went ahead and installed the lastest as well, JDK7u45. It didn't seem to make a difference. I do have Eclipse and STS installed, any possibility they are conflicting with each other? I should note I have the same issue in Eclipse. – greyfox Nov 01 '13 at 00:18
  • Can you check the version STS is using from the instructions above? You can also check the project build path if the project is trying to use something different than the default workspace version. – Mustafa Nov 01 '13 at 00:24
  • Deleting the .m2 directory from my home folder and then having Maven re-install all the dependencies seemed to do the trick. I have Eclipse and STS installed. Is it possible they don't place nice together? I'm guessing they were both using that directory. – greyfox Nov 01 '13 at 00:28
0

Not sure what happened but I just deleted .m2 directory in my Home folder, Maven Clean, and Maven install and now I'm able to run the project on a server.

Could this be caused because Eclipse and STS were sharing that directory?

greyfox
  • 6,426
  • 23
  • 68
  • 114