- This topic has 5 replies, 2 voices, and was last updated 14 years, 11 months ago by Robert Varga.
-
AuthorPosts
-
Robert VargaParticipantHi,
there is a bug in validation of schema-based Spring bean definition XML files (again?).
I am using 7.5M1 with 3.4.2.
I have an XML catalog entry for among others the following:
Location: C:\java\libs\jaxws\jaxws-spring\spring-jax-ws-servlet.xsd URI: file:///C:/java/libs/jaxws/jaxws-spring/spring-jax-ws-servlet.xsd Key Type: Namespace Name Key: http://jax-ws.dev.java.net/spring/servlet
The file exists at the given place and contains the bindings and the binding element definitions as normal.
Still, in the following file
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ws="http://jax-ws.dev.java.net/spring/core" xmlns:wss="http://jax-ws.dev.java.net/spring/servlet" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://jax-ws.dev.java.net/spring/core https://jax-ws.dev.java.net/spring/core.xsd http://jax-ws.dev.java.net/spring/servlet https://jax-ws.dev.java.net/spring/servlet.xsd"> <wss:binding url="/webservice/NotifierTestService"> <wss:service> <ws:service bean="#notifierTestJaxWsWebService"> <ws:handlers> <ref bean="jaxWsDebugHandler" /> </ws:handlers> </ws:service> </wss:service> </wss:binding> ...
Spring validation does not consult it, instead it gives me the following errors:
Multiple annotations found at this line: - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'wss:binding'. - schema_reference.4: Failed to read schema document 'https://jax-ws.dev.java.net/spring/ servlet.xsd', 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>. - Unable to locate Spring NamespaceHandler for element 'wss:binding' of schema namespace 'http://jax-ws.dev.java.net/spring/servlet'
The first error (cvc-complex-type.2.4.c) is obviously the result of the second one.
The second error seems to indicate that the xsd is not loaded by the catalog, and is not loaded from the server either (because it throws a 403 error at the moment). However, it should not go to the server at all since there is an xml catalog entry for it.
The third error also did not occur earlier, but it might also be the result of the first, as I did not see this earlier when the server was not giving a 403.
Still, the XML catalog entry should be consulted and used instead of going to the server.
Best regards,
Robert
Brian FernandesModeratorRobert,
Yes, the catalog should definitely have been consulted. Thanks for bringing this to our attention in time, I’ll take a look at it shortly and make sure we fix it for the upcoming GA.
Do you know if this worked for you in 7.1.1 (i.e. if you happened to be offline and there were no validation issues caused by other XSDs which were in your catalog)?Sorry for the inconvenience caused and thanks again for the report.
Robert VargaParticipantHi Brian,
I am not really sure. I believed it does work, however I am not convinced anymore that it really did in this case.
I remember reporting this or a similar bug some months or years ago, though, about some XML catalog file not being consulted, but I don’t remember the exact details. I think it was fixed at that time, that is why I wrote it does not work again?.
Best regards,
Robert
Brian FernandesModeratorRob,
Can you edit your catalog entry and change the key type to “Schema Location” and the actual Key to https://jax-ws.dev.java.net/spring/servlet.xsd
If you go offline, you should now still have access to the schema. Can you tell me if this works for you? I suppose you would have to make the same changes for your other user catalog entries as well.There does seem to be a problem with the catalog as far as “Namespace name” based lookups are concerned and I’ve filed a bug for investigation.
Thanks!
Robert VargaParticipant@Support-Brian wrote:
Rob,
Can you edit your catalog entry and change the key type to “Schema Location” and the actual Key to https://jax-ws.dev.java.net/spring/servlet.xsd
If you go offline, you should now still have access to the schema. Can you tell me if this works for you? I suppose you would have to make the same changes for your other user catalog entries as well.There does seem to be a problem with the catalog as far as “Namespace name” based lookups are concerned and I’ve filed a bug for investigation.
Thanks!
Hi Brian,
it got rid of half the errors, now instead of 8 errors in the Problems view for 4 places, now only get 4 errors for the 4 places.
In effect, it did not solve the problem.
Best regards,
Robert
Robert VargaParticipant@robvarga wrote:
@Support-Brian wrote:
Rob,
Can you edit your catalog entry and change the key type to “Schema Location” and the actual Key to https://jax-ws.dev.java.net/spring/servlet.xsd
If you go offline, you should now still have access to the schema. Can you tell me if this works for you? I suppose you would have to make the same changes for your other user catalog entries as well.There does seem to be a problem with the catalog as far as “Namespace name” based lookups are concerned and I’ve filed a bug for investigation.
Thanks!
Hi Brian,
it got rid of half the errors, now instead of 8 errors in the Problems view for 4 places, now only get 4 errors for the 4 places.
In effect, it did not solve the problem.
Best regards,
Robert
Update, it might work. Build automatically was off, and therefore the project did not recompile and revalidation probably did not occur.
The JAX-WS Spring website was fixed, now I am not able to find out why it is working…
Best regards,
Robert
-
AuthorPosts