1

最初,位于 172.25.22.122:1101 的 JCS 服务器未运行。

JCS 客户端应用程序检测到这一点并在 172.25.22.121:1101 处绑定到 JCS

在尝试从缓存中获取值时,客户端应用程序获取:

 159687 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:38 | 160717 [ActiveMQ Session Task-2] ERROR org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Could not find server
2020/06/29 14:24:38 | java.io.IOException: Problem finding server at [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]

所以 JCS 正在尝试连接到主 JCS 服务器并发现它不可用。

然后我似乎 JCS 尝试连接到故障转移服务器 (172.25.22.121:1101)。但是,从调用 JCS 返回的值为 null(不应该是 - 172.25.22.121:1101 处的缓存肯定有请求的值)

2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.121:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Server found: Proxy[IRemoteCacheServer,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[172.25.22.121:50045](remote),objID:[11136de8:172f060aa2e:-7fff, -4182157312969196245]]]]]
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - Parsed regions [jdx]
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Finished configuration in 1092 ms.
2020/06/29 14:24:38 | com.wtg.jurisdictions.Jurisdictions <init> Got JCS instance on 1st attempt...
2020/06/29 14:24:38 | java.lang.NullPointerException
2020/06/29 14:24:38 |   at com.wtg.model.Parcel.setFipsState(Parcel.java:441)       
                        ......

客户端配置和执行

