Hi All,
I'm using drools-spring and my bean is like this:

<bean id="outerPojosRuleSet" lazy-init="false" parent="abstractRuleSet">
        <property name="rules">
            <set>
                <bean id="drools.Hello"
                    parent="messagePrintingBean" class="drools.HelloRule" />
           </set>
        </property>
 </bean>
I need to replace the set with other set. So I populated "OverrideConfigrer"
as follows :
             Set<Object> setRules = new HashSet<Object>();

               rb = new RuleBean();
        SecondRule ss = new SecondRule();
        rb.setPojo(ss);
        rb.setBeanName("ABC");
        setRules.add(rb);

Then I put this set as beans's property.
             Properties pp = new Properties();
        pp.put("outerPojosRuleSet.rules", setRules);
        PropertyOverrideConfigurer poc = new PropertyOverrideConfigurer();
        poc.setProperties( pp );

        context.addBeanFactoryPostProcessor( poc );
        context.refresh();

I get NullPointerException on  "context.refresh" as follows :
Exception in thread "main" java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:396)
    at java.util.Properties.setProperty(Properties.java:128)
    at
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory
(PropertyResourceConfigurer.java:146)
    at
org.springframework.context.support.AbstractApplicationContext.refresh(
AbstractApplicationContext.java:288)
    at drools.RuleAdder2.main(RuleAdder2.java:59)

The "Properties" class extends from "HashTable" . The "put" method of the
Hashtable accepts key , value both as objects.

What is the thing I missed out? Any help is welcome.

--
Thanks & Regards,
Anagha

Reply via email to