You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bvahdat <ba...@swissonline.ch> on 2011/08/24 15:50:31 UTC

What is the correct camel's schemaLocation?

Hi,

I'm bit confused regarding the schemaLocation both by camel as well as
spring.

Reading at [1] it says:
/
You need to add Camel to the schemaLocation declaration
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
/
But as an example if I'm riding on camel 2.8.0 shouldn't I correctly use the
following schemaLocation declaration instead:

/http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.8.0.xsd
/
As for example the complex type "keyManagersParametersFactoryBean" is first
introduced by camel 2.8.0 (see [2]), and if I would make a usage of it in my
spring-xml-configuration, how should that type be resolved / checked at
runtime through the xml validating parser (via spring ApplicationContext
initialization)?

On the other hand spring documentation itself at [3] says that 

/The 'xsi:schemaLocation' fragment is not actually required...
/
So my question is how the schemaLocation magic really works at runtime in
general, for example as the SAX-Validating-Parser goes over it while the
spring initialization happens through the ClassPathXmlApplicationContext
initialization / instantiation?

[1] http://camel.apache.org/spring.html
[2] http://camel.apache.org/camel-configuration-utilities.html
[3]
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/xsd-config.html#xsd-config-body-referencing

Regards, Babak

--
View this message in context: http://camel.465427.n5.nabble.com/What-is-the-correct-camel-s-schemaLocation-tp4730506p4730506.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: What is the correct camel's schemaLocation?

Posted by bvahdat <ba...@swissonline.ch>.
Just for the case other camel user's are interested as well, following the
explanation of that "schemaLocation-magic":

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/extensible-xml.html#extensible-xml-registration-spring-schemas

Thanks Freeman for making this clear to me
Regards, Babak

--
View this message in context: http://camel.465427.n5.nabble.com/What-is-the-correct-camel-s-schemaLocation-tp4730506p4730750.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: What is the correct camel's schemaLocation?

Posted by bvahdat <ba...@swissonline.ch>.
Hi again Freeman,

My last question by my previous post was simply stupid, please ignore it.
The mapping happens always through META-INF/spring.schemas both by spring as
well as camel itself.

Thanks for your clarification
Regards, Babak 

--
View this message in context: http://camel.465427.n5.nabble.com/What-is-the-correct-camel-s-schemaLocation-tp4730506p4730690.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: What is the correct camel's schemaLocation?

Posted by bvahdat <ba...@swissonline.ch>.
Hi Freeman,

thanks for your reply, now I see, indeed the camel-spring.xsd &
camel-spring-v2.8.xsd are both there:

http://repo1.maven.org/maven2/org/apache/camel/camel-spring/2.8.0/camel-spring-2.8.0.jar

looking at spring itself, it seems it is done in a similar fashion:

http://repo1.maven.org/maven2/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar

that's the file META-INF/spring.schemas which maps each given namespace to
the corresponding xsd file inside jar itself, like the following entry
inside META-INF/spring.schemas:

http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd

just as the last question, as I'm curious and in the case you know it
already, do you know where exactly in camel-spring's code that "mapping
magic" happens?

Regards, Babak


--
View this message in context: http://camel.465427.n5.nabble.com/What-is-the-correct-camel-s-schemaLocation-tp4730506p4730612.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: What is the correct camel's schemaLocation?

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

The magic is the spring.schemas inside camel-spring.jar, it always map  
the namespace to the local camel-spring.xsd inside camel-spring.jar,  
so that both http://camel.apache.org/schema/spring/camel-spring.xsd  
and http://camel.apache.org/schema/spring/camel-spring-2.8.0.xsd works  
here, but use http://camel.apache.org/schema/spring/camel-spring.xsd  
is better as you needn't change your router configuration file when  
camel version changes.

Freeman
On 2011-8-24, at 下午9:50, bvahdat wrote:

> Hi,
>
> I'm bit confused regarding the schemaLocation both by camel as well as
> spring.
>
> Reading at [1] it says:
> /
> You need to add Camel to the schemaLocation declaration
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
> /
> But as an example if I'm riding on camel 2.8.0 shouldn't I correctly  
> use the
> following schemaLocation declaration instead:
>
> /http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring-2.8.0.xsd
> /
> As for example the complex type "keyManagersParametersFactoryBean"  
> is first
> introduced by camel 2.8.0 (see [2]), and if I would make a usage of  
> it in my
> spring-xml-configuration, how should that type be resolved / checked  
> at
> runtime through the xml validating parser (via spring  
> ApplicationContext
> initialization)?
>
> On the other hand spring documentation itself at [3] says that
>
> /The 'xsi:schemaLocation' fragment is not actually required...
> /
> So my question is how the schemaLocation magic really works at  
> runtime in
> general, for example as the SAX-Validating-Parser goes over it while  
> the
> spring initialization happens through the  
> ClassPathXmlApplicationContext
> initialization / instantiation?
>
> [1] http://camel.apache.org/spring.html
> [2] http://camel.apache.org/camel-configuration-utilities.html
> [3]
> http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/xsd-config.html#xsd-config-body-referencing
>
> Regards, Babak
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/What-is-the-correct-camel-s-schemaLocation-tp4730506p4730506.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com