Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-338

GenericObjectPool constructor may throw an exception under OSGi

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.2, 2.4.3, 2.5.0
    • Fix Version/s: 2.6.0
    • Labels:
      None
    • Environment:

      Java 8, Liferay DXP (an OSGi environment).

      Description

      Version 2.4.3 GenericObjectPool constructor throws this exception:

      java.lang.IllegalArgumentException: [org.apache.commons.pool2.impl.DefaultEvictionPolicy] does not implement EvictionPolicy
          at org.apache.commons.pool2.impl.BaseGenericObjectPool.setEvictionPolicyClassName(BaseGenericObjectPool.java:618)
          at org.apache.commons.pool2.impl.GenericObjectPool.setConfig(GenericObjectPool.java:318)
          at org.apache.commons.pool2.impl.GenericObjectPool.<init>(GenericObjectPool.java:115)
          at org.apache.commons.pool2.impl.GenericObjectPool.<init>(GenericObjectPool.java:88)

       

      Version 2.5.0 throws the same exception. Version 2.4.2 or older's setEvictionPolicyClassName method fail silently for the same reason. This line in BaseGenericObjectPool evaluates to false for all versions:

              if (policy instanceof EvictionPolicy<?>) {

       

        Attachments

        1. commons-pool-gg.patch
          20 kB
          Gary D. Gregory
        2. commons-pool-mc.patch
          20 kB
          Michael C
        3. commons-pool-2.5.1.patch
          5 kB
          Michael C
        4. commons-pool-2.6.0.patch
          4 kB
          Michael C

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              mcgitty Michael C
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: