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

Mario Fusco (JIRA) issues at jboss.org
Mon Sep 19 08:10:00 EDT 2016


Mario Fusco created DROOLS-1298:
-----------------------------------

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


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