Do you have any idea how the problem with a spring bean reference to the
ConnectionFactory can be solved in the xml config?
I guess this is possible in spring but have not found any clues till now
how to do it.
Talking about validation. I think validation of Spring config files
could be accomplished at compile time. Normally the configs
are static and there is no need to validate them on each run. Tools like
SpringIDE already do this.
I understand that property replacement and validation do not fit well.
But there must be a way to achieve this. A simple way would be to define
all integer elements as string types. So the validation would still
catch misspelled elements and attributes. But I do not like the fact
that the generated java classes would then
also only contain strings.
What about the following: Use the current xsd to generate the Java
classes. Then generate a new xsd from the original xsd that only defines
strings then this xsd could be used to validate the config files.
Would this help?
Greetings
Christian
Benson Margulies schrieb:
Both features are important. Catching typos with validation is
important, and property placeholders are important. Performance isn't
nothing either, and the only way I could think of to have both would
involve building an extra DOM tree, which would be slow.
I am -1 for changing the default, but I'm not beyond persuasion of
many others think that validation is a hopeless goal in a
Spring-centric world.
On Sun, Sep 14, 2008 at 3:49 PM, Christian Schneider
<[EMAIL PROTECTED]> wrote:
Hi Daniel,
thanks for the hint. I will try this. I think the feature of replacing
properties is extremely important for the cxf users. Can we trun off the
validation by default?
Another idea would be to do the validation after the properties have
been replaced.
I have got another question about the xml configuration. Is it possible
to tell spring that an element is a reference to to a bean? I would like
to add the functionality of referencing the
ConnectionFactory to the address element. So people can define their
factory locally or use spring“s jndi logic to look it up. Of course I
could simply add a string type element and search for the Factory by
hand but I would prefer to let spring do this work.
Greetings
Christian
Daniel Kulp schrieb:
Christian,
I don't think it has anything to do with the AbstractBeanDefinitionParser.
It has to do with the schema validation that we turn on by default and
camel doesn't. The schema validation occurs at XML parse time when spring
is constructing the DOM. This is long before any of the spring bean
processing.
The issue is types that aren't strings really don't validate with
properties. For example, a <element name="timeout" type="int"/> won't
validate if it appears as:
<timeout>${cnfigured.timeout}</timeout>
in the xml file as that's not an int.
If you turn off the schema validation, it will probably work for you.
Obviously, you have to make sure the xml is then valid yourself. I think it
would be -Dorg.apache.cxf.spring.validation.mode=VALIDATION_NONE
Dan
--
Christian Schneider
---
http://www.liquid-reality.de
--
Christian Schneider
---
http://www.liquid-reality.de