mercredi 7 janvier 2015

Error "Can not locate the EventDispatcher resource" in Coherence

We are currently stuck on Coherence 3.5.3p11. I would like to move to the latest version but i want to put unit tests in place first because it is such a big change.


I have this working by running this code at the start of the unit test:



CacheFactory.setConfigurableCacheFactory( new ExtensibleEnvironment( "com/company/server/cache/coherence/CoherenceCacheExecutorTest-coherence-config.xml" ) );
CacheFactory.ensureCluster();


And at the end I stop it again:



CacheFactory.getCluster().shutdown();


This allows me to define a Coherence config per unit test.


Now a different unit test also uses this system, but I get the following error:



java.lang.RuntimeException: Can not locate the EventDispatcher resource as the ConfigurableCacheFactory does not support Environments. At a minimum you should configure your application to use the ExtensibleEnvironment.
at com.oracle.coherence.common.events.dispatching.listeners.DelegatingBackingMapListener.getEventDispatcher(DelegatingBackingMapListener.java:165)
at com.oracle.coherence.common.events.dispatching.listeners.DelegatingBackingMapListener.scheduleProcessor(DelegatingBackingMapListener.java:291)
at com.oracle.coherence.common.events.dispatching.listeners.DelegatingBackingMapListener.entryInserted(DelegatingBackingMapListener.java:220)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:266)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:226)
at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
at com.tangosol.coherence.component.util.SafeNamedCache.translateMapEvent(SafeNamedCache.CDB:7)
at com.tangosol.coherence.component.util.SafeNamedCache.entryInserted(SafeNamedCache.CDB:1)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:266)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap$ProxyListener.dispatch(DistributedCache.CDB:22)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap$ProxyListener.entryInserted(DistributedCache.CDB:1)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:266)
at com.tangosol.coherence.component.util.CacheEvent.run(CacheEvent.CDB:18)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service$EventDispatcher.onNotify(Service.CDB:26)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:695)


This is the full logging of Coherence:



2015-01-07 12:36:04.911/0.993 Oracle Coherence 3.5.3/465p11 <Info> (thread=main, member=n/a): Loaded operational configuration from resource "jar:file:/Users/wdb/.m2/repository/com/tangosol/coherence/3.5.3.patch11/coherence-3.5.3.patch11.jar!/tangosol-coherence.xml"
2015-01-07 12:36:04.915/0.997 Oracle Coherence 3.5.3/465p11 <Info> (thread=main, member=n/a): Loaded operational overrides from resource "jar:file:/Users/wdb/.m2/repository/com/tangosol/coherence/3.5.3.patch11/coherence-3.5.3.patch11.jar!/tangosol-coherence-override-dev.xml"
2015-01-07 12:36:04.916/0.998 Oracle Coherence 3.5.3/465p11 <Info> (thread=main, member=n/a): Loaded operational overrides from resource "file:/Users/wdb/Work/flux/server-web/target/test-classes/tangosol-coherence-override.xml"
2015-01-07 12:36:04.921/1.003 Oracle Coherence 3.5.3/465p11 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

Oracle Coherence Version 3.5.3/465p11
Grid Edition: Development mode
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

2015-01-07 12:36:05.017/1.099 Oracle Coherence GE 3.5.3/465p11 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/Users/wdb/Work/flux/server-web/target/test-classes/com/traficon/tmsng/server/common/cachedmessage/CachedMessageEntryProcessorTest-coherence-config.xml"

Using the Incubator Extensible Environment for Coherence Cache Configuration
Copyright (c) 2010, Oracle Corporation. All Rights Reserved.

