[jboss-jira] [JBoss JIRA] (DROOLS-1297) MemoryUtil should not fail on Google App Engine with NoClassDefFoundError

Geoffrey De Smet (JIRA) issues at jboss.org
Mon Sep 19 03:53:00 EDT 2016


Geoffrey De Smet created DROOLS-1297:
----------------------------------------

             Summary: MemoryUtil should not fail on Google App Engine with NoClassDefFoundError
                 Key: DROOLS-1297
                 URL: https://issues.jboss.org/browse/DROOLS-1297
             Project: Drools
          Issue Type: Enhancement
          Components: core engine
    Affects Versions: 7.0.0.Beta1, 6.5.0.CR1, 6.4.0.Final
            Reporter: Geoffrey De Smet
            Assignee: Mario Fusco


MemoryUtil throws this exception on Google App Engine:

{code}
java.lang.NoClassDefFoundError: Could not initialize class
com.google.apphosting.runtime.security.shared.stub.java.lang.management.ManagementFactory
at org.drools.core.util.MemoryUtil.<clinit>(MemoryUtil.java:33)
{code}

because the PermGen check goes the wrong way on GAE.

In the MemoryUtil code on line 33, we need something like:

{code}
if (... || isGAE()) {
...
}

public boolean isGAE() {
   String p = System.getProperty("com.google.appengine.runtime.environment");
   return p != null && !p.equals("");
}
{code}

On GAE, p is "Development". => act same like isAndroid()
On GCE (= plain old OpenJDK), p is null. => act normally
On plain Fedora with OpenJDK 8, p is null. => act normally




--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list