Return-Path: X-Original-To: apmail-aries-dev-archive@www.apache.org Delivered-To: apmail-aries-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65276184FA for ; Fri, 10 Jul 2015 16:28:05 +0000 (UTC) Received: (qmail 46747 invoked by uid 500); 10 Jul 2015 16:28:05 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 46707 invoked by uid 500); 10 Jul 2015 16:28:05 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 46693 invoked by uid 99); 10 Jul 2015 16:28:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jul 2015 16:28:05 +0000 Date: Fri, 10 Jul 2015 16:28:05 +0000 (UTC) From: "Guillaume Nodet (JIRA)" To: dev@aries.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ARIES-1286) Support for inner beans defined as "xsd:any" in custom XMLs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ARIES-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622547#comment-14622547 ] Guillaume Nodet commented on ARIES-1286: ---------------------------------------- I'm not sure your analysis is correct. The XSD for the blueprint namespace is always added to the schema: https://github.com/apache/aries/blob/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/namespace/NamespaceHandlerRegistryImpl.java#L315 > Support for inner beans defined as "xsd:any" in custom XMLs > ----------------------------------------------------------- > > Key: ARIES-1286 > URL: https://issues.apache.org/jira/browse/ARIES-1286 > Project: Aries > Issue Type: Bug > Components: Blueprint > Affects Versions: blueprint-core-1.0.1 > Reporter: metatech > Attachments: blueprint-ext.xsd, config.xml > > > When a custom XSD defines a "xs:any" bean (for instance "shutdownHooks" in ActiveMQ), Blueprint XML validation rejects it because the XML Validator cannot find the XSD for the Blueprint core namespace (http://www.osgi.org/xmlns/blueprint/v1.0.0). > This is because the BlueprintContainer, which calls the XSD validation, extracts the XSD's from the various NamespaceHandler's which are used in the XML. But the Blueprint core namespace is an exceptional case, because it does not have a NamespaceHandler registered in the OSGi registry. Its XSD is therefore missing from the "Schema" object. > To reproduce the problem, here are the steps : > Download samples and extract it : > http://apache.cu.be/aries/samples-1.0.0-source-release.zip > Replace file samples-1.0.0\blueprint\helloworld\helloworld-client\src\main\resources\OSGI-INF\blueprint\config.xml with attached, which adds an inner bean definition. > In directory blueprint-samples-1.0.0-source-release\samples-1.0.0\blueprint\helloworld, do a "mvn install" > In directory blueprint-samples-1.0.0-source-release\samples-1.0.0\blueprint\helloworld\helloworld-assembly\target, > open org.apache.aries.blueprint-1.0.0.jar with a ZIP editor. > Browse to directory org/apache/aries/blueprint/ext/impl > Replace blueprint-ext.xsd with the attached version, which adds a "xsd:any" element. > Run the test with > java -jar osgi-3.5.0.v20090520.jar -console > Type "ss" and check the ID for the bundles. > Start the bundle "org.apache.aries.samples.blueprint.helloworld.client_1.0.0" > {code} > [Blueprint Extender: 1] ERROR org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to start blueprint container for bundle org.apache.aries.samples.blueprint.helloworld.client > org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml > at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288) > at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:291) > at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:242) > at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48) > at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) > at java.util.concurrent.FutureTask.run(Unknown Source) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > at java.lang.Thread.run(Unknown Source) > Caused by: org.xml.sax.SAXParseException; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'. > at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) > at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) > at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source) > at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source) > at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) > at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) > at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(Unknown Source) > at javax.xml.validation.Validator.validate(Unknown Source) > at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:285) > ... 10 more > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)