Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jakartaee_web_services_metadata_handler_3_0.xsd includes jakartaee_9.xsds which does not exists #1519

Closed
engsyst opened this issue Sep 9, 2022 · 15 comments · Fixed by #1605
Assignees

Comments

@engsyst
Copy link

engsyst commented Sep 9, 2022

Describe the bug
jakartaee_web_services_metadata_handler_3_0.xsd includes non-existing schema and references to non-existing type.

To Reproduce
Steps to reproduce the behavior:

  1. Create a handler chain xml document as described in jakartaee_web_services_metadata_handler_3_0.xsd documentation tag.
<handler-chains xmlns="https://jakarta.ee/xml/ns/jakartaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
      https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd"
  version="3.0">
  
</handler-chains>
  1. Eclipse shows the validation errors:
Multiple annotations found at this line:
	- There is '1' error in 'https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd'.
	- schema_reference.4: Failed to read schema document 'https://jakarta.ee/xml/ns/jakartaee/jakartaee_9.xsds', 
	 because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not 
	 <xsd:schema>.
  1. Is this correct to remove the last 's' in <xsd:include schemaLocation="jakartaee_9.xsds"/> -> <xsd:include schemaLocation="jakartaee_9.xsd"/> or to change the value to "jakartaee_10.xsd"? If I do that in the downloaded schema, Eclipse shows the error message in line 55 for both values "jakartaee_9.xsd" and "jakartaee_10.xsd" for the code:
<xsd:element name="handler-chains"
               type="jakartaee:service-ref_handler-chainsType">
Multiple annotations found at this line:
	- src-resolve: Cannot resolve the name 'jakartaee:service-ref_handler-chainsType' to a(n) 'type 
	 definition' component.
	- src-resolve: Cannot resolve the name 'jakartaee:service-ref_handler-chainsType' to a(n) 'type 
	 definition' component.
  1. service-ref_handler-chainsType cannot be found in the files.

Expected behavior
jakartaee_web_services_metadata_handler_3_0.xsd should includes the correct schema that declares jakartaee:service-ref_handler-chainsType and other required components to be used to validate handler chains configurations.

Desktop (please complete the following information):

  • OS: Microsoft Windows 10 Enterprise, Version: 10.0.19044 Build 19044
  • IDE: Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components).
  • Version: 2022-03 (4.23.0). Build id: 20220310-1457
@JWT007
Copy link

JWT007 commented Dec 18, 2022

Same problem... looks like a typo.
<xsd:include schemaLocation="jakartaee_9.xsds"/>
The file 'jakartaee_9.xsd' exists but 'jakartaee_9.xsds' does not.

@pzygielo

This comment was marked as resolved.

@JWT007
Copy link

JWT007 commented Dec 18, 2022

@pzygielo

This comment was marked as outdated.

@pzygielo
Copy link
Contributor

@JWT007

here it seems? https://github.com/eclipse-ee4j/jakartaee-schemas/tree/9/jakartaee9/src

I can't find jakartaee_web_services_metadata_handler_3_0.* there neither.

@JWT007
Copy link

JWT007 commented Dec 18, 2022

yup you are right... things seem to be a bit tweaked :) all moving too fast I guess

@JWT007
Copy link

JWT007 commented Dec 18, 2022

just fyi the links here seem to be totally mixed up.
https://jakarta.ee/xml/ns/jakartaee/#9

selecting the Jakarta EE 9 web-services xsd includes the jakartaee_10.xsds.
https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_2_0.xsd

one would expect that the target URL 'https://jakarta.ee/xml/ns/jakartaee/*' contains all versions of the xsds and not just a snapshot of one build

@pzygielo
Copy link
Contributor

Similar but for other schemas:

just fyi the links here seem to be totally mixed up. https://jakarta.ee/xml/ns/jakartaee/#9

selecting the Jakarta EE 9 web-services xsd includes the jakartaee_10.xsds. https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_2_0.xsd

I haven't spotted that in

😞

@JWT007
Copy link

JWT007 commented Dec 19, 2022

@pzygielo looks like some of the other related problems got fixed, any chance of now fixing the bad include in the:
https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd
:)

@pzygielo
Copy link
Contributor

any chance of now fixing the bad include in the: https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd

I suppose someone from metro, most probably @lukasj, has to assist with that.

@pzygielo
Copy link
Contributor

  1. I can't locate it in https://github.com/eclipse-ee4j/jakartaee-schemas/tree/master/xml/src. Where one could find the source for that file?

Found it: jakartaee/jws-api#83

  1. Is that really just the typo?

By comparison with previous version (javaee_web_services_metadata_handler_2_0.xsd) it seems to be just that.

@lukasj
Copy link
Contributor

lukasj commented Dec 19, 2022

the file exists at https://github.com/eclipse-ee4j/jakartaee-schemas/tree/releases/9/jakartaee9/src That repo contains tests as well. So the main question is: who is right?

@pzygielo
Copy link
Contributor

pzygielo commented Dec 19, 2022

the file exists at https://github.com/eclipse-ee4j/jakartaee-schemas/tree/releases/9/jakartaee9/src

no (#1519 (comment))

no - as in - there is no jakartaee_web_services_metadata_handler_3_0.xsd file.

xsds - it might be included if it is processed to the final xsd. But the jakartaee-schemas repo has no jakartaee_web_services_metadata_handler_3_0.xsd there. It contains sources (of other schemas) that are transformed to their final version to be published here.

In the set of published schemas, that this repo provides, there is no xsds file.

@pzygielo
Copy link
Contributor

So the main question is: who is right?

Probably the value of schemaLocation attribute is wrong.

@JWT007
Copy link

JWT007 commented Jan 10, 2023

Can someone please check if this was successfully or rather correctly resolved?

There is a https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd which incorrectly references a non-existent type: <xsd:element name="handler-chains" type="jakartaee:service-ref_handler-chainsType">

In addition this XSD includes the Jakarta 9 EE XSD which is IMHO incorrect because it is used by both Jakarta 9 EE and Jakarta 10 EE.

I believe the include should be for "https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_client_2_0.xsd" and the element type should be <xsd:element name="handler-chains" type="jakartaee:handler-chainsType">.

<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:jakartaee="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="https://jakarta.ee/xml/ns/jakartaee" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.0">
  <xsd:annotation>
    <xsd:documentation>
This is the XML Schema for the Handler chain configuration descriptor. The configuration file must be in the classpath within the JAR/WAR file. All Handler chain configuration descriptors should indicate the descriptor schema by using the Jakarta EE namespace: https://jakarta.ee/xml/ns/jakartaee and by indicating the version of the schema by using the version element as shown below:
<handler-chains xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd" version="3.0"> ... </handler-chains>
The instance documents may indicate the published version of the schema using the xsi:schemaLocation attribute for Jakarta EE namespace with the following location: https://jakarta.ee/xml/ns/jakartaee/jakartaee_web_services_metadata_handler_3_0.xsd
    </xsd:documentation>
  </xsd:annotation>
  <xsd:include schemaLocation="jakartaee_web_services_client_2_0.xsd"/>
  <xsd:element name="handler-chains" type="jakartaee:handler-chainsType">
    <xsd:annotation>
      <xsd:documentation> The handler-chains element is the root element for defining handlerchains. The Jakarta Web Services Metadata specification defines the @jakarta.jws.HandlerChain annotation that refers to an XML descriptor conforming to this schema. </xsd:documentation>
    </xsd:annotation>
  </xsd:element>
</xsd:schema>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants