Hi,

I have been trying to write the following code to automatically deploy any
changes made to the rules. However i am getting nullpointerexception errors.
I see many posts regarding this topic and have tried different options but
the error won;t go away.

public static void main(String[] args) {
                try {
 FileInputStream file = new
FileInputStream("C:\\Users\\folderabc\\workspace\\Drools
Sample\\bin\\Guvnor.properties");
           Properties p = new Properties();
           p.load(file);
            RuleAgent agent = RuleAgent.newRuleAgent(p); *<-- this is where
it is failing*            RuleBase rb = agent.getRuleBase();
            WorkingMemory ksession = rb.newStatefulSession();
            Car c = new Car("yellow", 2100);
            Driver d = new Driver("Isha", 18, c, "lets try it" );
            ksession.insert(d);
            ksession.fireAllRules();
            //logger.close();
        } catch (Throwable t) {
            t.printStackTrace();
        }
        }

/Here are the errors i am getting on my console:/
java.lang.NullPointerException
        at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:384)
        at org.drools.agent.RuleAgent.configure(RuleAgent.java:368)
        at org.drools.agent.RuleAgent.init(RuleAgent.java:268)
        at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:208)
        at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:168)
        at kijanowski.GuvnorTest.main(GuvnorTest.java:43)

Any help will be greatly appreciated. Thank you



--
View this message in context: 
http://drools.46999.n3.nabble.com/NullPointerException-when-using-RuleAgent-tp4022333.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to