Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
491 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...