2015-01-07 12:36:05.350/1.432 Oracle Coherence GE 3.5.3/465p11 <D5> (thread=Cluster, member=n/a): Service Cluster joined the cluster with senior service member n/a
2015-01-07 12:36:08.565/4.647 Oracle Coherence GE 3.5.3/465p11 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0xDDEB" with Member(Id=1, Timestamp=2015-01-07 12:36:05.301, Address=10.65.20.12:8088, MachineId=24332, Location=site:zone2.flir.net,machine:bruk-00047-l,process:4516, Role=IntellijRtExecutionAppMain, Edition=Grid Edition, Mode=Development, CpuCount=8, SocketCount=8, PublisherSuccessRate=1.0, ReceiverSuccessRate=1.0, LastIn=n/a, LastOut=n/a, LastSlow=n/a) UID=0x0A41140C0000014AC42E21B55F0C1F98
2015-01-07 12:36:08.583/4.665 Oracle Coherence GE 3.5.3/465p11 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
2015-01-07 12:36:09.721/5.803 Oracle Coherence GE 3.5.3/465p11 <D5> (thread=DistributedCache:BackService, member=1): Service BackService joined the cluster with senior service member 1
2015-01-07 12:36:09.929/6.011 Oracle Coherence GE 3.5.3/465p11 <Warning> (thread=DistributedCache:BackService:EventDispatcher, member=1): Mixed usage of getCacheFactoryBuilder() and setConfigurableCacheFactory() is not recommended.
2015-01-07 12:36:09.932/6.014 Oracle Coherence GE 3.5.3/465p11 <Info> (thread=DistributedCache:BackService:EventDispatcher, member=1): Loaded cache configuration from "jar:file:/Users/wdb/.m2/repository/com/tangosol/coherence/3.5.3.patch11/coherence-3.5.3.patch11.jar!/coherence-cache-config.xml"
2015-01-07 12:36:09.933/6.015 Oracle Coherence GE 3.5.3/465p11 <Error> (thread=DistributedCache:BackService:EventDispatcher, member=1): An exception occurred while dispatching the following event:
CacheEvent: MapListenerSupport$FilterEvent{DistributedCache$BinaryMap inserted: key=Binary(length=164, value=0x0DB3010A3B636F6D2E7472616669636F6E2E646F6D61696E2E6D6573736167652E63616368652E4D65737361676543616368654B657957697468536F757263650A3B636F6D2E7472616669636F6E2E646F6D61696E2E6D6573736167652E6576656E742E63616368652E46696C7465724576656E7443616368654B6579010C46494C5445525F4556454E54400866696C74657231360D4445544543544F5247524F555001), value=Binary(length=835, value=0x0A33636F6D2E7472616669636F6E2E646F6D61696E2E6361636865646D6573736167652E4361636865644D657373616765496D706C0000000101000A9001636F6D2E7472616669636F6E2E746D736E672E7365727665722E636F6D6D6F6E2E6361636865646D6573736167652E70726F636573736C696E652E43616368656450726F636573734C696E65496D706C003D636F6D2E7472616669636F6E2E646F6D61696E2E6D6573736167652E696D706C2E6576656E742E46696C7465724576656E744D657373616765496D706C0A3D636F6D2E7472616669636F6E2E646F6D61696E2E6D6573736167652E736F757263652E4465746563746F7247726F75704D...), filters=[null]}
2015-01-07 12:36:09.933/6.015 Oracle Coherence GE 3.5.3/465p11 <Error> (thread=DistributedCache:BackService:EventDispatcher, member=1): The following exception was caught by the event dispatcher:
2015-01-07 12:36:09.933/6.015 Oracle Coherence GE 3.5.3/465p11 <Error> (thread=DistributedCache:BackService:EventDispatcher, member=1):
java.lang.RuntimeException: Can not locate the EventDispatcher resource as the ConfigurableCacheFactory does not support Environments. At a minimum you should configure your application to use the ExtensibleEnvironment.


I have noticed this line in the log:



Mixed usage of getCacheFactoryBuilder() and setConfigurableCacheFactory() is not recommended.


For this, I tried adding this add the very start of my unit test:



CacheFactory.setCacheFactoryBuilder( null );


But this did not help.


Aucun commentaire:

Enregistrer un commentaire