Hi Rajarshi, Only a type can be imported. etc.code.PropertiesCache resolves to a package > > It looks like you've compiled in your class in a wrong way.
But please understand that we don't have the resources to support custom builds of Graylog. Cheers, Jochen On Thursday, 7 April 2016 12:00:14 UTC+2, rajarshi bhattacharjee wrote: > > > Kay, > > Yes i tried with source class file being in classpath , below are the > snippet of the exception i am getting, Am i missing something > > ARN : 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=1, column=0 > text=Error importing : 'etc.code.PropertiesCache'] > Message [id=2, level=ERROR, path=src/main/resources/null, line=17, column=0 > text=Rule Compilation error Only a type can be imported. > etc.code.PropertiesCache resolves to a package] > Message [id=3, level=ERROR, path=src/main/resources/null, line=25, column=0 > text=Rule Compilation error Only a type can be imported. > etc.code.PropertiesCache resolves to a package] > Message [id=4, level=ERROR, path=r1.drl, line=33, column=0 > text=Rule Compilation error Only a type can be imported. > etc.code.PropertiesCache resolves to a package > PropertiesCache cannot be resolved] > Message [id=5, level=ERROR, path=*src/main/resources/null*, line=9, > column=0 > text=Rule Compilation error Only a type can be imported. > etc.code.PropertiesCache resolves to a package] > > Note: I think i am getting the src/main/resources null error as my > propertiescache Class is trying to look for the properties file in resource > stream but i am not sure why am i getting only a type can be imported > error. > > > On Thursday, 7 April 2016 14:40:01 UTC+5:30, rajarshi bhattacharjee wrote: >> >> Hi Kay, >> >> Thanks for your prompt reply. Please correct me if i am wrong , creating >> a standalone jar with a compiled .class and referencing the jar file >> through import should solve it , or i need to add it to graylog build as >> per graylog plugin.I d be more inclined towards a standalone jar approach >> but unsure whether graylog will pick it up. >> >> Regards >> Rajarshi >> >> On Thursday, 7 April 2016 12:28:03 UTC+5:30, Kay Roepke wrote: >>> >>> 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/4a335be1-05d7-4ef5-a2c2-25f99af865e9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
