0

下面是我的课的样子。

import org.apache.jcs.JCS;
import org.apache.jcs.access.exception.CacheException;
import org.apache.jcs.engine.control.CompositeCacheManager;

private JavaCacheUPKStore(Connection conn) {
    props.put("jcs.default", "");
    props.put("jcs.default.cacheattributes",
                "org.apache.jcs.engine.CompositeCacheAttributes");
    props.put("jcs.default.cacheattributes.MaxObjects",
                maxObjects.toString());
    props.put("jcs.default.cacheattributes.MemoryCacheName",
                "org.apache.jcs.engine.memory.lru.LRUMemoryCache");
    props.put("jcs.default.cacheattributes.UseMemoryShrinker", "false");
    CompositeCacheManager.getUnconfiguredInstance();

}

我的项目中存在 jcs-1.3.jar 并且在执行项目时低于异常。无法初始化类 org.apache.jcs.engine.control.CompositeCacheManager

4

1 回答 1

0
Issue has been resolved after adding JTA dependency         
<dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jcs</groupId>
            <artifactId>jcs</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>concurrent</groupId>
            <artifactId>concurrent</artifactId>
            <version>1.3.4</version>
        </dependency> 
于 2019-12-27T15:45:25.457 回答