[JIRA] Commented: (MDA-57) Schema validation errors are not output unless logback with debug loglevel is specified

Lukas Haemmerle (JIRA) noreply at shibboleth.net
Tue Jan 3 11:46:25 GMT 2012


    [ https://issues.shibboleth.net/jira/browse/MDA-57?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13759#comment-13759 ] 

Lukas Haemmerle commented on MDA-57:
------------------------------------

Ok, that makes sense. Looking at configuration example 3 I now get the idea. Still, personally I would prefer that errors like a validation error would be output (as a warning) by the aggregator. Other problems are output as well, for example when a file cannot be downloaded or a schema file is not found etc.

{quote}
I should add that in my experience, if you're pulling metadata from somewhere you don't have control over, you absolutely need the flexibility that the disassemble/check/filter/assemble workflow gives you, as otherwise any tiny mistake at the source invalidates your entire process.
{quote}

On the other hand, that way one tiny mistake at the source can result in your metadata becoming invalid as well. I general, I would (especially in the context of metadata) rather prefer the workflow being invalidated than the resulting metadata. Invalid metadata can crash a whole federation whereas a crash workflow does not (at least not immediately) in general. 

But as you say, there are ways of dealing with errors and in this case one really has the flexibility and means to deal with them. So, all that is needed is that one has to be aware of this concept ;-)

> Schema validation errors are not output unless logback with debug loglevel is specified
> ---------------------------------------------------------------------------------------
>
>                 Key: MDA-57
>                 URL: https://issues.shibboleth.net/jira/browse/MDA-57
>             Project: Metadata Aggregator
>          Issue Type: Bug
>            Reporter: Lukas Haemmerle
>            Assignee: Chad La Joie
>
> When using a schema validation bean I noticed that validation errors are not output when mda.sh is called by default. Only if one adds a JVMOPT to specify a logback.xml via the command line and only if the log level is set to "debug", the validation errors are output. Also the return code of mda.sh in that case is 0.
> {code}
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'mdui:GeolocationHint'. One of '{"urn:oasis:names:tc:SAML:metadata:ui":DisplayName, "urn:oasis:names:tc:SAML:metadata:ui":Description, "urn:oasis:names:tc:SAML:metadata:ui":Keywords, "urn:oasis:names:tc:SAML:metadata:ui":Logo, "urn:oasis:names:tc:SAML:metadata:ui":InformationURL, "urn:oasis:names:tc:SAML:metadata:ui":PrivacyStatementURL, WC[##other:"urn:oasis:names:tc:SAML:metadata:ui"]}' is expected.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[na:na]
> 	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) ~[na:na]
> 	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) ~[na:na]
> 	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source) ~[na:na]
> 	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) ~[na:na]
> 	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) ~[na:na]
> 	at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) ~[na:na]
> 	at javax.xml.validation.Validator.validate(Unknown Source) ~[na:1.4.01]
> 	at net.shibboleth.metadata.dom.XMLSchemaValidationStage.doExecute(XMLSchemaValidationStage.java:121) [aggregator-pipeline-0.6.1.jar:na]
> 	at net.shibboleth.metadata.dom.XMLSchemaValidationStage.doExecute(XMLSchemaValidationStage.java:57) [aggregator-pipeline-0.6.1.jar:na]
> 	at net.shibboleth.metadata.pipeline.BaseIteratingStage.doExecute(BaseIteratingStage.java:44) [aggregator-pipeline-0.6.1.jar:na]
> 	at net.shibboleth.metadata.pipeline.BaseStage.execute(BaseStage.java:41) [aggregator-pipeline-0.6.1.jar:na]
> 	at net.shibboleth.metadata.pipeline.SimplePipeline.execute(SimplePipeline.java:66) [aggregator-pipeline-0.6.1.jar:na]
> 	at net.shibboleth.metadata.cli.SimpleCommandLine.main(SimpleCommandLine.java:90) [aggregator-cli-0.6.1.jar:na]
> 2012-01-03 11:04:11,057 DEBUG net.shibboleth.metadata.cli.SimpleCommandLine - Pipeline execution complete
> maclh:aggregator-cli-0.6.1 haemmer$ echo $?
> 0
> {code}
> The configuration I used was:
> {code}
> <?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:p="http://www.springframework.org/schema/p"
>     xmlns:util="http://www.springframework.org/schema/util"
>     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"
>     default-init-method="main">
>     <bean id="httpClientBuilder" class="org.opensaml.util.net.HttpClientBuilder"/>
>     <bean id="httpClient" factory-bean="httpClientBuilder" factory-method="buildClient"/>
>     <!-- First, we define the stages for our pipeline -->
>     <bean id="source" class="net.shibboleth.metadata.dom.DomFilesystemSourceStage">
>         <property name="id" value="source"/>
>         <property name="parserPool">
>             <bean class="org.opensaml.util.xml.BasicParserPool" init-method="initialize"/>
>         </property>
> 	<property name="source">
>             <bean class="java.io.File">
>                 <constructor-arg value="mm.xml"/>
>             </bean>
>         </property>
>     </bean>
>     <bean id="validateSchema" class="net.shibboleth.metadata.dom.XMLSchemaValidationStage"
>         p:id="validateSchema">
>         <property name="schemaResources">
>             <util:list>
>                <bean class="org.opensaml.util.resource.FilesystemResource">
>                     <constructor-arg value="schemas/saml-schema-metadata-2.0.xsd" />
>                </bean>
>                <bean class="org.opensaml.util.resource.FilesystemResource">
>                     <constructor-arg value="schemas/shibboleth-metadata-1.0.xsd" />
>                </bean>
>                <bean class="org.opensaml.util.resource.FilesystemResource">
>                     <constructor-arg value="schemas/saml-metadata-ui-1.0.xsd" />
>                </bean>
>                <bean class="org.opensaml.util.resource.FilesystemResource">
>                     <constructor-arg value="schemas/saml-metadata-rpi-1.0.xsd" />
>                </bean>
>             </util:list>
>         </property>
>     </bean>
>     <bean id="validateSignature" class="net.shibboleth.metadata.dom.XMLSignatureValidationStage">
>         <property name="id" value="validateSignature"/>
>         <property name="verificationCertificate">
>             <bean class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean">
>                 <property name="certificateFile">
>                     <bean id="eduGAINCertFile" class="java.io.File">
>                         <constructor-arg value="eduGAIN-Signer-CA.crt"/>
>                     </bean>
>                 </property>
>             </bean>
>         </property>
>     </bean>
>     <bean id="serialize" class="net.shibboleth.metadata.pipeline.SerializationStage">
>         <property name="id" value="serializeIdPs"/>
>         <property name="outputFile">
>             <bean class="java.io.File">
>                 <constructor-arg value="verified-m.xml"/>
>             </bean>
>         </property>
>         <property name="serializer">
>             <bean id="domSerializer" class="net.shibboleth.metadata.dom.DomElementSerializer"/>
>         </property>
>     </bean>
>     <!-- Next we define a pipeline with all the stages in it -->
>     <bean id="main" class="net.shibboleth.metadata.pipeline.SimplePipeline">
>         <property name="id" value="pipeline"/>
>         <property name="stages">
>             <list>
>                 <ref bean="source"/>
> 		<ref bean="validateSchema" />
>                 <!-- <ref bean="validateSignature"/> -->
>                 <ref bean="serialize"/>
>             </list>
>         </property>
>     </bean>
> </beans>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the commits mailing list