0

I'm stuck with a standalone java application I'm maintaining, I'm really new with Maven. I use the copy dependencies, package plugins in command line and everything it's ok, but then when I see the project in eclipse, it validates the project and it seems that there is a problem checking which .xsd version should take into account.

Description Resource Path Location Type src-resolve: Cannot resolve the name 'beans:identifiedType' to a(n) 'type definition' component. spring-jee-2.0.xsd
Description Resource Path Location Type src-resolve: Cannot resolve the name 'beans:identifiedType' to a(n) 'type definition' component. spring-jee-2.5.xsd

I'm using spring 2.5.6 and I cannot upgrade. I do not know if I have to set up something in my eclipse IDE.

My configuration file is like this:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">

Any ideas or suggestions? Is it something related with a problem in the project or with eclipse IDE?

Thanks in advance

Dmitry
  • 2,943
  • 1
  • 23
  • 26
alicia
  • 597
  • 1
  • 5
  • 17
  • I am thinking that probably I can miss this errors because I can make the .jar of the project with mvn package without errors, is this right or I am assuming it wrong? – alicia May 23 '13 at 06:05
  • This is a possible duplicate of http://stackoverflow.com/questions/9889402/how-to-solve-this-error-src-resolve-cannot-resolve-the-name-j2eedescription/39913861#39913861 – cgull Oct 07 '16 at 11:03

1 Answers1

0

I cannot reproduce your situation, but it seems to be related to this problem:

That's a feature of STS (trying to be clever and importing XSD from project classpath it fails to find the spring core ones). Raise a JIRA ticket there if you want to really solve the problem, but my understanding is that it is a compromise - users who do not edit custom XSDs are far more numerous than those that do, so it's better to support the larger group.

You can work around it by adding the spring-beans-3.1.xsd to your XML Catalog in Eclipse (look in Preferences). You probably only need to specify a namespace id, but I always add the schema location to be on the safe side. You probably need to extract the XSD from the spring jar file because I don't think you can add a catalog entry from a jar.

So, try to add spring-beans-2.5.xsd to XML Catalog in Eclipse. Hope this helps.

Dmitry
  • 2,943
  • 1
  • 23
  • 26
  • Finally it works but it is a good idea to set the xml catalog to some .xsd manually? What happen if you have several projects and you want to upgrade spring in only one of them, how can you do that? – alicia May 24 '13 at 06:33