2020/06/29 14:24:37 | Starting local Jurisdiction cache with properties...
2020/06/29 14:24:37 | com.wtg.jurisdictions.Jurisdictions <init> jcs.auxiliary.RC.attributes=org.apache.commons.jcs.auxiliary.remote.RemoteCacheAttributes
2020/06/29 14:24:37 | jcs.auxiliary.RC=org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory
2020/06/29 14:24:37 | jcs.region.jdx.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
2020/06/29 14:24:37 | jcs.auxiliary.RC.attributes.RmiSocketFactoryTimeoutMillis=5000
2020/06/29 14:24:37 | jcs.auxiliary.RC.attributes.GetOnly=false
2020/06/29 14:24:37 | jcs.region.jdx.cacheattributes.MaxObjects=10000
2020/06/29 14:24:37 | jcs.auxiliary.RC.attributes.Receive=false
2020/06/29 14:24:37 | jcs.region.jdx.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
2020/06/29 14:24:37 | jcs.region.jdx=RC
2020/06/29 14:24:37 | jcs.auxiliary.RC.attributes.RemoveUponRemotePut=false
2020/06/29 14:24:37 | jcs.auxiliary.RC.attributes.FailoverServers=172.25.22.122:1101,172.25.22.121:1101
2020/06/29 14:24:37 | 
2020/06/29 14:24:37 | com.wtg.jurisdictions.Jurisdictions <init> Jurisdictions CacheAccess (JCS) initialized
2020/06/29 14:24:37 | com.wtg.jurisdictions.Jurisdictions <init> Bound to JCS @ 172.25.22.121
2020/06/29 14:24:37 | 159640 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Instance is null, returning unconfigured instance
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.utils.threadpool.ThreadPoolManager  - thread_pool.default PoolConfiguration = useBoundary = [false] boundarySize = [2000] maximumPoolSize = [150] minimumPoolSize = [4] keepAliveTime = [300000] whenBlockedPolicy = [RUN] startUpSize = [4]
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Setting default auxiliaries to null
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - No special CompositeCacheAttributes class defined for key [jcs.default.cacheattributes], using default class.
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - setting defaultCompositeCacheAttributes to [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 100, maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ]
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - No special ElementAttribute class defined for key [jcs.default.elementattributes], using default class.
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL = true, IS_REMOTE = true, IS_ETERNAL = true, MaxLifeSeconds = -1, IdleTime = -1, CreateTime = 1593455077548, LastAccessTime = 1593455077548, getTimeToLiveSeconds() = -1, createTime = 1593455077548 ]
2020/06/29 14:24:37 | 159656 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - No special ElementAttribute class defined for key [jcs.region.jdx.elementattributes], using default class.
2020/06/29 14:24:37 | 159672 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.memory.AbstractDoubleLinkedListMemoryCache  - initialized MemoryCache for jdx
2020/06/29 14:24:37 | 159672 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCache  - Constructed cache with name [jdx] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 10000, maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ]
2020/06/29 14:24:37 | 159687 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.AuxiliaryCacheConfigurator  - No cache event logger defined for auxiliary [jcs.auxiliary.RC]
2020/06/29 14:24:37 | 159687 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.AuxiliaryCacheConfigurator  - Using standard serializer [org.apache.commons.jcs.utils.serialization.StandardSerializer@7eb6b5b2] for auxiliary [jcs.auxiliary.RC]
2020/06/29 14:24:37 | 159687 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:38 | 160717 [ActiveMQ Session Task-2] ERROR org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Could not find server
2020/06/29 14:24:38 | java.io.IOException: Problem finding server at [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:38 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager.lookupRemoteService(RemoteCacheManager.java:160)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager.<init>(RemoteCacheManager.java:115)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory.getManager(RemoteCacheFactory.java:214)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheFactory.createCache(RemoteCacheFactory.java:116)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseAuxiliary(CompositeCacheConfigurator.java:500)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:261)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:161)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheConfigurator.parseRegions(CompositeCacheConfigurator.java:136)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheManager.doConfigure(CompositeCacheManager.java:490)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:441)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:391)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:373)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.JCS.getCacheManager(JCS.java:163)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.JCS.getInstance(JCS.java:190)
2020/06/29 14:24:38 |   at com.wtg.jurisdictions.Jurisdictions.<init>(Jurisdictions.java:143)
2020/06/29 14:24:38 |   at com.wtg.jurisdictions.Jurisdictions.getInstance(Jurisdictions.java:203)
2020/06/29 14:24:38 |   at com.wtg.model.PropertyIdentifier.setStateFIPS(PropertyIdentifier.java:303)
2020/06/29 14:24:38 |   at com.jcsoft.eComm.model.OrderDA.parsePropertyIdentifier(OrderDA.java:1689)
2020/06/29 14:24:38 |   at com.jcsoft.eComm.model.OrderDA.parseItem(OrderDA.java:2011)
2020/06/29 14:24:38 |   at com.jcsoft.eComm.model.OrderDA.getItems(OrderDA.java:1916)
2020/06/29 14:24:38 |   at com.jcsoft.eComm.model.OrderDA.getOrder(OrderDA.java:3047)
2020/06/29 14:24:38 |   at com.jcsoft.eComm.model.OrderDA.getOrder(OrderDA.java:2975)
2020/06/29 14:24:38 |   at com.wtg.mq.listeners.FulfillmentListener.getOrder(FulfillmentListener.java:406)
2020/06/29 14:24:38 |   at com.wtg.mq.listeners.FulfillmentListener.onMessage(FulfillmentListener.java:119)
2020/06/29 14:24:38 |   at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1393)
2020/06/29 14:24:38 |   at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
2020/06/29 14:24:38 |   at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
2020/06/29 14:24:38 |   at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133)
2020/06/29 14:24:38 |   at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)
2020/06/29 14:24:38 |   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2020/06/29 14:24:38 |   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2020/06/29 14:24:38 |   at java.lang.Thread.run(Thread.java:745)
2020/06/29 14:24:38 | Caused by: java.rmi.ConnectException: Connection refused to host: 172.25.22.122; nested exception is: 
2020/06/29 14:24:38 |   java.net.ConnectException: Connection refused: connect
2020/06/29 14:24:38 |   at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
2020/06/29 14:24:38 |   at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
2020/06/29 14:24:38 |   at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
2020/06/29 14:24:38 |   at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
2020/06/29 14:24:38 |   at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
2020/06/29 14:24:38 |   at java.rmi.Naming.lookup(Naming.java:101)
2020/06/29 14:24:38 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager.lookupRemoteService(RemoteCacheManager.java:139)
2020/06/29 14:24:38 |   ... 31 more
2020/06/29 14:24:38 | Caused by: java.net.ConnectException: Connection refused: connect
2020/06/29 14:24:38 |   at java.net.DualStackPlainSocketImpl.connect0(Native Method)
2020/06/29 14:24:38 |   at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
2020/06/29 14:24:38 |   at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
2020/06/29 14:24:38 |   at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
2020/06/29 14:24:38 |   at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
2020/06/29 14:24:38 |   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
2020/06/29 14:24:38 |   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2020/06/29 14:24:38 |   at java.net.Socket.connect(Socket.java:589)
2020/06/29 14:24:38 |   at java.net.Socket.connect(Socket.java:538)
2020/06/29 14:24:38 |   at java.net.Socket.<init>(Socket.java:434)
2020/06/29 14:24:38 |   at java.net.Socket.<init>(Socket.java:211)
2020/06/29 14:24:38 |   at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
2020/06/29 14:24:38 |   at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
2020/06/29 14:24:38 |   at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
2020/06/29 14:24:38 |   ... 37 more
2020/06/29 14:24:38 | 160717 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:38 | 160732 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - The remote cache is configured to NOT receive events from the remote server.  We will NOT register a listener.
2020/06/29 14:24:38 | 160732 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteUtils  - RmiSocketFactoryTimeoutMillis [5000].  Configuring a custom socket factory.
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.CacheEventQueue  - Destroy was called after queue was destroyed. Doing nothing. Stats =  Cache Event Queue
2020/06/29 14:24:38 | Working = true
2020/06/29 14:24:38 | Alive = false
2020/06/29 14:24:38 | Empty = true
2020/06/29 14:24:38 | Size = 0
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.121:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Server found: Proxy[IRemoteCacheServer,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[172.25.22.121:50045](remote),objID:[11136de8:172f060aa2e:-7fff, -4182157312969196245]]]]]
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - Parsed regions [jdx]
2020/06/29 14:24:38 | 160748 [ActiveMQ Session Task-2] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Finished configuration in 1092 ms.
2020/06/29 14:24:38 | com.wtg.jurisdictions.Jurisdictions <init> Got JCS instance on 1st attempt...
2020/06/29 14:24:38 | java.lang.NullPointerException
2020/06/29 14:24:38 |   at com.wtg.model.Parcel.setFipsState(Parcel.java:441)       
                        ......

