Hello,

For some configurations, I need to have something that looks like the
following (NB: the real case is more complex, but the next example exhibits
the problem I meet):

<configuration-point id="Menus">
        <schema>
                <element name="item">
                        <attribute name="id"/>
                        <rules>
                                <push-attribute attribute="id"/>
                                <invoke-parent method="addElement"/>
                        </rules>
                </element>
        </schema>
</configuration-point>

Please note that:
- the "id" attribute defines no translator (so passed directly as String)
- the "id attribute is not required

Then in my configuration I put:

<contribution configuration-id="Menus">
        <item id="item-1"/>
        <item/>
</contribution>

>From the schema that I declared the second "item" tag is valid (no id
attribute). However, when I get the configuration and I want to use it, I
have got an exception:

org.apache.hivemind.ApplicationRuntimeException: 
        Unable to construct configuration test.Menus: 
        Error invoking method addElement on
[EMAIL PROTECTED] 
        (at
jar:file:/C:/dev/hivetranse-hm11/build/bugs.test.jar!/META-INF/hivemodule.xm
l, line 10): 
        java.lang.NullPointerException
[jar:file:/C:/dev/hivetranse-hm11/build/bugs.test.jar!/META-INF/hivemodule.x
ml, line 10] 
at
org.apache.hivemind.impl.ConfigurationPointImpl.processContributionElements(
ConfigurationPointImpl.java:273) 
at
org.apache.hivemind.impl.ConfigurationPointImpl.constructElements(Configurat
ionPointImpl.java:189) 
at
org.apache.hivemind.impl.ElementsInnerProxyList.inner(ElementsInnerProxyList
.java:46) 
at
org.apache.hivemind.impl.ElementsInnerProxyList.size(ElementsInnerProxyList.
java:62) 
at
org.apache.hivemind.impl.ElementsProxyList.size(ElementsProxyList.java:60) 
at
test.MenuContributionTest.testMenuContribution(MenuContributionTest.java:25)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
) 
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

Caused by: org.apache.hivemind.ApplicationRuntimeException: 
        Error invoking method addElement on
[EMAIL PROTECTED] 
        (at
jar:file:/C:/dev/hivetranse-hm11/build/bugs.test.jar!/META-INF/hivemodule.xm
l, line 10): 
        java.lang.NullPointerException
[jar:file:/C:/dev/hivetranse-hm11/build/bugs.test.jar!/META-INF/hivemodule.x
ml, line 10] 
at
org.apache.hivemind.schema.rules.InvokeParentRule.begin(InvokeParentRule.jav
a:63) 
at org.apache.hivemind.impl.SchemaElement.fireBegin(SchemaElement.java:228) 
at
org.apache.hivemind.impl.SchemaProcessorImpl.processElement(SchemaProcessorI
mpl.java:255) 
at
org.apache.hivemind.impl.SchemaProcessorImpl.processRootElement(SchemaProces
sorImpl.java:235) 
at
org.apache.hivemind.impl.SchemaProcessorImpl.process(SchemaProcessorImpl.jav
a:223) 
at
org.apache.hivemind.impl.ConfigurationPointImpl.processContributionElements(
ConfigurationPointImpl.java:268) 
... 20 more

Caused by: java.lang.NullPointerException 
at
org.apache.hivemind.schema.rules.InvokeParentRule.begin(InvokeParentRule.jav
a:57) 
... 25 more

Actually, I would have expected to get a List of 2 Strings, the first being
"item-1", the second being null.

Is my assumption founded (ie, can I consider this to be a HiveMind problem)
or should I consider a different way to handle this situation (Note that I
have another way already but I am not very pleased with it: I had to write a
class wrapping a String to make this work).

Thanks for any answer/comment.
Cheers

        Jean-Francois



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to