CXF
  1. CXF
  2. CXF-4294

Exception Cache ws-security.timestamp.cache.instance already exists or Cache ws-security.nonce.cache.instance already exists

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.4.8, 2.5.4, 2.6.1
    • Component/s: WS-* Components
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      We have upgraded to CXF 2.6.0 and services started fine but getting following exceptions when first client calls are coming

      Exception Cache ws-security.timestamp.cache.instance already exists OR
      Cache ws-security.nonce.cache.instance already exists

      Our project has multiple webservice endpoints/services in a single JVM and all of the endpoints may get a client SOAP call at the same time. We have WS Security timestamp, signature and encryption enabled. This exception is coming when all the client calls are coming almost at the same time but if the client calls are sparse over time then everything runs fine. But when the exception occurs that particular client received no data or exception.

      In our analysis, we found that CXF 2.6.0 is trying to add cache instance for nonce and timestamp through net.sf.ehcache.CacheManager: addCache (final Ehcache cache) API call. I am not sure if this cache instance addition happens for all the SOAP calls or once per endpoint but net.sf.ehcache.CacheManager: addCache (final Ehcache cache) has a strict check, if it is already there (may have been created already by another webservice endpoint in the same JVM) it throws an exception.

      It appears that CXF should use net.sf.ehcache.CacheManager: addCacheIfAbsent(final Ehcache cache) instead of net.sf.ehcache.CacheManager: addCache (final Ehcache cache). addCacheIfAbsent(...) does not throw exception if the cache instance is already present.

      Currently we have made following changes to avoid the exceptions

      <jaxws:endpoint id="....">
      ...
      <jaxws:properties>
      ...
      <entry key="ws-security.enable.nonce.cache" value="false" />
      <entry key="ws-security.enable.timestamp.cache" value="false" />
      </jaxws:properties>
      </jaxws:endpoint>

      Please let us know, if this is a bug or are there any other solution such that we do not have to disable nonce and timestamp cache of our own.

        Activity

        Daniel Kulp made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Colm O hEigeartaigh made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Colm O Heigeartaigh <coheigea@apache.org> committed bf155707f04c76e0f051f6d4d44d1bbe6d391b4d (2 files)
        Colm O hEigeartaigh made changes -
        Field Original Value New Value
        Assignee Colm O hEigeartaigh [ coheigea ]
        Fix Version/s 2.6.1 [ 12320746 ]
        Fix Version/s 2.5.4 [ 12320747 ]
        Fix Version/s 2.4.8 [ 12320748 ]
        Debdayal Mandal created issue -

          People

          • Assignee:
            Colm O hEigeartaigh
            Reporter:
            Debdayal Mandal
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development