Graylog2-server: Unable to build KieBaseModel:defaultKieBase (Java 9 issue)

Created on 3 Jun 2017  路  12Comments  路  Source: Graylog2/graylog2-server

When starting graylog-server, I get this:

2017-06-02T23:42:53.034Z INFO  [ProcessBuffer] Initialized ProcessBuffer with ring size <65536> and wait strategy <BlockingWaitStrategy>.                                                                                                          
2017-06-02T23:42:54.043Z ERROR [AbstractKieModule] Unable to build KieBaseModel:defaultKieBase                                                                                                                                                     
Rule Compilation error : [Rule name='blacklist any field equality']                                                                                                                                                                                
        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (1:0) : The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files                                                           
        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (1:0) : The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files                                                        
        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (1:0) : The type java.io.Serializable cannot be resolved. It is indirectly referenced from required .class files                                                       
        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (1:0) : The type java.lang.Class cannot be resolved. It is indirectly referenced from required .class files                                                            
        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (3:212) : Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor                                                        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (6:469) : java.lang.Exception cannot be resolved to a type                                                                                                             
        org/graylog2/rules/Rule_blacklist_any_field_equality1425306609.java (7:583) : The method update(FactHandle, BitMask, Class<?>) from the type KnowledgeHelper refers to the missing type Class                                              

Rule Compilation error : [Rule name='blacklist any field pattern']                                                                                                                                                                                 
        org/graylog2/rules/Rule_blacklist_any_field_pattern1051638701.java (3:212) : Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor                                                 
        org/graylog2/rules/Rule_blacklist_any_field_pattern1051638701.java (6:468) : java.lang.Exception cannot be resolved to a type                                                                                                              
        org/graylog2/rules/Rule_blacklist_any_field_pattern1051638701.java (7:582) : The method update(FactHandle, BitMask, Class<?>) from the type KnowledgeHelper refers to the missing type Class                                               

Rule Compilation error : [Rule name='blacklist hostname inet mask']                                                                                                                                                                                
        org/graylog2/rules/Rule_blacklist_hostname_inet_mask1051638701.java (3:212) : Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor                                                
        org/graylog2/rules/Rule_blacklist_hostname_inet_mask1051638701.java (6:469) : java.lang.Exception cannot be resolved to a type                                                                                                                     org/graylog2/rules/Rule_blacklist_hostname_inet_mask1051638701.java (7:583) : The method update(FactHandle, BitMask, Class<?>) from the type KnowledgeHelper refers to the missing type Class                                              

                                                                                                                                                                                                                                                   2017-06-02T23:42:54.044Z WARN  [DroolsEngine] Unable to add rules due to compilation errors.                                                                                                                                                       
org.graylog2.rules.RulesCompilationException: Message [id=1, kieBase=defaultKieBase, level=ERROR, path=src/main/resources/null, line=9, column=0                                                                                                   
   text=Rule Compilation error The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files                                                                                                                
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files                                                                                                                                            
The type java.io.Serializable cannot be resolved. It is indirectly referenced from required .class files                                                                                                                                           
The type java.lang.Class cannot be resolved. It is indirectly referenced from required .class files                                                                                                                                                
Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor                                                                                                                                      
java.lang.Exception cannot be resolved to a type                                                                                                                                                                                                   
The method update(FactHandle, BitMask, Class<?>) from the type KnowledgeHelper refers to the missing type Class]                                                                                                                                   
Message [id=2, kieBase=defaultKieBase, level=ERROR, path=src/main/resources/null, line=17, column=0                                                                                                                                                
   text=Rule Compilation error Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor                                                                                                       
java.lang.Exception cannot be resolved to a type                                                                                                                                                                                                   
The method update(FactHandle, BitMask, Class<?>) from the type KnowledgeHelper refers to the missing type Class]                                                                                                                                   
Message [id=3, kieBase=defaultKieBase, level=ERROR, path=src/main/resources/null, line=25, column=0                                                                                                                                                
   text=Rule Compilation error Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor                                                                                                       
java.lang.Exception cannot be resolved to a type                                                                                                                                                                                                   
The method update(FactHandle, BitMask, Class<?>) from the type KnowledgeHelper refers to the missing type Class]                                                                                                                                   

        at org.graylog2.rules.DroolsEngine.createKJar(DroolsEngine.java:232) ~[graylog.jar:?]                                                                                                                                                      
        at org.graylog2.rules.DroolsEngine.createAndDeployJar(DroolsEngine.java:194) ~[graylog.jar:?]                                                                                                                                              
        at org.graylog2.rules.DroolsEngine.deployRules(DroolsEngine.java:169) [graylog.jar:?]                                                                                                                                                      
        at org.graylog2.rules.DroolsEngine.commitRules(DroolsEngine.java:147) [graylog.jar:?]                                                                                                                                                      
        at org.graylog2.rules.DroolsEngine.<init>(DroolsEngine.java:71) [graylog.jar:?]                                                                                                                                                            
  • Graylog Version: 2.3-alpha.2, 2.3-alpha.3
  • Elasticsearch Version: 5.3
  • MongoDB Version:
  • Operating System: Ubuntu 16.10
bug java9 triaged

All 12 comments

Just figured out that this only happens with Java 9 (which was accidentally installed on this box) but works with Java 8. Not sure if we want to immediately fix this as part of the v2.3 release then.

