The id attribute in blueprint is typed as xsd:ID and can't take an
arbitrary value.
So, actually you shouldn't be using that value that violates this syntax rule.
The validation attribute is often used to intentionally disable the
validation to workaround the known limitation of the validation with
the parameterized values.
For example, when you have a schema where the value type is typed as
URL, when you have
value="${endpoint.url}" where ${endpoint.url} is set to
"http://localhost:8181/cxf/myservice"
the real content after the parameter injection, you have
value = "http://localhost:8181/cxf/myservice"
and this is schema-valid, but the schema validation is performed prior
to the parameter injection, so you need to disable the entire
validation to avoid getting the validation error. I think I suggested
adding another option of only disabling the primitive-type check some
years ago at the aries mailing list.
http://mail-archives.apache.org/mod_mbox/aries-user/201212.mbox/%3ccaf8t5xud7q+jyhucx-pm6yn5z9hmopsxgbmkyaxuirxruzn...@mail.gmail.com%3E
but I think there is no such option and I also didn't pursue this issue.
Regarding the non-published camel-cxf schema, I think the problem was
its namespace and its schemaLocation. It is actually a schema defined
in the camel project but it uses the cxf namespace.
When you are using this schema with spring or blueprint, the schema
lookup is redirected to the correct schema included in
camel-cxf-transport.jar, so you don't notice the absence of this
schema at the specified schemaLocation. We should publish this
schema,, but I am not sure if we should change the location, though.
regards, aki
2015-08-12 8:02 GMT+02:00 metatech <[email protected]>:
> Hello,
>
> We are trying to use Camel CXF Transport within Blueprint.
> We followed the intructions on this page :
> http://camel.apache.org/camel-transport-for-cxf.html
>
> However, when defining a camel destination with an ID containing a dot :
> <camel:destination id="*.camel-destination" camelContextId="camel1" />
> Blueprint XSD validation fails with the exception below [1].
>
> In Spring, an ID is defined as a "xs:string", whereas in Blueprint, an ID is
> defined as "NCName" (non-colonized name), which disallows mainly punctuation
> characters (including "dot").
>
> The problem can be reproduced easily with the unit test
> "CxfTransportBlueprintTest", by replacing
> "blueprint.aries.xml-validation:=false" by
> "blueprint.aries.xml-validation:=true".
>
> As a workaround, we also temporarily disabled XML validation in our business
> bundle, but it would a better practice to leave it enabled.
>
> Which syntax could we use ?
>
> Also, the schema http://cxf.apache.org/schemas/blueprint/camel.xsd is not
> published on this URL, is this normal ?
>
> Thanks in advance,
> Best regards,
>
> metatech
>
> [1]
> 2015-08-11 17:10:16,014 [int Extender: 1] ERROR BlueprintContainerImpl
> - Unable to start blueprint container for bundle CxfTransportBlueprintTest
> 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:313)
> at
> org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at
> org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
> at
> org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: org.xml.sax.SAXParseException; cvc-datatype-valid.1.2.1:
> '*.camel-destination' is not a valid value for 'NCName'.
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
> at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2832)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2769)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2056)
> at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:746)
> at
> com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277)
> at
> com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244)
> at
> com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
> at
> com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
> at javax.xml.validation.Validator.validate(Validator.java:124)
> at
> org.apache.aries.blueprint.parser.Parser.validate(Parser.java:285)
> ... 13 more
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-CXF-Transport-works-within-Blueprint-only-when-XSD-validation-is-disabled-tp5770593.html
> Sent from the Camel - Users mailing list archive at Nabble.com.