Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
523 views
in Technique[技术] by (71.8m points)

xsd - Eclipse gradle project's spring xml validation

I have a gradle project in my Eclipse with a number of spring-integration context XMLs. These context XML files used to validate okay against the spring-integration schemas but now, for some reason, they are showing 'cvc-complex-type' errors. e.g. I have an element with an error-channel attribute. But on validation, it has started saying: "cvc-complex-type.3.2.2: Attribute 'error-channel' is not allowed to appear in element 'int:gateway'."

Now, looking in my Eclipse preferences' General -> Network Connections -> Cache, I can see that only spring-integration-1.0.xsd is in the cache (which wouldn't know anything about an error-channel attribute in gateway element), so I can see why the validation error appears. But, my project's classpath is working with spring-integration-core-2.2.0 so I would expect the spring context XMLs to validate against spring-integration-2.2.xsd schema, but it no longer does, for some unknown reason.

My spring context XMLs, have the following namespace declaration:

http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd.

Any ideas why the validation is not happening against spring-integration-2.2.xsd schemas any more? And what may have caused it?

The project itself, still compiles and runs okay as the project itself is aware of the 2.2 xsd schema, but not Eclipse.

Thanks for any help on this matter,

PM.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here is an answer: http://forum.spring.io/forum/spring-projects/integration/738046-eclipse-cannot-find-the-spring-integration-3-0-xsd-and-fails-validation Quote Gary:

If you enable "Spring Nature" on the project, STS should resolve the schemas from the jars.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...