20

I am getting

"src-resolve: Cannot resolve the name 'j2ee:descriptionType' to a(n) 'type definition' component."

this error in my xsd file.

Please help me to solve this.

LU RD
  • 34,438
  • 5
  • 88
  • 296
Joe
  • 4,460
  • 19
  • 60
  • 106

2 Answers2

27

The error means that the descriptionType is an XML Schema type (simple or complex) that is being referenced in your XSD, something like type="j2ee:descriptionType". Your XSD needs to reference (using an import or include) the XSD file which contains this definition.

To find out which might be, you use the URI mapped with j2ee which will give you the target namespace of the schema you need. If that is different than of your XSD's, then you need to use something like <xsd:import namespace="j2ee uris goes here" schemaLocation="where is it?"/>; otherwise, is an <xsd:include schemaLocation="where is it?"/>

If you already have that import/include in your XSD, then the schema location is your problem; check that it resolves to something. This is where things might get tricky, since it depends on how you're getting the error, of which you said nothing.

If it's an editor, then it depends; maybe you need to configure some catalog that resolves namespace references, maybe you just copy the file over to your file system, etc.

Petru Gardea
  • 21,373
  • 2
  • 50
  • 62
  • 2
    I have imported XSDs as below it mean where my this xsd is i am going one level up by ../ and then going to folder 'z' and getting User.xsd. This is perfectly working in window and mac but in linux machine its failing ... any idea what am i doing mistake or what i should correct pls. – Kushwaha Mar 18 '19 at 10:48
-4

If you are using Eclipse then this might help.

If XML validation isnt adding any value to your build (it seldom does for me) just follow these guidelines how to disable xml validation

To summarise, just disable XML validation and then right click and validate the project again.

Community
  • 1
  • 1
cgull
  • 47
  • 4
  • 1
    usually, when a schema is provided, it has to be validated. Also, usually, when people ask about validation errors, they indeed have a requirement to validate. "just disable XML validation" is not answering this question at all. – DraxDomax Jul 02 '20 at 18:27