Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1297

MemoryUtil should not fail on Google App Engine with NoClassDefFoundError

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.Beta2
    • 6.4.0.Final, 6.5.0.CR1, 7.0.0.Beta1
    • core engine
    • None
    • NEW
    • NEW

      MemoryUtil throws this exception on Google App Engine:

      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)
      

      because the PermGen check goes the wrong way on GAE.

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

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

      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

            mfusco@redhat.com Mario Fusco
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: