aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bartosz Kowalewski <kowalewski.bart...@gmail.com>
Subject Re: Eclipse validation error on blueprint xml
Date Sun, 24 Oct 2010 16:58:37 GMT
Jorge, Alasdair,

As far as I remember, property placeholders are in both namespaces
:-). The cm one uses Configuration Admin, while the ext one is
dedicated to working with system properties.

Jorge,

Looking at your example (the way you use specific properties), I think
that what you really need is a single placeholder (instead of two):

       <!-- default values -->
       <cm:property-placeholder
persistent-id="cl.toeska.cc.person.jena" placeholder-prefix="$["
               placeholder-suffix="]">
               <cm:default-properties>
                       <cm:property name="graphName"
value="${virtuoso.graphName}" />
                       <cm:property name="url" value="${virtuoso.url}" />
                       <cm:property name="username"
value="${virtuoso.username}" />
                       <cm:property name="password"
value="${virtuoso.password}" />
               </cm:default-properties>
       </cm:property-placeholder>

I think that you wanted to use custom prefix/suffix for cm property
placeholder and you don't need the ext one at all. As a side effect
this modification should get rid of the error message :-).

The error printed by Eclipse is really weird. It says that
blueprint.xsd is invalid and, what is more, it is only observable when
elements from both ext and cm namespaces are used. It's not really
caused by the cm namespace, if you remove the ext placeholder and
leave the cm one, everything will work.
I took a look at all three schemas and I think that they do not break
the rule which appears in your error message. The error has something
to do with the fact that both ext and cm import the blueprint schema,
but I would say that it looks more like a bug in the validator than a
problem with any of these three schemas.

Oh, you have a spelling mistake in your error message - 'TdependesOn' ;-)

Best regards,
  Bartek

2010/10/24 Alasdair Nottingham <not@apache.org>:
> Hi,
> I'm pretty sure that property-placeholder is in the cm namespace, not the
> ext one.
> Try the following:
>    <cm:property-placeholder placeholder-prefix="$["
>        placeholder-suffix="]" />
>
> Alasdair
> Alasdair
> On 24 Oct 2010, at 01:48, Jorge Riquelme <totex@totex.cl> wrote:
>
> Hi list, i'm new to Aries. I got to this project digging in the code
> of karaf 2.1.0, searching how to provide configuration to mi bundles.
> Everything works fine so far, but i'm getting a validation error in
> eclipse. I added to my XML Catalog the namespaces (and the
> respectively schema):
> - http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
> - http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0
> https://svn.apache.org/repos/asf/incubator/aries/trunk/blueprint/blueprint-cm/src/main/resources/org/apache/aries/blueprint/compendium/cm/blueprint-cm-1.0.0.xsd
> - http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0
> https://svn.apache.org/repos/asf/incubator/aries/tags/blueprint-0.1-incubating/blueprint-core/src/main/resources/org/apache/aries/blueprint/ext/blueprint-ext.xsd
>
> This lets me use autocompletion, validation, etc; not vital but
> useful. The problem is that I'm getting the following errors in
> eclipse:
>
> derivation-ok-restriction.2.1.2: Error for type 'Tinlined-reference'.
> The attribute use 'depends-on' in this type has type 'TdependesOn',
> wich is not validly derived from 'TdependsOn', the type of the
> matching attribute use in the base type. line 413
> derivation-ok-restriction.2.1.2: Error for type
> 'Tinlined-reference-list'. The attribute use 'depends-on' in this type
> has type 'TdependesOn', wich is not validly derived from 'TdependsOn',
> the type of the matching attribute use in the base type. line 469
>
> The blueprint file is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>    xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
>
>    <!-- to avoid conflicts with maven filtering -->
>    <ext:property-placeholder placeholder-prefix="$["
>        placeholder-suffix="]" />
>
>    <!-- default values -->
>    <cm:property-placeholder persistent-id="cl.toeska.cc.person.jena">
>        <cm:default-properties>
>            <cm:property name="graphName" value="${virtuoso.graphName}" />
>            <cm:property name="url" value="${virtuoso.url}" />
>            <cm:property name="username" value="${virtuoso.username}" />
>            <cm:property name="password" value="${virtuoso.password}" />
>        </cm:default-properties>
>    </cm:property-placeholder>
>
>    <bean id="jenaPersonService"
> class="cl.toeska.cc.person.jena.JenaPersonService"
>        init-method="init" destroy-method="destroy">
>        <property name="graphName" value="$[graphName]" />
>        <property name="url" value="$[url]" />
>        <property name="username" value="$[username]" />
>        <property name="password" value="$[password]" />
>    </bean>
>
>    <service ref="jenaPersonService"
> interface="cl.toeska.cc.person.api.PersonService" />
> </blueprint>
>
> The problem is caused by the element cm:property-placeholder; if i
> remove it the errors disappear.
>
>
> Any help or advice will be appreciated.
>
>
> --
> Jorge Riquelme Santana
>

Mime
View raw message