Hi! It looks like you put the Java source file onto the classpath, which doesn't work. You need to compile it as part of your build (possibly as a graylog plugin, or manually and then adding it to the classpath). The resulting file name ends with .class, not .java.
The imports look good to me, but the error message and the classpath you posted indicate that this is the problem. Best regards, Kay On Thursday, 7 April 2016 08:10:12 UTC+2, rajarshi bhattacharjee wrote: > > > > On Wednesday, 6 April 2016 15:20:32 UTC+5:30, rajarshi bhattacharjee wrote: >> >> I am actually new to graylog and frankly not quite aware of how graylog >> is triggering the drools rule engine so it might be a very simple question >> with an obvious solution which is somehow escaping me . >> >> >> I am trying to improve an already existing (drl code) by invoking >> another java class , which is residing within a different directory as >> compared to my drl file. Understood that graylog doesnt allow adding other >> packages definitions( >> https://github.com/Graylog2/graylog2-server/issues/1213) , so tried with >> a direct import by putting the java class in a different directory, but >> when i try to invoke this java class my drl fails with the following >> exception `Rule Compilation error : [Rule name='BPTM logs filter'] >> org/graylog2/rules/Rule_BPTM_logs_filter508671689.java (42:2371) : >> *PropertiesCache >> cannot be resolved* >> >> 2016-04-06 09:11:09,601 WARN : org.graylog2.rules.DroolsEngine - Unable >> to add rules due to compilation errors. >> org.graylog2.rules.RulesCompilationException: Message [id=1, level=ERROR, >> path=r1.drl, line=30, column=0 >> text=Rule Compilation error PropertiesCache cannot be resolved] >> >> Note :PropertiesCache is my java class and my drl file exists in >> different directories. Pretty much its not able to resolve the import and >> fails with compilation error >> >> Any insights would be valuable , >> > > Attached DRL file , along with PropertiesCache.java file (external class i > am trying to invoke) > > Please advice , i am not sure whether this error is due to > environment/drools/or graylog restrictions as i m new to both drools and > graylog and just trying to improve this code from java perspective > -- You received this message because you are subscribed to the Google Groups "Graylog Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/graylog2/49e29917-78af-40b5-9b4a-376228a665b2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
