You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2009/08/11 12:57:10 UTC

[2.x] another validation question

For ASM_10003 I'm trying to turn on XSD validation for
definitions.xml. I changed DefinitionsDocumentProcessor to create the
input factory using the following...

this.inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);

But I still don't see some expect validation errors. What else do I need to do?

I do get an appropriate error from the processors....

11-Aug-2009 11:44:57
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
[Definitions: jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
(ElementCannotBeProcessed)
SEVERE: Element
{http://docs.oasis-open.org/ns/opencsa/sca/200903}component cannot be
processed. ([row,col,system-id]:
[11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])
org.oasisopen.sca.ServiceRuntimeException: [Definitions:
jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
- Element {http://docs.oasis-open.org/ns/opencsa/sca/200903}component
cannot be processed. ([row,col,system-id]:
[11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])java.lang.IllegalStateException:
org.oasisopen.sca.ServiceRuntimeException: [Definitions:
jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
- Element {http://docs.oasis-open.org/ns/opencsa/sca/200903}component
cannot be processed. ([row,col,system-id]:
[11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])

But I'd like to understand why validation is not apparently active.

Regards

Simon

Re: [2.x] another validation question

Posted by Simon Laws <si...@googlemail.com>.
On Tue, Aug 11, 2009 at 6:05 PM, Raymond Feng<en...@gmail.com> wrote:
> I have a fix for the problem now. I'll check it in soon.
>
> 1) We have a bug in ValidatingXMLStreamReader.next() which doesn't trigger
> the startDocument(). As a result, all the elements are skipped from
> validation. CompositeDocumentProcessor uses nextTag() while
> DefinitionsDocumentProcessor uses next(). That's why we don't see problems
> with composite files.

Thanks Raymond. Would have taken me a while to work that out!

>
> 2) The DefaultSchemaValidationExtensionPoint is DISABLED by default. Should
> we turn it on for unit tests? I understand we control the flag at NodeImpl
> level too.
>

What are the current rules/mechanisms for enabling/disabling
validation? If we could have a single flag at the node level for
enabling/disabling all validation then I think that would be more
appropriate than addressing
composite/contribution/definitions/component type independently. Happy
to help here if we can decide what to do.

Simon

Re: [2.x] another validation question

Posted by Raymond Feng <en...@gmail.com>.
I have a fix for the problem now. I'll check it in soon.

1) We have a bug in ValidatingXMLStreamReader.next() which doesn't trigger 
the startDocument(). As a result, all the elements are skipped from 
validation. CompositeDocumentProcessor uses nextTag() while 
DefinitionsDocumentProcessor uses next(). That's why we don't see problems 
with composite files.

2) The DefaultSchemaValidationExtensionPoint is DISABLED by default. Should 
we turn it on for unit tests? I understand we control the flag at NodeImpl 
level too.

Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <si...@googlemail.com>
Sent: Tuesday, August 11, 2009 3:57 AM
To: "tuscany-dev" <de...@tuscany.apache.org>
Subject: [2.x] another validation question

> For ASM_10003 I'm trying to turn on XSD validation for
> definitions.xml. I changed DefinitionsDocumentProcessor to create the
> input factory using the following...
>
> this.inputFactory = 
> modelFactories.getFactory(ValidatingXMLInputFactory.class);
>
> But I still don't see some expect validation errors. What else do I need 
> to do?
>
> I do get an appropriate error from the processors....
>
> 11-Aug-2009 11:44:57
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
> [Definitions: 
> jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
> (ElementCannotBeProcessed)
> SEVERE: Element
> {http://docs.oasis-open.org/ns/opencsa/sca/200903}component cannot be
> processed. ([row,col,system-id]:
> [11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])
> org.oasisopen.sca.ServiceRuntimeException: [Definitions:
> jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
> - Element {http://docs.oasis-open.org/ns/opencsa/sca/200903}component
> cannot be processed. ([row,col,system-id]:
> [11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])java.lang.IllegalStateException:
> org.oasisopen.sca.ServiceRuntimeException: [Definitions:
> jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
> - Element {http://docs.oasis-open.org/ns/opencsa/sca/200903}component
> cannot be processed. ([row,col,system-id]:
> [11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])
>
> But I'd like to understand why validation is not apparently active.
>
> Regards
>
> Simon