@lennartkoopmann Since it's unclear when Java 9 will be released and it's also unclear if there are other problems running Graylog with it, I will move this out of the 2.3.0 milestone.

Java 9 is GA since yesterday. Time to recheck for compatibility issues.

For the time being Java 9 is not a supported runtime for Graylog (nor is it for Elasticsearch/Lucene btw: https://www.elastic.co/support/matrix#matrix_jvm)

We recommend staying on Java 8 until further notice.

Please note that this problem is caused by a dependency, which does not have their bug fixed yet: https://issues.jboss.org/browse/DROOLS-1169

Maybe this should be added to the documentation. Currently the system requirements state

Oracle Java SE 8 or later

Now with GA of Java 9 we have reached "later". The Drools issue is interesting. It mentions a workaround -Ddrools.dialect.java.compiler=NATIVE
Would this work with Graylog?

It mentions a workaround -Ddrools.dialect.java.compiler=NATIVE
Would this work with Graylog?

@mayrstefan Try it out and report back. 馃槂

Let's say things are different with the latest Java release:

I used graylog-2.3.1-3.ova with different Java releases extracted to /opt/graylog

  • Oracle Server JRE (which I usually prefer for running applications)
  • Oracle JDK
  • OpenJDK

root@graylog:/opt/graylog# oracle-sjre-9/bin/java -version java version "9" Java(TM) SE Runtime Environment (build 9+181) Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode) root@graylog:/opt/graylog# oracle-jdk-9/bin/java -version java version "9" Java(TM) SE Runtime Environment (build 9+181) Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode) root@graylog:/opt/graylog# openjdk-9/bin/java -version openjdk version "9" OpenJDK Runtime Environment (build 9+181) OpenJDK 64-Bit Server VM (build 9+181, mixed mode)

Then I modified /opt/graylog/sv/graylog-server/run to avoid effects on other components. I changed JAVA_HOME and GRAYLOG_SERVER_JAVA_OPTS in multiple iterations.

Findings to get graylog up running again with Java 9:

  • we require "--add-modules java.corba,java.xml.bind " to avoid "java.lang.ClassNotFoundException: org.omg.CORBA.portable.IDLEntity" and "java.lang.ClassNotFoundException: javax.xml.bind.JAXBException"
  • Server JRE is missing java.corba module. So we definitly require a JDK to run Graylog server

I did never get the "Unable to build KieBaseModel:defaultKieBase" error during startup. Is a special action necessary to trigger this error?

Other warnings and errors that might be worth separate issues:

2017-09-22_22:19:45.47625 Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. 2017-09-22_22:19:45.48114 Java HotSpot(TM) 64-Bit Server VM warning: Option UseParNewGC was deprecated in version 9.0 and will likely be removed in a future release.

can be "fixed" be removing "... -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC ..."

2017-09-22_22:53:07.84433 WARNING: An illegal reflective access operation has occurred 2017-09-22_22:53:07.84502 WARNING: Illegal reflective access by com.google.inject.assistedinject.FactoryProvider2$MethodHandleWrapper (file:/opt/graylog/server/graylog.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int) 2017-09-22_22:53:07.84603 WARNING: Please consider reporting this to the maintainers of com.google.inject.assistedinject.FactoryProvider2$MethodHandleWrapper 2017-09-22_22:53:07.84830 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations 2017-09-22_22:53:07.84919 WARNING: All illegal access operations will be denied in a future release

Guess this needs an update of Google Guice. Maybe https://github.com/google/guice/issues/1085 is related.

2017-09-22_22:44:49.28667 ERROR [AnyExceptionClassMapper] Unhandled exception in REST resource 2017-09-22_22:44:49.28735 java.lang.IllegalArgumentException: Multiple entries with same key: nn-NO=LocaleDescription{languageTag=nn-NO, displayName=Norwegian Nynorsk (Norway)} and nn-NO=LocaleDescription{languageTag=nn-NO, displayName=Norwegian (Norway,Nynorsk)}

This error does not appear when using the embedded JDK. But from the message I would guess the error is already in the data and JDK9 is just more strict than JDK8.

But none of the last three message do break the graylog startup.

Today I also tested with the regular Oracle JRE; this works with the same modifications like for the JDK. The missing java.corba module seems to be an issue specific to the Server JRE. The module is present in the regular JRE. So you currently need to have a JDK or JRE but NOT the Server JRE.

For the missing corba module in the Oracle Server JRE I opened a bug report at Oracle. There I got an non-working link for the report but I found the issue in the OpenJDK bugtracker JDK-8187914. Removing this module was intentional and looks like this won't be fixed in the Server JRE.

Searching for a reason I guess this might be because starting with Java 9 the Corba module is deprecated and marked for removal.

Another notice: switching to G1 garbage collection triggers regular "Nodes with too long GC pauses" messages. This message did not appear when using the Graylog defaults (Oracle Java 8 U152, ~15,000 messages/min, peaks at ~80,000 messages/min)

Guice 4.2 supports java9 now: https://github.com/google/guice/issues/1085#issuecomment-369394009

Closing this because drools support got removed from the upcoming Graylog 3.0 release.

Was this page helpful?
0 / 5 - 0 ratings