We are replacing EHCACHE with JCS 3.2 cache. We are seeing the below mentioned error while trying to create a cache object using the below code. The sample configuration from cache.ccf file is also shared here.
The error comes when the weblogic server is started. The error is seen even for the region which is mentioned in the config file. Second time execution of the same stmt (i,e JCS.getInstance(“”) doesn’t throw any error.
Observations:
a) Precisely, the error is seen only for the first time.
b) Error happens only when LTCP is enabled (jcs.default=LTCP)
c) Based on the error stack, I believe it’s something to-do with “TcpListenerPort=1110” attribute mentioned at the end.
If anybody has implemented JCS cache, please see if you can throw some light here.
Properties props = new Properties();
props.load(new FileInputStream("/config/cache.ccf"));
JCS.setConfigProperties(props);
CacheAccess<String, Object> cache= JCS.getInstance("default")
<May 3, 2024 10:46:11,140 AM UTC> <Warning> <org.apache.commons.jcs3.engine.control.CompositeCacheManager> <BEA-000000> <Shutdown observer added twice org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.LateralTCPListener@4cb96610>
<May 3, 2024 10:46:11,152 AM UTC> <Error> <org.apache.commons.jcs3.engine.control.CompositeCacheConfigurator> <BEA-000000> <Could not instantiate auxiliary cache named "default"
java.lang.NullPointerException
at org.apache.commons.jcs3.utils.discovery.UDPDiscoveryService.<init>(UDPDiscoveryService.java:144)
at org.apache.commons.jcs3.utils.discovery.UDPDiscoveryManager.lambda$getService$0(UDPDiscoveryManager.java:118)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.commons.jcs3.utils.discovery.UDPDiscoveryManager.getService(UDPDiscoveryManager.java:108)
at org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory.createDiscoveryService(LateralTCPCacheFactory.java:435)
at org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory.createCache(LateralTCPCacheFactory.java:125)
at org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory.createCache(LateralTCPCacheFactory.java:56)
at org.apache.commons.jcs3.engine.control.CompositeCacheConfigurator.parseAuxiliary(CompositeCacheConfigurator.java:456)
at org.apache.commons.jcs3.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:240)
at org.apache.commons.jcs3.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:177)
at org.apache.commons.jcs3.engine.control.CompositeCacheManager.lambda$getCache$2(CompositeCacheManager.java:553)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.commons.jcs3.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:550)
at org.apache.commons.jcs3.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:504)
at org.apache.commons.jcs3.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:491)
at org.apache.commons.jcs3.JCS.getInstance(JCS.java:144)
at oracle.iam.platform.utils.cache.JCSCacheProvider.initialize(JCSCacheProvider.java:223)
Tried changing the port number for TcpListenerPort but it didn’t help
Babu Lakshamanaiah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.