2020/06/29 14:24:39 | 161840 [JCS-RemoteCacheMonitor] ERROR org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Could not find server
2020/06/29 14:24:39 | java.io.IOException: Problem finding server at [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 14:24:39 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager.lookupRemoteService(RemoteCacheManager.java:160)
2020/06/29 14:24:39 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager.canFixCaches(RemoteCacheManager.java:396)
2020/06/29 14:24:39 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheMonitor.doWork(RemoteCacheMonitor.java:90)
2020/06/29 14:24:39 |   at org.apache.commons.jcs.auxiliary.AbstractAuxiliaryCacheMonitor.run(AbstractAuxiliaryCacheMonitor.java:186)
2020/06/29 14:24:39 | Caused by: java.rmi.ConnectException: Connection refused to host: 172.25.22.122; nested exception is: 
2020/06/29 14:24:39 |   java.net.ConnectException: Connection refused: connect
2020/06/29 14:24:39 |   at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
2020/06/29 14:24:39 |   at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
2020/06/29 14:24:39 |   at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
2020/06/29 14:24:39 |   at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
2020/06/29 14:24:39 |   at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
2020/06/29 14:24:39 |   at java.rmi.Naming.lookup(Naming.java:101)
2020/06/29 14:24:39 |   at org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager.lookupRemoteService(RemoteCacheManager.java:139)
2020/06/29 14:24:39 |   ... 3 more
2020/06/29 14:24:39 | Caused by: java.net.ConnectException: Connection refused: connect
2020/06/29 14:24:39 |   at java.net.DualStackPlainSocketImpl.connect0(Native Method)
2020/06/29 14:24:39 |   at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
2020/06/29 14:24:39 |   at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
2020/06/29 14:24:39 |   at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
2020/06/29 14:24:39 |   at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
2020/06/29 14:24:39 |   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
2020/06/29 14:24:39 |   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2020/06/29 14:24:39 |   at java.net.Socket.connect(Socket.java:589)
2020/06/29 14:24:39 |   at java.net.Socket.connect(Socket.java:538)
2020/06/29 14:24:39 |   at java.net.Socket.<init>(Socket.java:434)
2020/06/29 14:24:39 |   at java.net.Socket.<init>(Socket.java:211)
2020/06/29 14:24:39 |   at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
2020/06/29 14:24:39 |   at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
2020/06/29 14:24:39 |   at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
2020/06/29 14:24:39 |   ... 9 more

服务器缓存.ccf

jcs.region.jdx=DC
jcs.region.jdx.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.region.jdx.cacheattributes.MaxObjects=100000
jcs.region.jdx.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache

jcs.auxiliary.DC=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=/wtg_ecomm_work/jcs_server

# Registry 用于注册和提供 IRemoteCacheService 服务。
# 将在运行时由 CacheLoader 设置
#registry.host=localhost
#registry.port=1101

# 回调端口到本地缓存。
# 将在运行时由 CacheLoader 设置
#remote.cache.service.port=1101

# rmi 套接字工厂超时
remote.cache.rmiSocketFactoryTimeoutMillis=5000

#集群设置
remote.cluster.LocalClusterConsistency=true
remote.cluster.AllowClusterGet=true

随后我启动​​了 JC​​S 服务器(导致客户端找到两台服务器):

172.25.22.122 启动

1779 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.remote.server.RemoteCacheServerFactory  - ConfigFileName = [/cache.ccf]
1794 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.remote.server.RemoteCacheServerFactory  - Creating server with these attributes: 
 RemoteCacheAttributes 
 remoteHost = [172.25.22.122]
 remotePort = [1101]
 cacheName = [null]
 remoteType = [LOCAL]
 removeUponRemotePut = [true]
 getOnly = [false]
 servicePort = [0]
 allowClusterGet = [true]
 configFileName = []
 rmiSocketFactoryTimeoutMillis = [5000]
 startRegistry = [true]
 useRegistryKeepAlive = [true]
 registryKeepAliveDelayMillis = [15000]
 eventQueueType = [null]
 eventQueuePoolName = [null]
1794 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.remote.server.RemoteCacheServerFactory  - No server specific custom socket factory defined.
1794 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteUtils  - RmiSocketFactoryTimeoutMillis [5000].  Configuring a custom socket factory.
1794 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.AuxiliaryCacheConfigurator  - No cache event logger defined for auxiliary [jcs.remotecache]
1794 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.AuxiliaryCacheConfigurator  - No cache event logger defined for auxiliary [remote]
1810 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Instance is null, returning unconfigured instance
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.utils.threadpool.ThreadPoolManager  - thread_pool.default PoolConfiguration = useBoundary = [false] boundarySize = [2000] maximumPoolSize = [150] minimumPoolSize = [4] keepAliveTime = [300000] whenBlockedPolicy = [RUN] startUpSize = [4]
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Setting default auxiliaries to null
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - No special CompositeCacheAttributes class defined for key [jcs.default.cacheattributes], using default class.
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - setting defaultCompositeCacheAttributes to [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 100, maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ]
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - No special ElementAttribute class defined for key [jcs.default.elementattributes], using default class.
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL = true, IS_REMOTE = true, IS_ETERNAL = true, MaxLifeSeconds = -1, IdleTime = -1, CreateTime = 1593457016336, LastAccessTime = 1593457016336, getTimeToLiveSeconds() = -1, createTime = 1593457016336 ]
1825 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - No special ElementAttribute class defined for key [jcs.region.jdx.elementattributes], using default class.
1857 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.memory.AbstractDoubleLinkedListMemoryCache  - initialized MemoryCache for jdx
1857 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCache  - Constructed cache with name [jdx] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 100000, maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ]
1857 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.AuxiliaryCacheConfigurator  - No cache event logger defined for auxiliary [jcs.auxiliary.DC]
1872 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.AuxiliaryCacheConfigurator  - Using standard serializer [org.apache.commons.jcs.utils.serialization.StandardSerializer@43854546] for auxiliary [jcs.auxiliary.DC]
1888 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache  - Region [jdx] Cache file root directory: \wtg_ecomm_work\jcs_server
1888 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache  - Region [jdx] Set maxKeySize to: '5000'
1966 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache  - Region [jdx] Loaded keys from [jdx], key count: 5000; up to 5000 will be available.
1981 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache  - Region [jdx] Finished inital consistency check, isOk = true in 15ms.
1981 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.disk.indexed.IndexedDiskCache  - Region [jdx] Indexed Disk Cache is alive.
1981 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheConfigurator  - Parsed regions [jdx]
1981 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.control.CompositeCacheManager  - Finished configuration in 156 ms.
1981 [localhost-startStop-1] WARN  org.apache.commons.jcs.auxiliary.remote.RemoteUtils  - createRegistry> Problem creating registry. It may already be started. internal error: ObjID already in use
1981 [localhost-startStop-1] INFO  org.apache.commons.jcs.auxiliary.remote.server.RemoteCacheServerFactory  - Binding server to //172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal
7144 [localhost-startStop-1] INFO  org.apache.commons.jcs.engine.CacheEventQueue  - Cache event queue created: CacheEventQueue [listenerId=24116567, cacheName=jdx]

