glassfish
  1. glassfish
  2. GLASSFISH-16750

IllegalArgumentException when JDBC statement leak detection is enabled for an app-scoped JDBC connection pool

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      An app-scoped JDBC connection pool with the following parameters:

      connection-leak-timeout-in-seconds="10"
      statement-leak-timeout-in-seconds="2"
      statement-timeout-in-seconds="6"

      should enable JDBC statement leak detection. But it throws the following error in the console:

      WARNING: RAR8012: Exception while scheduling timer : Timer already cancelled.
      INFO: Recreating Timer and scheduling at fixed rate
      SEVERE: Exception in thread "connector-timer-proxy"
      SEVERE: java.lang.IllegalArgumentException: can't parse argument number PoolInfo : (name=java:app/myConnectionPool)
      at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
      at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
      at java.text.MessageFormat.<init>(MessageFormat.java:350)
      at com.sun.enterprise.util.i18n.StringManagerBase.getStringWithDefault(StringManagerBase.java:206)
      at com.sun.enterprise.resource.pool.ConnectionLeakDetector.printConnectionLeakTrace(ConnectionLeakDetector.java:177)
      at com.sun.enterprise.resource.pool.ConnectionLeakDetector.potentialConnectionLeakFound(ConnectionLeakDetector.java:157)
      at com.sun.enterprise.resource.pool.ConnectionLeakDetector.access$000(ConnectionLeakDetector.java:60)
      at com.sun.enterprise.resource.pool.ConnectionLeakDetector$ConnectionLeakTask.run(ConnectionLeakDetector.java:222)
      at java.util.TimerThread.mainLoop(Timer.java:512)
      at java.util.TimerThread.run(Timer.java:462)

      The same parameters work fine if these parameters are used on the pre-created JDBC connection pool of jdbc/__default.

        Activity

        Hide
        naman_mehta added a comment -

        Assigning to Jagadish for verification and fix the same...

        Show
        naman_mehta added a comment - Assigning to Jagadish for verification and fix the same...
        Hide
        naman_mehta added a comment -

        Attaching test java class for message formatting where string has { } this kind of content...

        Show
        naman_mehta added a comment - Attaching test java class for message formatting where string has { } this kind of content...
        Hide
        Jagadish added a comment -

        Root cause seems to be due to StringManager not able to handle the string that has "

        {" / "}

        " in the text.

        eg: PoolInfo/ResourceInfo's toString will be of the form :

        { PoolInfo : (name=MY_POOL), (applicationName=MY_APP), (moduleName=MY_MODULE)}

        which when used with "LocalStrings.getStringsWithDefault" results in the reported exception.

        There should be a way to escape these characters so that they do not affect LocalStrings functionality.

        Transferring to Naman for comments.
        If there are escape characters that could be used, please transfer the issue to me with a sample.

        Show
        Jagadish added a comment - Root cause seems to be due to StringManager not able to handle the string that has " {" / "} " in the text. eg: PoolInfo/ResourceInfo's toString will be of the form : { PoolInfo : (name=MY_POOL), (applicationName=MY_APP), (moduleName=MY_MODULE)} which when used with "LocalStrings.getStringsWithDefault" results in the reported exception. There should be a way to escape these characters so that they do not affect LocalStrings functionality. Transferring to Naman for comments. If there are escape characters that could be used, please transfer the issue to me with a sample.

          People

          • Assignee:
            Jagadish
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: