question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XML validation errors (incomplete project-based XSD schemas resolution?)

See original GitHub issue

Using STS4 4.6.0 in Eclipse. In #108 project-based XSD schema resolution was implemented. I’m pretty sure I saw this working in other places, but I have a XML file using Spring Integration namespace XML elements for which this resolution seems to (partially) fail. I have Spring Integration 4.3.21 in the classpath (both core and http modules) and snippets like these:

<int:header-enricher
    input-channel="preAuthRequestChannel"
    output-channel="restServiceRequestChannel">
    <int:header name="myHeader"
        expression="someGreatExpression" />
</int:header-enricher>

The above is marked with this error:

cvc-complex-type.3.2.2: Attribute 'expression' is not allowed to appear in element 'int:header'.

Similar errors are given on <int-http:outbound-gateway> attributes like http-method-expression or request-factory. I’m using the unversioned namespaces:

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	default-lazy-init="true"
	xmlns:int-http="http://www.springframework.org/schema/integration/http"
	xmlns:int="http://www.springframework.org/schema/integration"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/http https://www.springframework.org/schema/integration/http/spring-integration-http.xsd">

If I replace the unversioned XSDs with the versioned (4.3) ones, those errors go away. But I would like to avoid it. The Spring Boot language server log doesn’t show any error/exception. The XML where I have this problem seems to be detected as well as any updates to it:

17:22:07.712 [pool-4-thread-1] INFO  o.s.i.v.boot.app.SpringSymbolIndex - Update document [xml changed]: file:///home/mauro/svn/DCS-SHOP-trunk/shop-commons/src/main/resources/context/myfile-foo.xml

Basic XML code assist for attribute names work (even for those attributes that are marked in red!), as well as further STS4 code assist within <bean> attributes (like class or property).

If I right click on the editor and choose “Validate”, I get “The validation completed with no errors or warnings”, yet I have those errors in the left vertical ruler and attributes are underlined in red.

I tried to:

  • restart Eclipse
  • clean that project
  • close and reopen that project

without success.

Any idea on what is going on?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
martinlippertcommented, Jan 4, 2021

@mauromol Here you are… 😃

0reactions
mauromolcommented, Dec 24, 2020

Thanks a lot @martinlippert! I will watch that new issue when it is available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolution of the validation error when a schema specifies ...
Problem. In Rational® Application Developer (RAD) version 6.x, if an XML Schema specifies multiple imports with the same namespace and ...
Read more >
Understanding schema errors | HESA
The schema is defined by the XSD. Schema errors occur where there is a problem with the structure or order of the file,...
Read more >
Errors occurred while compiling the XML schemas in the project
There is an error in an XML Schema Definition (XSD) schema included in the project. This error occurs when you add an XSD...
Read more >
Spring Data Xml Configuration Schema Validation Error - ADocLib
XML validation errors (incomplete project-based XSD schemas resolution?) The Spring Boot language server log doesn't show any error/exception. language ...
Read more >
When validate XSD against XML getting an error?
The element 'Table' has incomplete content. List of possible elements expected: 'IP21TAG'. XML: <NewDataSet> <Table> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found