客户端应用 ping 其 JCS 服务器

2020/06/29 15:01:13 | 2355382 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.122:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 15:01:13 | 2355384 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Server found: Proxy[IRemoteCacheServer,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[172.25.22.122:57711](remote),objID:[3e55c041:17301707d55:-7fff, 7441711443403888009]]]]]
2020/06/29 15:01:13 | 2355384 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Looking up server [//172.25.22.121:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal]
2020/06/29 15:01:13 | 2355387 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Server found: Proxy[IRemoteCacheServer,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[172.25.22.121:50045](remote),objID:[11136de8:172f060aa2e:-7fff, -4182157312969196245]]]]]
2020/06/29 15:01:13 | 2355387 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Fixing caches. ICacheServiceNonLocal Proxy[IRemoteCacheServer,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[172.25.22.121:50045](remote),objID:[11136de8:172f060aa2e:-7fff, -4182157312969196245]]]]] | IRemoteCacheObserver org.apache.commons.jcs.engine.CacheWatchRepairable@6adcb817
2020/06/29 15:01:13 | 2355387 [JCS-RemoteCacheMonitor] INFO  org.apache.commons.jcs.auxiliary.remote.RemoteCacheManager  - Remote connection to //172.25.22.121:1101/org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal resumed.

但是客户端仍然从 JCS 接收空值:

2020/06/29 15:01:23 | java.lang.NullPointerException
2020/06/29 15:01:23 |   at com.wtg.model.Parcel.setFipsState(Parcel.java:441)
                        ...

请帮助解释我所看到的并提出解决方案。非常感谢。

4

0 回答 0