POF & fromBinary

Hi,
I am in the process of making all my Java objects EvolvablePortableObject. I was using Externalizable, but from what i can tell, serializing with POF creates a smaller memory footprint and appears to be new new preferred way to store objects in a grid(correct?).
Things were working fine until i tried doing some deletes. When my map listener fired off on the entryDeleted method in the ReadWriteBackingMap, i got an Exception. The code that fails is
          Object oKey = evt.getKey() instanceof Binary ? ExternalizableHelper
                    .fromBinary((Binary) evt.getKey()) : evt.getKey();
The fromBinary is trying to use the DefaultSerializer, which obviously will not work due to the fact i am doing POF. Is there a work around for this? Am i doing something wrong? Any reason I would not want to use POF for all my objects? I am using 3.4 RC3 code. Here is the complete stacktrace.
2008-09-11 17:09:45.478 Oracle Coherence GE 3.4/403 Release Candidate 3 <Error> (thread=DistributedCacheWorker:3, member=8): (Wrapped) java.io.IOException: unsupported type / corrupted stream: 78
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2222)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2209)
at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:60)
at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2643)
at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:256)
at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:224)
at com.thomson.legal.vertical.sooem.CacheListener.entryDeleted(CacheListener.java:23)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:199)
at com.tangosol.util.MapEvent.dispatch(MapEvent.java:164)
at com.tangosol.util.MapListenerSupport.fireEvent(MapListenerSupport.java:556)
at com.tangosol.net.cache.OldCache.dispatchEvent(OldCache.java:1718)
at com.tangosol.net.cache.OldCache$Entry.discard(OldCache.java:2018)
at com.tangosol.net.cache.OldCache.remove(OldCache.java:323)
at com.tangosol.net.cache.LocalCache.remove(LocalCache.java:137)
at com.tangosol.net.cache.ReadWriteBackingMap.remove(ReadWriteBackingMap.java:867)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$Storage.remove(DistributedCache.CDB:49)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onRemoveRequest(DistributedCache.CDB:34)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$RemoveRequest.run(DistributedCache.CDB:1)
at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)
at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:24)
at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:49)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
at java.lang.Thread.run(Thread.java:619)
On a side note, it did delete my objects from the cache.
thanx
kevin

Hi Kevin,
Instead of using ExternalizableHelper directly you can use BackingMapManagerContext (also see cache configuration parameter macros: http://wiki.tangosol.com/display/COH33UG/Parameter+Macros) , which has to/from internal converters associated with it, for example:
<!DOCTYPE cache-config SYSTEM "cache-config.dtd">
<cache-config>
    <caching-scheme-mapping>
        <cache-mapping>
            <cache-name>test</cache-name>
            <scheme-name>test</scheme-name>
        </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
        <distributed-scheme>
            <scheme-name>test</scheme-name>
            <backing-map-scheme>
                <local-scheme>
                    <listener>
                        <class-scheme>
                            <class-name>Main</class-name>
                            <init-params>
                                <init-param>
                                    <param-type>com.tangosol.net.BackingMapManagerContext</param-type>
                                    <param-value>{manager-context}</param-value>
                                </init-param>
                            </init-params>
                        </class-scheme>
                    </listener>
                </local-scheme>
            </backing-map-scheme>
        </distributed-scheme>
    </caching-schemes>
</cache-config>
import com.tangosol.net.BackingMapManagerContext;
import com.tangosol.net.CacheFactory;
import com.tangosol.util.Converter;
import com.tangosol.util.MapEvent;
import com.tangosol.util.MultiplexingMapListener;
* dimitri Sep 13, 2008 7:36:55 PM
public class Main extends MultiplexingMapListener
    BackingMapManagerContext m_ctx;
    public Main(BackingMapManagerContext ctx)
        m_ctx = ctx;
    protected void onMapEvent(MapEvent evt)
        Converter keyFromInternal = m_ctx.getKeyFromInternalConverter();
        Converter valFromInternal = m_ctx.getValueFromInternalConverter();
        Object oKey = keyFromInternal.convert(evt.getKey());
        Object oValueNew = valFromInternal.convert(evt.getNewValue());
        Object oValueOld = valFromInternal.convert(evt.getOldValue());
        CacheFactory.log(
            "Event: " + evt.getId() +
            " key: " + oKey +
            " new vaue: " + oValueNew +
            " old value: " + oValueOld,
            CacheFactory.LOG_DEBUG);
    }Regards,
Dimitri

Similar Messages

  • POF serialization testing

    hi
    I would like to write an integration test for POF serialization.
    Is it possible to make Coherence to serialize all objects I put into named cache ?
    Or I need to start two nodes (in two classloaders) in my test ?

    If you want to just test the POF serialization of your classes you can just serialize, deserialize and check the results
    e.g.
    MyPofClass original = new MyPofClass();
    // populate fields of original
    // Serialize to Binary
    ConfigurablePofContext pofContext = new ConfigurablePofContext("name of pof config file .xml");
    Binary binary = ExternalizableHelper.toBinary(original, pofCOntext);
    // Deserialize back to original class
    MyPofClass deserialized = ExternalizableHelper.fromBinary(binary, pofContext);
    // now do some asserts to check that the fields in the original match the fields in the deserialized instanceI usually do that test for all but the most simple POF classes I write.
    JK

  • Getting "invalid type: 169" errors when using POF with Push Replication

    I'm trying to get Push Replication - latest version - running on Coherence 3.6.1. I can get it working fine if I don't use POF with my objects, but when trying to use POF format for my objects I get this:
    2011-02-11 13:06:00.993/2.297 Oracle Coherence GE 3.6.1.1 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2011-02-11 13:06:01.149/2.453 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded POF configuration from "file:/C:/wsgpc/GlobalPositionsCache/resource/coherence/pof-config.xml"
    2011-02-11 13:06:01.149/2.453 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6/coherence/lib/coherence.jar!/coherence-pof-config.xml"
    2011-02-11 13:06:01.149/2.453 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-common-1.7.3.20019.jar!/coherence-common-pof-config.xml"
    2011-02-11 13:06:01.165/2.469 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-messagingpattern-2.7.4.21016.jar!/coherence-messagingpattern-pof-config.xml"
    2011-02-11 13:06:01.165/2.469 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-pushreplicationpattern-3.0.3.20019.jar!/coherence-pushreplicationpattern-pof-config.xml"
    2011-02-11 13:06:01.243/2.547 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Service DistributedCacheForSequenceGenerators joined the cluster with senior service member 1
    2011-02-11 13:06:01.258/2.562 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForLiveObjects, member=1): Service DistributedCacheForLiveObjects joined the cluster with senior service member 1
    2011-02-11 13:06:01.274/2.578 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForSubscriptions, member=1): Service DistributedCacheForSubscriptions joined the cluster with senior service member 1
    2011-02-11 13:06:01.290/2.594 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForMessages, member=1): Service DistributedCacheForMessages joined the cluster with senior service member 1
    2011-02-11 13:06:01.305/2.609 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForDestinations, member=1): Service DistributedCacheForDestinations joined the cluster with senior service member 1
    2011-02-11 13:06:01.305/2.609 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheWithPublishingCacheStore, member=1): Service DistributedCacheWithPublishingCacheStore joined the cluster with senior service member 1
    2011-02-11 13:06:01.321/2.625 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache, member=1): Service DistributedCache joined the cluster with senior service member 1
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <Info> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): TcpAcceptor now listening for connections on 166.15.224.91:20002
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Started: TcpAcceptor{Name=Proxy:ExtendTcpProxyService:TcpAcceptor, State=(SERVICE_STARTED), ThreadCount=0, Codec=Codec(Format=POF), Serializer=com.tangosol.io.DefaultSerializer, PingInterval=0, PingTimeout=0, RequestTimeout=0, SocketProvider=SystemSocketProvider, LocalAddress=[/166.15.224.91:20002], SocketOptions{LingerTimeout=0, KeepAliveEnabled=true, TcpDelayEnabled=false}, ListenBacklog=0, BufferPoolIn=BufferPool(BufferSize=2KB, BufferType=DIRECT, Capacity=Unlimited), BufferPoolOut=BufferPool(BufferSize=2KB, BufferType=DIRECT, Capacity=Unlimited)}
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService, member=1): Service ExtendTcpProxyService joined the cluster with senior service member 1
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <Info> (thread=main, member=1):
    Services
    ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=3.6, OldestMemberId=1}
    InvocationService{Name=Management, State=(SERVICE_STARTED), Id=1, Version=3.1, OldestMemberId=1}
    PartitionedCache{Name=DistributedCacheForSequenceGenerators, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForLiveObjects, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForSubscriptions, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForMessages, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForDestinations, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheWithPublishingCacheStore, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    ProxyService{Name=ExtendTcpProxyService, State=(SERVICE_STARTED), Id=9, Version=3.2, OldestMemberId=1}
    Started DefaultCacheServer...
    2011-02-11 13:08:27.894/149.198 Oracle Coherence GE 3.6.1.1 <Error> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Failed to publish EntryOperation{siteName=csfb.cs-group.com, clusterName=SPTestCluster, cacheName=source-cache, operation=Insert, publishableEntry=PublishableEntry{key=Binary(length=32, value=0x15A90F00004E07424F4F4B303038014E08494E535430393834024E0345535040), value=Binary(length=147, value=0x1281A30115AA0F0000A90F00004E07424F4F4B303038014E08494E535430393834024E03455350400248ADEEF99607060348858197BF22060448B4D8E9BE02060548A0D2CDC70E060648B0E9A2C4030607488DBCD6E50D060848B18FC1882006094E03303038402B155B014E0524737263244E1F637366622E63732D67726F75702E636F6D2D535054657374436C7573746572), originalValue=Binary(length=0, value=0x)}} to Cache passive-cache because of
    (Wrapped) java.io.StreamCorruptedException: invalid type: 169 Class:com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher
    2011-02-11 13:08:27.894/149.198 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while processing a InvocationRequest for Service=Proxy:ExtendTcpProxyService:TcpAcceptor: (Wrapped: Failed to publish a batch with the publisher [Active Publisher] on cache [source-cache]) java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:348)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.query(InvocationServiceProxy.CDB:6)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.onRun(InvocationServiceFactory.CDB:12)
         at com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.onMessage(InvocationServiceProxy.CDB:9)
         at com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:39)
         at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:103)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:163)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:343)
         ... 9 more
    Caused by: (Wrapped) java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:265)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$ConverterKeyToBinary.convert(PartitionedService.CDB:16)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2156)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2622)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:142)
         ... 10 more
    Caused by: java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2265)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2253)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2703)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:261)
         ... 16 more
    2011-02-11 13:08:37.925/159.229 Oracle Coherence GE 3.6.1.1 <Error> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Failed to publish EntryOperation{siteName=csfb.cs-group.com, clusterName=SPTestCluster, cacheName=source-cache, operation=Insert, publishableEntry=PublishableEntry{key=Binary(length=32, value=0x15A90F00004E07424F4F4B303038014E08494E535430393834024E0345535040), value=Binary(length=147, value=0x1281A30115AA0F0000A90F00004E07424F4F4B303038014E08494E535430393834024E03455350400248ADEEF99607060348858197BF22060448B4D8E9BE02060548A0D2CDC70E060648B0E9A2C4030607488DBCD6E50D060848B18FC1882006094E03303038402B155B014E0524737263244E1F637366622E63732D67726F75702E636F6D2D535054657374436C7573746572), originalValue=Binary(length=0, value=0x)}} to Cache passive-cache because of
    (Wrapped) java.io.StreamCorruptedException: invalid type: 169 Class:com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher
    2011-02-11 13:08:37.925/159.229 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while processing a InvocationRequest for Service=Proxy:ExtendTcpProxyService:TcpAcceptor: (Wrapped: Failed to publish a batch with the publisher [Active Publisher] on cache [source-cache]) java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:348)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.query(InvocationServiceProxy.CDB:6)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.onRun(InvocationServiceFactory.CDB:12)
         at com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.onMessage(InvocationServiceProxy.CDB:9)
         at com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:39)
         at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:103)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:163)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:343)
         ... 9 more
    Caused by: (Wrapped) java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:265)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$ConverterKeyToBinary.convert(PartitionedService.CDB:16)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2156)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2622)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:142)
         ... 10 more
    Caused by: java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2265)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2253)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2703)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:261)
         ... 16 more
    2011-02-11 13:08:47.940/169.244 Oracle Coherence GE 3.6.1.1 <Error> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Failed to publish EntryOperation{siteName=csfb.cs-group.com, clusterName=SPTestCluster, cacheName=source-cache, operation=Insert, publishableEntry=PublishableEntry{key=Binary(length=32, value=0x15A90F00004E07424F4F4B303038014E08494E535430393834024E0345535040), value=Binary(length=147, value=0x1281A30115AA0F0000A90F00004E07424F4F4B303038014E08494E535430393834024E03455350400248ADEEF99607060348858197BF22060448B4D8E9BE02060548A0D2CDC70E060648B0E9A2C4030607488DBCD6E50D060848B18FC1882006094E03303038402B155B014E0524737263244E1F637366622E63732D67726F75702E636F6D2D535054657374436C7573746572), originalValue=Binary(length=0, value=0x)}} to Cache passive-cache because of
    (Wrapped) java.io.StreamCorruptedException: invalid type: 169 Class:com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher
    2011-02-11 13:08:47.940/169.244 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while processing a InvocationRequest for Service=Proxy:ExtendTcpProxyService:TcpAcceptor: (Wrapped: Failed to publish a batch with the publisher [Active Publisher] on cache [source-cache]) java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:348)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.query(InvocationServiceProxy.CDB:6)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.onRun(InvocationServiceFactory.CDB:12)
         at com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.onMessage(InvocationServiceProxy.CDB:9)
         at com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:39)
         at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:103)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:163)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:343)
         ... 9 more
    Caused by: (Wrapped) java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:265)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$ConverterKeyToBinary.convert(PartitionedService.CDB:16)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2156)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2622)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:142)
         ... 10 more
    Caused by: java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2265)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2253)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2703)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:261)
         ... 16 more
    It seems to be loading my POF configuration file - which also includes the standard Coherence ones as well as those required for PR - just fine, as you can see at the top of the trace.
    Any ideas why POF format for my objects is giving this error (NB. I've tested the POF stuff outside of PR and it all works fine.)
    EDIT: I've tried switching the "publisher" to the "file" publisher in PR. And that works fine. I see my POF format cached data extracted and published to the directory I specify. So the "publish" part seems to work when I use a file-publisher.
    Cheers,
    Steve

    Hi Neville,
    I don't pass any POF config parameters on the command-line. My POF file is called "pof-config.xml" so seems to be picked up by default. The trace I showed in my post shows the file being picked up.
    My POF config file content is as follows:
    <pof-config>
         <user-type-list>
              <!-- Standard Coherence POF types -->
              <include>coherence-pof-config.xml</include>
              <!-- Coherence Push Replication Required POF types -->
    <include>coherence-common-pof-config.xml</include>
    <include>coherence-messagingpattern-pof-config.xml</include>
    <include>coherence-pushreplicationpattern-pof-config.xml</include>
              <!-- User POF types (must be above 1000) -->
              <user-type>
                   <type-id>1001</type-id>
                   <class-name>com.csg.gpc.domain.model.position.trading.TradingPositionKey</class-name>
                   <serializer>
                        <class-name>com.csg.gpc.coherence.pof.position.trading.TradingPositionKeySerializer</class-name>
                   </serializer>
              </user-type>
              <user-type>
                   <type-id>1002</type-id>
                   <class-name>com.csg.gpc.domain.model.position.trading.TradingPosition</class-name>
                   <serializer>
                        <class-name>com.csg.gpc.coherence.pof.position.trading.TradingPositionSerializer</class-name>
                   </serializer>
              </user-type>
              <user-type>
                   <type-id>1003</type-id>
                   <class-name>com.csg.gpc.domain.model.position.simple.SimplePosition</class-name>
                   <serializer>
                        <class-name>com.csg.gpc.coherence.pof.position.simple.SimplePositionSerializer</class-name>
                   </serializer>
              </user-type>
              <user-type>
                   <type-id>1004</type-id>
                   <class-name>com.csg.gpc.coherence.processor.TradingPositionUpdateProcessor</class-name>
              </user-type>
         </user-type-list>
    </pof-config>
    EDIT: I'm running both clusters here from within Eclipse. Here's the POF bits from the startup of the receiving cluster:
    2011-02-11 15:05:22.607/2.328 Oracle Coherence GE 3.6.1.1 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded POF configuration from "file:/C:/wsgpc/GlobalPositionsCache/resource/coherence/pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6/coherence/lib/coherence.jar!/coherence-pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-common-1.7.3.20019.jar!/coherence-common-pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-messagingpattern-2.7.4.21016.jar!/coherence-messagingpattern-pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-pushreplicationpattern-3.0.3.20019.jar!/coherence-pushreplicationpattern-pof-config.xml"
    And here's the start-up POF bits from the sending cluster:
    2011-02-11 15:07:09.744/2.343 Oracle Coherence GE 3.6.1.1 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded POF configuration from "file:/C:/wsgpc/GlobalPositionsCache/resource/coherence/pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6/coherence/lib/coherence.jar!/coherence-pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-common-1.7.3.20019.jar!/coherence-common-pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-messagingpattern-2.7.4.21016.jar!/coherence-messagingpattern-pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-pushreplicationpattern-3.0.3.20019.jar!/coherence-pushreplicationpattern-pof-config.xml"
    They both seem to be reading my pof-config.xml file.
    I have the following in my sending cluster cache config:
              <sync:provider pof-enabled="true">
                   <sync:coherence-provider />
              </sync:provider>
    And this in the receiving cache config:
    <introduce:config
    file="coherence-pushreplicationpattern-pof-cache-config.xml" />
    Cheers,
    Steve
    Edited by: stevephe on 11-Feb-2011 07:05

  • Coherence Client without POF classes problem

    I have a special Coherence client node that will be performing cache invalidation tasks only. namedCache.keySet().remove( removeKey ); I will never actually send or deserialize the objects to this node.
    This node has no need to have to have the classes related to POF on it, and I really never want to have to update/perform maintenance on this node when updates are made to the classes on the actual cache nodes.
    Is there any way I can setup/configure this node so that in its coherence-cache-config, I am not required to provide the serializer config or not have to provide the classes behind the serializer?
    When I attempt to do this, Coherence complains that this node's is configured to use serializer com.tangosol.io.pof.ConfigurablePofContext which appears to be different from the serializer used by other members.
    If I set the serializer, it then complains that the ClassNotFound if I dont place all the classes on this special invalidator node.
    Please help!!! I dont want this special client to have to have all the POF details and classes!!!! He will never need it.
    Thanks,
    J
    Edited by: user12017793 on Sep 11, 2011 9:27 PM

    I'm not sure it is that messy.
    1. The custom client side serializer
    package com.gridman.test;
    import com.tangosol.io.ReadBuffer;
    import com.tangosol.io.WriteBuffer;
    import com.tangosol.io.pof.ConfigurablePofContext;
    import com.tangosol.io.pof.PofBufferReader;
    import com.tangosol.io.pof.PofBufferWriter;
    import com.tangosol.io.pof.PofContext;
    import java.io.IOException;
    public class PassThroughPofContext extends ConfigurablePofContext {
        public PassThroughPofContext(String sLocator) {
            super(sLocator);
        @Override
        public void serialize(WriteBuffer.BufferOutput out, Object o) throws IOException {
            try {
                if (o instanceof PassThrough) {
                    PassThrough passThrough = (PassThrough)o;
                    out.writePackedInt(passThrough.getType());
                    out.writeBuffer(passThrough.getValue());
                } else {
                    PofBufferWriter writer = new PofBufferWriter(out, this);
                    writer.writeObject(-1, o);
            } catch (RuntimeException e) {
                throw new IOException(e.getMessage(), e);
        @Override
        public Object deserialize(ReadBuffer.BufferInput in) throws IOException {
            try {
                Reader reader = new Reader(in, this);
                return reader.readObject(-1);
            } catch (RuntimeException e) {
                throw new IOException(e.getMessage(), e);
        @Override
        public int getUserTypeIdentifier(Object o) {
            int id;
            if (o instanceof PassThrough) {
                id = ((PassThrough)o).getType();
            } else {
                id = super.getUserTypeIdentifier(o);
            return id;
        private boolean isUserType(int type) {
            ensureInitialized();
            Class[] types = this.getPofConfig().m_aClzByTypeId;
            return types.length > type && types[type] != null;
        private class Reader extends PofBufferReader {
            private Reader(ReadBuffer.BufferInput in, PofContext ctx) {
                super(in, ctx);
            @Override
            protected Object readAsObject(int nType) throws IOException {
                Object value;
                if (((PassThroughPofContext)this.m_ctx).isUserType(nType)) {
                    value = super.readAsObject(nType);
                } else {
                    value = new PassThrough(nType, this.m_in);
                return value;
    }2. The class that will be used to hold anything that the serializer does not know how to handle
    package com.gridman.test;
    import com.tangosol.io.ReadBuffer;
    import java.io.IOException;
    public class PassThrough {
        private int type;
        private ReadBuffer value;
        public PassThrough(int type, ReadBuffer.BufferInput in) throws IOException {
            this.type = type;
            this.value = in.readBuffer(in.available());
        public int getType() {
            return type;
        public ReadBuffer getValue() {
            return value;
    }3. The client cache config
    <cache-config>
        <caching-scheme-mapping>
            <cache-mapping>
                <cache-name>*</cache-name>
                <scheme-name>proxy</scheme-name>
            </cache-mapping>
        </caching-scheme-mapping>
        <caching-schemes>  
            <remote-cache-scheme>
                <scheme-name>proxy</scheme-name>
                <service-name>extend-service</service-name>
                <initiator-config>
                    <tcp-initiator>
                        <remote-addresses>
                            <socket-address>
                                <address>... put host name here ...</address>
                                <port>10000</port>
                            </socket-address>
                        </remote-addresses>
                    </tcp-initiator>
                    <serializer>
                        <instance>
                            <class-name>com.gridman.test.PassThroughPofContext</class-name>
                            <init-params>
                                <init-param>
                                    <param-type>String</param-type>
                                    <param-value system-property="tangosol.pof.config">coherence-pof-config.xml</param-value>
                                </init-param>
                            </init-params>
                        </instance>
                    </serializer>
                </initiator-config>
            </remote-cache-scheme>
        </caching-schemes>
    </cache-config>The above code and config is all you need. Everything below here is to test it.
    To test it we just convert a class to Binary and back again using the server and client serializers E.G.
    A simple POF class to test with - this would only be on the server side
    package com.gridman.test;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    import java.io.IOException;
    public class TestPortableObject implements PortableObject {
        private String field1;
        private int field2;
        public TestPortableObject() {
        public TestPortableObject(String field1, int field2) {
            this.field1 = field1;
            this.field2 = field2;
        @Override
        public void readExternal(PofReader pofReader) throws IOException {
            field1 = pofReader.readString(1);
            field2 = pofReader.readInt(2);
        @Override
        public void writeExternal(PofWriter pofWriter) throws IOException {
            pofWriter.writeString(1, field1);
            pofWriter.writeInt(2, field2);
        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            if (o == null || getClass() != o.getClass()) {
                return false;
            TestPortableObject that = (TestPortableObject) o;
            if (field2 != that.field2) {
                return false;
            if (field1 != null ? !field1.equals(that.field1) : that.field1 != null) {
                return false;
            return true;
        @Override
        public int hashCode() {
            int result = field1 != null ? field1.hashCode() : 0;
            result = 31 * result + field2;
            return result;
    }The test server side server-pof-config.xml file
    <pof-config>
        <user-type-list>
            <include>coherence-common-pof-config.xml</include>
            <user-type>
                <type-id>1000</type-id>
                <class-name>com.gridman.test.TestPortableObject</class-name>
            </user-type>
        </user-type-list>
    </pof-config>Now our test code...
    package com.gridman.test;
    import com.tangosol.io.pof.ConfigurablePofContext;
    import com.tangosol.util.Binary;
    import com.tangosol.util.ExternalizableHelper;
    public class Main {
        public static void main(String[] args) {
            // Create an instance of our test PortableObject
            TestPortableObject testPortableObject = new TestPortableObject("testing...", 1234);
            // This is the server side serializer that uses the server side POF config
            ConfigurablePofContext pofContext = new ConfigurablePofContext("server-pof-config.xml");
            // This is the custom client side serializer that just uses the Coherence pof config
            PassThroughPofContext passThroughPofContext = new PassThroughPofContext("coherence-common-pof-config.xml");
            // Serialize our test instance using the server side serializer
            // This would be equivalent to a Binary that would have been sent from the server to the client
            Binary binaryFromServer = ExternalizableHelper.toBinary(testPortableObject, pofContext);
            // Deserialize the binaryFromServer using the client side serializer
            // Just as if the client had recieved this over the wire from the server
            PassThrough passThrough = (PassThrough) ExternalizableHelper.fromBinary(binaryFromServer, passThroughPofContext);
            // Serialise the PassThrough to Binary using the client side serializer
            // as though we are sending the value back over the wire to the server
            Binary serializedPassThrough = ExternalizableHelper.toBinary(passThrough, passThroughPofContext);
            // Deserialize back to an Object using the server side serializer
            TestPortableObject result = (TestPortableObject) ExternalizableHelper.fromBinary(serializedPassThrough, pofContext);
            // The result should be equal to the original testPortableObject
            System.out.println("Result: " + testPortableObject.equals(result));
    }running the above code should print out: Result: true
    This was put together pretty quickly so I'm sure people will comment if I have missed anything.
    JK

  • POF question

    Hi,
    Does Portable Object Format (POF) enable me to write objects in Java and have a c++ client that can read them and vice versa?
    Is there an example of this in the documentation? Thanks!
    Update:
    Okay, I think I have answered my own question (but I have more questions, see below). Yes, data can be written from a Java client to Coherence, and read from a C++ client (or a .NET client).
    Question 1: In Java, the ConfigurablePofContext must be used to map the numeric identifier to a Java class name. Next, the cluster must be configured to use the ConfigurablePofContext by adding a <serializer> element to the configuration file. Is there a similar config file for C++ or is this all accomplished using the registration methods?:
    COH_REGISTER_MANAGED_CLASS(ID, TYPE) - for use with Managed<T>
    COH_REGISTER_PORTABLE_CLASS(ID, TYPE) - for use with PortableObject
    COH_REGISTER_POF_SERIALIZER(ID, CLASS, SERIALIZER) - for use with PofSerializer
    Question 2: In an all C++ environment, is there any need to implement a Java version of the class? Would the Coherence server processes need to know about it in order to handle storing it?
    I may have more questions later, thanks for the help!!
    Edited by: user8723994 on Jan 25, 2010 6:44 AM

    I did NOT manage to make the -Dtangosol.pof.enabled=true (or just -Dtangosol.pof.enabled) make any difference.
    By changing the value in the XML-file (in the JAR) I did however manage to get the desired effect.
    For an object with a few nested objects (all attributes in the objects involved were small ints, the class names were short) the results are:
    Method / toBinary[s} / fromBinary[s] / size in bytes
    Lite / 1.58e-6 / 7.82e-6 / 102
    POF / 4.12e-6 / 2.82e-6 / 79
    POF serialization is in this case like 250% SLOWER, de-serialization about as much FASTER and the size reduction is about 20%
    Given that a read-heavy application do a lot more de-serialization the increase in de-serialization performance will easilly compensate for the slower serialization - looks promisiong!
    I also noted that PowWriter/Reader methods for insts automatically seem to only write/read as many bytes as are required. If one would like to handle that yourself (ie use a single byte/word/int that holds the size info for several ints and then call the byte, word, int etc methods explicitly for each of them) is there some way to still do that?
    /Magnus

  • Unknown user type with POF serialization

    Hi all,
    I'm using 3.6 and am just starting to implement POF.  In general it has been pretty easy but I seem to have a problem with my near scheme and POF.  Things work ok in my unit tests, but it doesn't work when I deploy to a single instance of WebLogic 12 on my laptop.  Here is an example scheme:
    <near-scheme>
      <scheme-name>prod-near</scheme-name>
      <autostart>true</autostart>
      <front-scheme>
        <local-scheme>
          <high-units>{high-units 2000}</high-units>
          <expiry-delay>{expiry-delay 2h}</expiry-delay>
        </local-scheme>
      </front-scheme>
      <back-scheme>
        <distributed-scheme>
          <backing-map-scheme>
            <local-scheme>
              <high-units>{high-units 10000}</high-units>
              <expiry-delay>{expiry-delay 2h}</expiry-delay>
            </local-scheme>
          </backing-map-scheme>
          <serializer>
            <instance>
              <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
              <init-params>
                <init-param>
                  <param-value>/Bus/pof-config.xml</param-value>
                  <param-value>String</param-value>
                </init-param>
              </init-params>
            </instance>
          </serializer>
        </distributed-scheme>
      </back-scheme>
    </near-scheme>
    I don't know if it matter, but some of my caches use another scheme that references this one as a parent:
    <near-scheme>
      <scheme-name>daily-near</scheme-name>
      <scheme-ref>prod-near</scheme-ref>
      <autostart>true</autostart>
      <back-scheme>
        <distributed-scheme>
          <backing-map-scheme>
            <local-scheme>
              <high-units system-property="daily-near-high-units">{high-units 10000}</high-units>
              <expiry-delay>{expiry-delay 1d}</expiry-delay>
            </local-scheme>
          </backing-map-scheme>
          <serializer>
            <instance>
              <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
              <init-params>
                <init-param>
                  <param-value>/Bus/pof-config.xml</param-value>
                  <param-value>String</param-value>
                </init-param>
              </init-params>
            </instance>
          </serializer>
        </distributed-scheme>
      </back-scheme>
    </near-scheme>
    Those schemes have existed for years.  I'm only now adding the serializers.  I use this same cache config file in my unit tests, as well as the same pof config file.  My unit tests do ExternalizableHelper.toBinary(o, pofContext) and ExternalizableHelper.fromBinary(b, pofContext).  I create the test pof context by doing new ConfigurablePofContext("/Bus/pof-config.xml").  I've also tried actually putting and getting an object to and from a cache in my unit tests.  Everything works as expected.
    My type definition looks like this:
    <user-type>
      <type-id>1016</type-id>
      <class-name>com.mycompany.mydepartment.bus.service.role.RoleResource</class-name>
    </user-type>
    I'm not using the tangosol.pof.enabled system property because I don't think it's necessary with the explicit serializers.
    Here is part of a stack trace:
    (Wrapped) java.io.IOException: unknown user type: com.mycompany.mydepartment.bus.service.role.RoleResource
        at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:214)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterValueToBinary.convert(PartitionedCache.CDB:3)
        at com.tangosol.util.ConverterCollections$ConverterCacheMap.put(ConverterCollections.java:2486)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.put(PartitionedCache.CDB:1)
        at com.tangosol.coherence.component.util.SafeNamedCache.put(SafeNamedCache.CDB:1)
        at com.tangosol.net.cache.CachingMap.put(CachingMap.java:943)
        at com.tangosol.net.cache.CachingMap.put(CachingMap.java:902)
        at com.tangosol.net.cache.CachingMap.put(CachingMap.java:814)
    Any idea what I'm missing?
    Thanks
    John

    SR-APX wrote:
    Aleks
    thanks for your response.
    However the include property needs to present inside the <user-type-list> tag....
    <user-type-list> <include>coherence-pof-config.xml </include></user-type-list>
    For all other interested users the following property, tangosol.pof.enabled=true , must also be set for pof serialization to work correctly.
    Thanks again...
    ShamsurHi Shamsur,
    it is not mandatory to use tangosol.pof.enabled=true, you can alternatively specify the serializer for the clustered services to be configured for POF (not necessarily all of them) on a service-by-service basis in the cache configuration file explicitly with the following element.
    <serializer>com.tangosol.io.pof.ConfigurablePofContext</serializer>Best regards,
    Robert

  • Overriding eventdistributionpattern-pof throwing unable to load class error

    Hi,
    We were trying to override the "coherence-eventdistributionpattern-pof-config.xml" with our own event distribution pof due to conflicintg type-id's. We changed type-id's for few of the classes. We changed the type-id for the following classes and left others as such.
    com.oracle.coherence.patterns.eventdistribution.EventDistributor$Identifier
    com.oracle.coherence.patterns.eventdistribution.events.DistributableEntry
    com.oracle.coherence.patterns.eventdistribution.events.DistributableEntryInsertedEvent
    com.oracle.coherence.patterns.eventdistribution.events.DistributableEntryUpdatedEvent
    com.oracle.coherence.patterns.eventdistribution.events.DistributableEntryRemovedEvent
    When i start the coherence server, i get error in loading class "com.oracle.coherence.patterns.eventdistribution.channels.cache.ParallelLocalCacheEventChannelBuilder" for which we did not change the typ-id at all.
    Coherence version 3.7.10
    Error Trace:
    (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=2): PartitionedCache caught an unhandled exception (com.tangosol.util.WrapperException: (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") (Wrapped: Unable to load class for user type (Config=test/coherence/grid/obj-pof-config.xml, Type-Id=13402, Class-Name=com.oracle.coherence.patterns.eventdistribution.channels.cache.ParallelLocalCacheEventChannelBuilder)) (Wrapped) com.oracle.coherence.patterns.eventdistribution.channels.cache.ParallelLocalCacheEventChannelBuilder) while exiting.
    <Error> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=2): ClusterService.doServiceLeft: Unknown Service PartitionedCache{Name=DistributedCacheForSequenceGenerators, State=(SERVICE_STOPPED), Not initialized}
    (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=2): Service DistributedCacheForSequenceGenerators left the cluster
    <Error> (thread=main, member=2): Error while starting service "DistributedCacheForSequenceGenerators": (Wrapped) (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") (Wrapped: Unable to load class for user type (Config=test/coherence/grid/obj-pof-config.xml, Type-Id=13402, Class-Name=com.oracle.coherence.patterns.eventdistribution.channels.cache.ParallelLocalCacheEventChannelBuilder)) (Wrapped) java.lang.ClassNotFoundException: com.oracle.coherence.patterns.eventdistribution.channels.cache.ParallelLocalCacheEventChannelBuilder
            at com.tangosol.coherence.component.util.Daemon.start(Daemon.CDB:52)
    Thanks,

    File's permissions?

  • Unable to load the pof configuration

    Hi all,
    Im trying with pof serialization but unable to load the pof configuration and im getting the following error:
    2013-06-12 14:41:49,582 [catalina-exec-1] ERROR com.distcachedemo.KnCacheDemoServlet - doPost(HttpServletRequest, HttpServletResponse)::
    (Wrapped) java.io.NotSerializableException: com.distcachedemo.dto.KnMasterListResponse
        at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:215)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterValueToBinary.convert(PartitionedCache.CDB:3)
        at com.tangosol.util.ConverterCollections$ConverterMap.put(ConverterCollections.java:1674)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.put(PartitionedCache.CDB:1)
        at com.tangosol.coherence.component.util.SafeNamedCache.put(SafeNamedCache.CDB:1)
        at com.distcachedemo.KnCorpContactInfoControllerDemo.getMasterList(KnCorpContactInfoControllerDemo.java:183)
        at com.distcachedemo.KnCacheDemoServlet.doPost(KnCacheDemoServlet.java:60)
    Please let me know what is that i need to correct in the below:
    NOTE: I have also tried Proxy Scheme with serializer and it too did not work
              From the coherence logs i havent found the log of POF configuration being loaded.
    Configuration used:
    ============
    cache-config.xml::
    <?xml version="1.0"?>
    <cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
       xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
       <caching-scheme-mapping>
          <cache-mapping>
             <cache-name>nspoc*</cache-name>
             <scheme-name>distributed-ns</scheme-name>
          </cache-mapping>
         <cache-mapping>
             <cache-name>poc*</cache-name>
             <scheme-name>distributed</scheme-name>
          </cache-mapping>
       </caching-scheme-mapping>
    <caching-schemes>
          <distributed-scheme>
             <scheme-name>distributed-ns</scheme-name>
             <service-name>DistributedCache-ns</service-name>
             <thread-count>4</thread-count>
             <request-timeout>60s</request-timeout>
             <backing-map-scheme>
                        <external-scheme>
                            <nio-memory-manager>
                                <initial-size>1MB</initial-size>
                                <maximum-size>100MB</maximum-size>
                            </nio-memory-manager>
                            <high-units>100</high-units>
                            <unit-calculator>BINARY</unit-calculator>
                            <unit-factor>1048576</unit-factor>
                        </external-scheme>
             </backing-map-scheme>
             <autostart>true</autostart>
          </distributed-scheme>
          <distributed-scheme>
             <scheme-name>distributed</scheme-name>
             <service-name>DistributedCache</service-name>
             <thread-count>4</thread-count>
             <request-timeout>60s</request-timeout>
             <backing-map-scheme>
                <read-write-backing-map-scheme>
                    <internal-cache-scheme>
                        <external-scheme>
                            <nio-memory-manager>
                                <initial-size>1MB</initial-size>
                                <maximum-size>100MB</maximum-size>
                            </nio-memory-manager>
                            <high-units>100</high-units>
                            <unit-calculator>BINARY</unit-calculator>
                            <unit-factor>1048576</unit-factor>
                        </external-scheme>
                  </internal-cache-scheme>
                  <cachestore-scheme>
                    <class-scheme>
                        <class-factory-name>com.distcachedemo.KnPocCacheStoreFactory</class-factory-name>
                        <method-name>loadCacheStore</method-name>
                        <init-params>
                          <init-param>
                            <param-type>java.lang.String</param-type>
                            <param-value>{cache-name}</param-value>
                          </init-param>
                        </init-params>
                    </class-scheme>
                   </cachestore-scheme>
                </read-write-backing-map-scheme>
             </backing-map-scheme>
             <autostart>true</autostart>
          </distributed-scheme>
          <local-scheme>
             <scheme-name>LocalSizeLimited</scheme-name>
             <eviction-policy>LRU</eviction-policy>
             <high-units>5000</high-units>
             <expiry-delay>1h</expiry-delay>
          </local-scheme>
       </caching-schemes>
    </cache-config>
    =================
    tangosol-coherence-override.xml:
    <?xml version='1.0'?>
    <coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
       xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd">
       <cluster-config>
          <member-identity>
             <cluster-name system-property="tangosol.coherence.cluster">kn_test</cluster-name>
          </member-identity>
          <unicast-listener>
             <well-known-addresses>
                <socket-address id="719">
                   <address>192.168.7.19</address>
                   <port>8088</port>
                </socket-address>
                <socket-address id="3246">
                   <address>192.168.3.246</address>
                   <port>8088</port>
                </socket-address>
                <socket-address id="77">
                   <address>192.168.7.7</address>
                   <port>8088</port>
                </socket-address>
             </well-known-addresses>
             <address system-property="tangosol.coherence.localhost">192.168.7.7</address>
             <port system-property="tangosol.coherence.localport">8088</port>
             <port-auto-adjust system-property="tangosol.coherence.localport.adjust">true</port-auto-adjust> 
          </unicast-listener>
    <serializers>
          <serializer id="java">
             <class-name>com.tangosol.io.DefaultSerializer</class-name>
          </serializer>
          <serializer id="pof">
             <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
            <init-params>
                <init-param>
                   <param-type>String</param-type>
                   <param-value>pof-config.xml</param-value>
                </init-param>
             </init-params>
          </serializer>
       </serializers>
       </cluster-config>
       <configurable-cache-factory-config>
          <init-params>
             <init-param>
                <param-type>java.lang.String</param-type>
                <param-value system-property="tangosol.coherence.cacheconfig">cache-config.xml</param-value>
             </init-param>
          </init-params>
       </configurable-cache-factory-config>
    </coherence>
    ======================
    pof-config.xml:
    <?xml version='1.0'?>
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
       xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config
       coherence-pof-config.xsd">
       <user-type-list>
          <include>coherence-pof-config.xml</include>
          <user-type>
            <type-id>1001</type-id>
            <class-name>com.distcachedemo.dto.KnMasterListResponse</class-name>
          </user-type>
       </user-type-list>
    </pof-config>
    ============
    Java Code:
    package com.distcachedemo.dto;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    import java.io.IOException;
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Map;
    public class KnMasterListResponse implements PortableObject {
      private static final long serialVersionUID = -9114918011531875153L;
      private KnHierarchyListDTO hierarchyListDTO;
      private Map subsMap;
      public KnHierarchyListDTO getHierarchyListDTO() {
      return hierarchyListDTO;
      public void setHierarchyListDTO(KnHierarchyListDTO hierarchyListDTO) {
      this.hierarchyListDTO = hierarchyListDTO;
      public Map getSubsMap() {
      return subsMap;
      public void setSubsMap(Map subsMap) {
      this.subsMap = subsMap;
      public String toString() {
      StringBuilder strBuffer = new StringBuilder(100);
      if (hierarchyListDTO.getHierachyDTOs() != null) {
      strBuffer.append(" hierarchyListDTO - ").append(hierarchyListDTO.getHierachyDTOs().size());
      if (subsMap != null) {
      strBuffer.append(" subsMap - ").append(subsMap.size());
      return strBuffer.toString();
      @Override
      public void readExternal(PofReader pofReader) throws IOException {
      subsMap = pofReader.readMap(0, new HashMap<>());
      hierarchyListDTO = (KnHierarchyListDTO) pofReader.readObject(1);
      @Override
      public void writeExternal(PofWriter pofWriter) throws IOException {
      pofWriter.writeMap(0, subsMap);
      pofWriter.writeObject(1, hierarchyListDTO);
    Thanks,
    Ravi Shanker

    Hi Ravi,
    it is generally recommended that all new classes support POF in this or that way. This or that means either implementing PortableObject or to provide a PofSerializer implementation to be able to optimally serialize their state. Obviously it is not always possible but you should try to achieve that.
    If it is not possible, then you can still convert them to byte[] or String by some other means. If that other means is Java serialization, then Coherence provides a different PofContext implementation (SafeConfigurablePofContext) which you can use instead of ConfigurablePofContext and which is able to fall back to Java serialization for Serializable classes (and also for types not registered in POF configuration but which implement PortableObject). However it is recommended that SafeConfigurablePofContext is not used in production, typically because Java serialization is generally inferior to POF serialization when looking at performance and serialized size, and SafeConfigurablePofContext does not force you to do the right thing, and finally because Java serialization is not platform-independent whereas POF is.
    Best regards,
    Rob

  • Coherence 3.6.0 transactional cache and POF - NULL values

    Hi,
    We are trying to use the new transactional scheme defined in 3.6.0 and we encounter an abnormal behaviour. The code executes without any exception or warnings but in the cache we find the key associated with a NULL value.
    To try to identify the problem, we defined two services (see cache-config below):
    - one transactional cache
    - one distributed cache
    If we try to insert into transactional cache primitives or strings everything is normal (both key and value are visible using coherence console). But if we try to insert custom classes using POF, the key is inserted with a NULL value.
    In same cluster we defined a distributed cache that uses the same POF classes/configuration. A call to put will succeed in any scenario (both key and value are visible using coherence console).
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>cnt.*</cache-name>
                   <scheme-name>storage.transactionalcache.cnt.scheme</scheme-name>
              </cache-mapping>
              <cache-mapping>
                   <cache-name>stt.*</cache-name>
                   <scheme-name>storage.distributedcache.stt.scheme</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <transactional-scheme>
                   <scheme-name>storage.transactionalcache.cnt.scheme</scheme-name>
                   <service-name>storage.transactionalcache.cnt</service-name>
                   <thread-count>10</thread-count>
                   <serializer>
                        <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                        <init-params>
                             <init-param>
                                  <param-type>String</param-type>
                                  <param-value>cnt-pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <backing-map-scheme>
                        <local-scheme>
                             <high-units>250M</high-units>
                             <unit-calculator>binary</unit-calculator>
                        </local-scheme>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </transactional-scheme>
              <distributed-scheme>
                   <scheme-name>storage.distributedcache.stt.scheme</scheme-name>
                   <service-name>storage.distributedcache.stt</service-name>
                   <serializer>
                        <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                        <init-params>
                             <init-param>
                                  <param-type>String</param-type>
                                  <param-value>cnt-pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <backing-map-scheme>
                        <local-scheme>
                             <high-units>250M</high-units>
                             <unit-calculator>binary</unit-calculator>
                        </local-scheme>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
         </caching-schemes>
    </cache-config>
    Failing code (uses transaction APIs 3.6.0):
         public static void main(String[] args)
              Connection con = new DefaultConnectionFactory().createConnection("storage.transactionalcache.cnt");
              con.setAutoCommit(false);
              try
                   OptimisticNamedCache cache = con.getNamedCache("cnt.t1");
                   CId tID = new CId();
                   tID.setId(11111L);
                   C tC = new C();
                   tC.setVal(new BigDecimal("100.1"));
                   cache.insert(tID, tC);
                   con.commit();
              catch (Exception e)
                   e.printStackTrace();
                   con.rollback();
              finally
                   con.close();
    Code that succeeds (but without transaction APIs):
         public static void main(String[] args)
              try
                   NamedCache cache = CacheFactory.getCache("stt.t1");
                   CId tID = new CId();
                   tID.setId(11111L);
                   C tC = new C();
                   tC.setVal(new BigDecimal("100.1"));
                   cache.put(tID, tC);
              catch (Exception e)
                   e.printStackTrace();
              finally
    And here is what we list using coherence console if we use transactional APIs:
    Map (cnt.t1): list
    CId {
    id = 11111
    } = null
    Any suggestion, please?

    Cristian,
    After looking at your configuration I noticed that your configuration is incorrect. For a transactional scheme you cannot specify a backing-map-scheme.
    Your config contained:
    <backing-map-scheme>
    <local-scheme>
    <high-units>250M</high-units>
    <unit-calculator>binary</unit-calculator>
    </local-scheme>
    </backing-map-scheme>To specify high-units for a transactional scheme, simply provide a high-units element directly under the transactional-scheme element.
    <transactional-scheme>
        <scheme-name>small-high-units</scheme-name>
        <service-name>TestTxnService</service-name>
        <autostart>true</autostart>
        <high-units>1M</high-units>
    </transactional-scheme>http://download.oracle.com/docs/cd/E15357_01/coh.360/e15723/api_transactionslocks.htm#BEIBACHA
    The reason that it is not allowable to specify a backing-map-scheme for a transactional scheme is that transactional caches use their own storage.
    I am not sure why this would work with primitives and only fail with POF. We will look into this further here and try to reproduce.
    Can you please change your configuration with the above changes and let us know your results.
    Thanks,
    John
    Edited by: jspeidel on Sep 16, 2010 10:44 AM

  • Error getting while creating the custom pof serializer class

    the error which i am getting is
    2011-07-19 15:16:38.767/4.840 Oracle Coherence GE 3.7.0.0 <Error> (thread=main, member=1): Error while starting se
    vice "AspNetSessionCache": (Wrapped) (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext")
    Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClas
    )) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.coherence.component.util.Daemon.start(Daemon.CDB:52)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:7)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:6)
    at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:39)
    at com.tangosol.coherence.component.util.safeService.SafeCacheService.startService(SafeCacheService.CDB:5)
    at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
    at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.
    ava:1102)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:934
    at com.tangosol.net.DefaultCacheServer.startServices(DefaultCacheServer.java:81)
    at com.tangosol.net.DefaultCacheServer.intialStartServices(DefaultCacheServer.java:250)
    at com.tangosol.net.DefaultCacheServer.startAndMonitor(DefaultCacheServer.java:55)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") (Wrapped: Unable to load c
    ass for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClass)) (Wrapped) java.lang.Cl
    ssNotFoundException: examples.testJavaClass
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:46)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.instantiateSerializer(Service.CDB:1
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:32)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:4)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onEnter(Grid.CDB:26)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onEnter(Par
    itionedService.CDB:19)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:14)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: (Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.
    estJavaClass)) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.io.pof.ConfigurablePofContext.report(ConfigurablePofContext.java:1254)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:956)
    at com.tangosol.io.pof.ConfigurablePofContext.initialize(ConfigurablePofContext.java:775)
    at com.tangosol.io.pof.ConfigurablePofContext.setContextClassLoader(ConfigurablePofContext.java:319)
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:42)
    ... 7 more
    Caused by: (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1198)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:952)
    ... 10 more
    Caused by: java.lang.ClassNotFoundException: examples.testJavaClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.tangosol.util.ExternalizableHelper.loadClass(ExternalizableHelper.java:3056)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1194)
    ... 11 more
    Exception in thread "main" (Wrapped) (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext")
    Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClas
    )) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.coherence.component.util.Daemon.start(Daemon.CDB:52)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:7)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:6)
    at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:39)
    at com.tangosol.coherence.component.util.safeService.SafeCacheService.startService(SafeCacheService.CDB:5)
    at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
    at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.
    ava:1102)
    at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:934
    at com.tangosol.net.DefaultCacheServer.startServices(DefaultCacheServer.java:81)
    at com.tangosol.net.DefaultCacheServer.intialStartServices(DefaultCacheServer.java:250)
    at com.tangosol.net.DefaultCacheServer.startAndMonitor(DefaultCacheServer.java:55)
    at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") (Wrapped: Unable to load c
    ass for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.testJavaClass)) (Wrapped) java.lang.Cl
    ssNotFoundException: examples.testJavaClass
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:46)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.instantiateSerializer(Service.CDB:1
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:32)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:4)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onEnter(Grid.CDB:26)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onEnter(Par
    itionedService.CDB:19)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:14)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: (Wrapped: Unable to load class for user type (Config=pof-config.xml, Type-Id=1001, Class-Name=examples.
    estJavaClass)) (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.io.pof.ConfigurablePofContext.report(ConfigurablePofContext.java:1254)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:956)
    at com.tangosol.io.pof.ConfigurablePofContext.initialize(ConfigurablePofContext.java:775)
    at com.tangosol.io.pof.ConfigurablePofContext.setContextClassLoader(ConfigurablePofContext.java:319)
    at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:42)
    ... 7 more
    Caused by: (Wrapped) java.lang.ClassNotFoundException: examples.testJavaClass
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
    at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1198)
    at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:952)
    ... 10 more
    Caused by: java.lang.ClassNotFoundException: examples.testJavaClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.tangosol.util.ExternalizableHelper.loadClass(ExternalizableHelper.java:3056)
    at com.tangosol.io.pof.ConfigurablePofContext.loadClass(ConfigurablePofContext.java:1194)
    ... 11 more
    2011-07-19 15:16:38.825/4.898 Oracle Coherence GE 3.7.0.0 <D4> (thread=ShutdownHook, member=1): ShutdownHook: stop
    ing cluster node
    2011-07-19 15:16:38.826/4.899 Oracle Coherence GE 3.7.0.0 <D5> (thread=Cluster, member=1): Service Cluster left th
    cluster
    Press any key to continue . . .
    coherence-pof-config.xml is
    <?xml version="1.0"?>
    <!DOCTYPE pof-config SYSTEM "pof-config.dtd">
    <pof-config>
    <user-type-list>
    <user-type>
    <type-id>1001</type-id>
    <class-name>examples.testJavaClass</class-name>
    <serializer>
    <class-name>com.tangosol.io.pof.PortableObjectSerializer</class-name>
    <init-params>
    <init-param>
    <param-type>string</param-type>
    <param-value>1</param-value>
    </init-param>
    </init-params>
    </serializer>
    </user-type>
    </user-type-list>
    </pof-config>
    testJavaClass.CLASS file is
    package examples;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    import com.tangosol.util.Base;
    import java.io.IOException;
    public class testJavaClass implements PortableObject
    private String MembershipId;
    private String m_sStreet;
    private String m_sCity;
    public testJavaClass()
    public testJavaClass(String sName, String sStreet, String sCity)
    setName(sName);
    setStreet(sStreet);
    setCity(sCity);
    public void readExternal(PofReader reader)
    throws IOException
    setName(reader.readString(0));
    setStreet(reader.readString(1));
    setCity(reader.readString(2));
    public void writeExternal(PofWriter writer)
    throws IOException
    writer.writeString(0, getName());
    writer.writeString(1, getStreet());
    writer.writeString(2, getCity());
    // accessor methods omitted for brevity
    Thanks.

    Hi Wijk,
    I have created java class with using NetBeans IDE .
    and running with .NET client and i kept it in the folder (C:\Program Files\Oracle\Coherence for .NET\examples\ContactCache.Java\src\examples).
    Thanks....

  • Pof Serialization Error leads to partial cache updates in XA Tran

    I am using coherence jca adapter to enlist in XA transactions with the database operations. The data is being stored in distributed caches with the cache member running on weblogic server with "Storage disabled". POF is being used for serialization. As a part of a single transaction, multiple caches, which are obtained from the CacheAdapter, are being updated. The application code does explicit updates to the cache and the database within the same transaction with the write to the cache happening after the write the database has been executed.
    It is being observed that when an exception happens during the serialization of an object all the cache updates prior to this error are not rolled back. Namely,
    I have CacheA for Object A, Cache B for Object B and Cache C for Object C.
    I am updating A, B, C with the same transaction and in the same order as the objects are listed. So database for A is updated followed by cache update for A, DataBase B is updated followed by Cache update for B and similarly for C.
    If there is an error while serializing C, all the database updates are rolled back, however updates to A and B are committed to the cache.
    Why aren't all the cache updates being rolled back ? Has this been fixed already in coherence 3.6.
    Thanks,
    Shamsur
    Application Server: Weblogic 10.3
    jdbc driver : XA thin driver
    coherence : 3.5.0
    Caused by: java.lang.IllegalStateException: decimal value exceeds IEEE754r 128-bit range: 7777777788888888888899999999999900000000000000044444444444447777777777777.00
    at com.tangosol.io.pof.PofHelper.calcDecimalSize(PofHelper.java:1517)
    at com.tangosol.io.pof.PofBufferWriter.writeBigDecimal(PofBufferWriter.java:562)
    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1325)
    at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBufferWriter.java:2092)
    at com.apx.core.datalayer.data.basictypes.BigDecimalMoneyImpl.writeExternal(BigDecimalMoneyImpl.java:127)
    at com.tangosol.io.pof.PortableObjectSerializer.serialize(PortableObjectSerializer.java:88)
    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1439)
    at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBufferWriter.java:2092)
    at com.apx.instrument.datalayer.data.domain.impl.DOtcInstrumentImpl.writeExternal(DOtcInstrumentImpl.java:200)
    at com.apx.core.datalayer.data.impl.AbstractDomainObject.writeExternal(AbstractDomainObject.java:109)
    ... 185 more
    at com.tangosol.coherence.ra.component.connector.resourceAdapter.cciAdapter.CacheAdapter$ManagedConnection$LocalTransaction.commit(CacheAdapter.CDB:37)
    at weblogic.connector.security.layer.AdapterLayer.commit(AdapterLayer.java:570)
    at weblogic.connector.transaction.outbound.NonXAWrapper.commit(NonXAWrapper.java:84)
    at weblogic.transaction.internal.NonXAServerResourceInfo.commit(NonXAServerResourceInfo.java:330)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:2251)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:270)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:283)
    at $Proxy150.create(Unknown Source)
    javax.resource.spi.LocalTransactionException: CoherenceRA: Commit failed:
    java.lang.RuntimeException: error with the class: com.apx.instrument.datalayer.data.domain.impl.DOtcInstrumentImpl
    at com.apx.core.datalayer.data.impl.AbstractDomainObject.writeExternal(AbstractDomainObject.java:111)
    at com.tangosol.io.pof.PortableObjectSerializer.serialize(PortableObjectSerializer.java:88)
    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1439)
    at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:338)
    at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2508)
    at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:205)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ConverterValueToBinary.convert(DistributedCache.CDB:3)
    at com.tangosol.util.ConverterCollections$AbstractConverterEntry.getValue(ConverterCollections.java:3333)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.putAll(DistributedCache.CDB:19)
    at com.tangosol.util.ConverterCollections$ConverterMap.putAll(ConverterCollections.java:1570)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap.putAll(DistributedCache.CDB:1)
    at com.tangosol.coherence.component.util.SafeNamedCache.putAll(SafeNamedCache.CDB:1)
    at com.tangosol.coherence.component.util.collections.WrapperMap.putAll(WrapperMap.CDB:1)
    at com.tangosol.coherence.component.util.DeltaMap.resolve(DeltaMap.CDB:9)
    at com.tangosol.coherence.component.util.deltaMap.TransactionMap.commit(TransactionMap.CDB:1)
    at com.tangosol.coherence.component.util.TransactionCache.commit(TransactionCache.CDB:14)
    at com.tangosol.coherence.component.util.transactionCache.Local.commit(Local.CDB:1)
    at com.tangosol.coherence.ra.component.connector.resourceAdapter.cciAdapter.CacheAdapter$ManagedConnection$LocalTransaction.commit(CacheAdapter.CDB:25)
    at weblogic.connector.security.layer.AdapterLayer.commit(AdapterLayer.java:570)
    at weblogic.connector.transaction.outbound.NonXAWrapper.commit(NonXAWrapper.java:84)
    at weblogic.transaction.internal.NonXAServerResourceInfo.commit(NonXAServerResourceInfo.java:330)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:2251)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:270)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
    at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:283)
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:374)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    Hi SR-APX
    The problem is that even though you are using the JCA adaptor Coherence (pre-3.6) is not really transactional. Once you commit all that data is still being pushed out to the distributed cluster members who all work independently. An error on one member will not stop data being written successfully to others.
    In Coherence 3.6 there are real transactions but you would need to see if the limitations on them fit your use-cases.
    JK

  • Java.io.NotSerializableException when using POF over Extend

    I changed a class to use POF and it seems to work fine among TCMP cluster members but when apps connect with Extend I get an exception indicating that maybe either the extend proxy or client app is not correctly configured to use POF.
    (Wrapped) java.io.NotSerializableException: dj_quotes.DJ_Quote
            at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
            at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:22)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.post(Peer.CDB:23)
            at com.tangosol.coherence.component.net.extend.Channel.post(Channel.CDB:25)
            at com.tangosol.coherence.component.net.extend.Channel.send(Channel.CDB:6)
            at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:55)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer$DaemonPool$WrapperTask.run(Peer.CDB:9)
            at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
            at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:63)
            at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
            at java.lang.Thread.run(Thread.java:662)
    Caused by: java.io.NotSerializableException: dj_quotes.DJ_Quote
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
            at com.tangosol.util.ExternalizableHelper.writeSerializable(ExternalizableHelper.java:2252)
            at com.tangosol.util.ExternalizableHelper.writeObjectInternal(ExternalizableHelper.java:2696)
            at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2600)
            at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:210)
            at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.CacheServiceProxy$ConverterToBinary.convert(CacheServiceProxy.CDB:3)
            at com.tangosol.util.ConverterCollections$AbstractConverterEntry.getValue(ConverterCollections.java:3547)
            at com.tangosol.io.pof.PofBufferWriter.writeMap(PofBufferWriter.java:1977)
            at com.tangosol.coherence.component.net.extend.message.Response.writeExternal(Response.CDB:23)
            at com.tangosol.coherence.component.net.extend.message.response.PartialResponse.writeExternal(PartialResponse.CDB:1)
            at com.tangosol.coherence.component.net.extend.Codec.encode(Codec.CDB:23)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.encodeMessage(Peer.CDB:23)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.acceptor.TcpAcceptor.encodeMessage(TcpAcceptor.CDB:8)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:16)
            ... 9 moreLooks like it failed while attempting default serialization, right?
    My extend proxy servers start with
    -Dtangosol.coherence.cacheconfig=cache-config-extend-proxy.xml
    here:
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <!-- ***********  SCHEME MAPPINGS  ***********  -->
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>quotes.*</cache-name>
                   <scheme-name>quotes-scheme</scheme-name>
              </cache-mapping>   
         </caching-scheme-mapping>
         <!-- ******************************** -->
         <caching-schemes>
              <proxy-scheme>
          <service-name>ExtendTcpProxyService</service-name>
          <thread-count>8</thread-count>
          <acceptor-config>
            <tcp-acceptor>
              <local-address>
                <address system-property="tangosol.coherence.proxy.address">localhost</address>
                <port system-property="tangosol.coherence.proxy.port">9090</port>
              </local-address>
            </tcp-acceptor>
          </acceptor-config>
          <proxy-config>
                  <cache-service-proxy>
                    <lock-enabled>true</lock-enabled>
                  </cache-service-proxy>
                </proxy-config>
          <autostart>true</autostart>
        </proxy-scheme>
              <distributed-scheme>
                   <scheme-name>quotes-scheme</scheme-name>
                   <service-name>DistributedQuotesCacheService</service-name>
                   <serializer>
                        <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                        <init-params>
              <init-param>
                <param-type>string</param-type>
                <param-value system-property="pof.config">z:/coherence/pof-config.xml</param-value>
              </init-param>
            </init-params>
                   </serializer>
                   <backing-map-scheme>
                        <local-scheme/>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
    </caching-schemes>
    </cache-config>extend client apps start with
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    here:
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <!-- ***********  SCHEME MAPPINGS  ***********  -->
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>quotes.*</cache-name>
                   <scheme-name>extend-scheme</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <!-- ******************************** -->
         <caching-schemes>
              <remote-cache-scheme>
                    <scheme-name>extend-scheme</scheme-name>
                    <service-name>ExtendTcpCacheService</service-name>
                    <initiator-config>
                    <tcp-initiator>
              <remote-addresses>
                 <socket-address>
                  <address>192.168.3.6</address>
                  <port>9090</port>
                </socket-address>
              </remote-addresses>
              <connect-timeout>12s</connect-timeout>
            </tcp-initiator>
            <outgoing-message-handler>
              <request-timeout>6s</request-timeout>
            </outgoing-message-handler>
          </initiator-config>
        </remote-cache-scheme>
              <!-- ALSO TRIED THIS IN PLACE OF extend-scheme -->
                    <remote-cache-scheme>
          <scheme-name>extend-scheme-pof</scheme-name>
          <service-name>ExtendPofTcpCacheService</service-name>
                   <serializer>
                        <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                        <init-params>
              <init-param>
                <param-type>string</param-type>
                <param-value system-property="pof.config">z:/coherence/pof-config.xml</param-value>
              </init-param>
            </init-params>
                   </serializer>
          <initiator-config>
            <tcp-initiator>
              <remote-addresses>
                <!-- mothra -->
                 <socket-address>
                  <address>192.168.3.6</address>
                  <port>9090</port>
                </socket-address>
              </remote-addresses>
              <connect-timeout>12s</connect-timeout>
            </tcp-initiator>
            <outgoing-message-handler>
              <request-timeout>6s</request-timeout>
            </outgoing-message-handler>
          </initiator-config>
        </remote-cache-scheme>
    </caching-schemes>
    </cache-config>pof-config.xml should be fine...
    <!DOCTYPE pof-config SYSTEM "pof-config.dtd">
    <pof-config>
      <user-type-list>
        <include>coherence-pof-config.xml</include>
        <user-type>
          <type-id>10001</type-id>
          <class-name>dj_quotes.DJ_Quote</class-name>
        </user-type>
      </user-type-list>
    </pof-config>Any ideas what I missed?
    Thanks,
    Andrew

    Looks like I spoke too soon. Moving the <serializer> to the correct location in the Extend client XML config did fix the problem I was seeing but it created a new problem. It appears the Extend client wants to use POF for everything including non-POF services like the one handling the Serializable (non-POF) object oms.Order. That's what I gather from this exception
    Exception in thread "AWT-EventQueue-0" (Wrapped) java.io.IOException: unknown user type: oms.Order
            at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
            at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:22)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.post(Peer.CDB:23)
            at com.tangosol.coherence.component.net.extend.Channel.post(Channel.CDB:25)
            at com.tangosol.coherence.component.net.extend.Channel.request(Channel.CDB:18)
            at com.tangosol.coherence.component.net.extend.Channel.request(Channel.CDB:1)
            at com.tangosol.coherence.component.net.extend.RemoteNamedCache$BinaryCache.putAll(RemoteNamedCache.CDB:10)
            at com.tangosol.util.ConverterCollections$ConverterMap.putAll(ConverterCollections.java:1702)
            at com.tangosol.coherence.component.net.extend.RemoteNamedCache.putAll(RemoteNamedCache.CDB:1)
            at com.tangosol.coherence.component.util.SafeNamedCache.putAll(SafeNamedCache.CDB:1)
            at oms.Order.sendMultiple(Order.java:357)
            at order_entry_window.OrderEntryPanel$SubmitListener.sendOrder(OrderEntryPanel.java:1307)
            at order_entry_window.OrderEntryPanel$SubmitListener.actionPerformed(OrderEntryPanel.java:1321)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
            at java.awt.Component.processMouseEvent(Component.java:6504)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
            at java.awt.Component.processEvent(Component.java:6269)
            at java.awt.Container.processEvent(Container.java:2229)
            at java.awt.Component.dispatchEventImpl(Component.java:4860)
            at java.awt.Container.dispatchEventImpl(Container.java:2287)
            at java.awt.Component.dispatchEvent(Component.java:4686)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
            at java.awt.Container.dispatchEventImpl(Container.java:2273)
            at java.awt.Window.dispatchEventImpl(Window.java:2713)
            at java.awt.Component.dispatchEvent(Component.java:4686)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
            at java.awt.EventQueue.access$000(EventQueue.java:101)
            at java.awt.EventQueue$3.run(EventQueue.java:666)
            at java.awt.EventQueue$3.run(EventQueue.java:664)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
            at java.awt.EventQueue$4.run(EventQueue.java:680)
            at java.awt.EventQueue$4.run(EventQueue.java:678)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    Caused by: java.io.IOException: unknown user type: oms.Order
            at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:341)
            at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2596)
            at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:210)
            at com.tangosol.coherence.component.net.extend.RemoteNamedCache$ConverterToBinary.convert(RemoteNamedCache.CDB:4)
            at com.tangosol.util.ConverterCollections$AbstractConverterEntry.getValue(ConverterCollections.java:3547)
            at com.tangosol.io.pof.PofBufferWriter.writeMap(PofBufferWriter.java:1977)
            at com.tangosol.coherence.component.net.extend.messageFactory.NamedCacheFactory$PutAllRequest.writeExternal(NamedCacheFactory.CDB:3)
            at com.tangosol.coherence.component.net.extend.Codec.encode(Codec.CDB:23)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.encodeMessage(Peer.CDB:23)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:16)
            ... 47 more
    Caused by: java.lang.IllegalArgumentException: unknown user type: oms.Order
            at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:420)
            at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:409)
            at com.tangosol.io.pof.PofBufferWriter.writeUserType(PofBufferWriter.java:1660)
            at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1622)
            at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:335)
            ... 56 moreSo I posted a follow-up question here:
    Can an extend client use both POF and java.io.Serializable?
    Thanks,
    Andrew

  • Why can i not get back on pof not done a thing wrong

    I deleted my acount off pof I want to go back on but it will not let me and I have not done any think wrong so how do I get back on it thankyou

    hello goddie, please contact the support channels of the website in question. this is not an issue where we - the support for the firefox browser - can be of any help. thanks for your understanding!

  • How to create multiple pof configuration files for c# client

    Is there a way to have multiple pof files for c# coherence client?
    Can I create a file called my-pof-config.xml with the following line...
    <pof-config xmlns="http://schemas.tangosol.com/pof">
    <user-type-list>
    <include>assembly://Coherence/Tangosol.Config/coherence-pof-config.xml</include>
         <include>file://pof-config.xml</include>
    and here is what pof-config.xml file look like
    <?xml version="1.0" encoding="UTF-8"?>
    <pof-config xmlns="http://schemas.tangosol.com/pof">
    <user-type-list>
    In my C# visual studio project, this is where I load my-pof-config.xml in app.config
    <coherence>
    <cache-factory-config>coherence.xml</cache-factory-config>
    <cache-config>coherence-cache-config.xml</cache-config>
    <pof-config>my-pof-config.xml</pof-config>
    </coherence>
    and this is what I saw in the log...
    2012-02-23 14:35:35,529 DEBUG Coherence (null) - 2012-02-23 14:35:35.529 level(thread=System.Threading.Thread): Loaded POF configuration from "FileResource(Uri = file://my-pof-config.xml, AbsolutePath = D:\worktrees\ads\mainline\v2\ads\demos_cs\build\my-pof-config.xml)"
    2012-02-23 14:35:35,545 DEBUG Coherence (null) - 2012-02-23 14:35:35.545 level(thread=System.Threading.Thread): Loaded included POF configuration from "EmbeddedResource(Uri = assembly://Coherence/Tangosol.Config/coherence-pof-config.xml, AbsolutePath = assembly://Coherence/Tangosol.Config/coherence-pof-config.xml)"
    2012-02-23 14:35:35,623 DEBUG Coherence (null) - 2012-02-23 14:35:35.623 level(thread=ExtendTcpCacheServiceCSharp:TcpInitiator): Loaded POF configuration from "FileResource(Uri = file://my-pof-config.xml, AbsolutePath = D:\worktrees\ads\mainline\v2\ads\demos_cs\build\my-pof-config.xml)"
    I don't see pof-config.xml is loaded at "Loaded included POF configuration....". How do I get around it so I can load multiple pof configuration files for c# client?

    Hi,
    Not sure about C# but I would suggest try removing file:// from
    <include>file://pof-config.xml</include>and keep pof-config.xml and my-pof-config.xml in the same directory.
    Hope this helps!
    Cheers,
    NJ

  • Strange issue with POF: byte array with the value 94

    This is a somewhat strange issue we’ve managed to reduce to this test case. We’ve also seen similar issues with chars and shorts as well. It’s only a problem if the byte value inside the byte array is equal to 94! A value of 93, 95, etc, seems to be ok.
    Given the below class, the byte values both in the array and the single byte value are wrong when deserializing. The value inside the byte array isn’t what we put in (get [75] instead of [94]) and the single byte value is null (not 114).
    Pof object code:
    package com.test;
    import java.io.IOException;
    import java.util.Arrays;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.io.pof.PortableObject;
    public class PofObject1 implements PortableObject {
         private byte[] byteArray;
         private byte byteValue;
         public void setValues() {
              byteArray = new byte[] {94};
              byteValue = 114;
         @Override
         public void readExternal(PofReader reader) throws IOException {
              Object byteArray = reader.readObjectArray(0, null);
              Object byteValue = reader.readObject(1);
              System.out.println(Arrays.toString((Object[])byteArray));
              System.out.println(byteValue);
              if (byteValue == null) throw new IOException("byteValue is null!");
         @Override
         public void writeExternal(PofWriter writer) throws IOException {
              writer.writeObject(0, byteArray);
              writer.writeObject(1, byteValue);
    Using writer.writeObjectArray(0, byteArray); instead of writer.writeObject(0, byteArray); doesn't help. In this case byteArray would be of type Object[] (as accessed through reflection).
    This is simply put in to a distributed cache and then fetched back. No EPs, listeners or stuff like that involved:
         public static void main(String... args) throws Exception {
              NamedCache cache = CacheFactory.getCache("my-cache");
              PofObject1 o = new PofObject1();
              o.setValues();
              cache.put("key1", o);
              cache.get("key1");
    Only tried it with Coherecne 3.7.1.3.
    Cache config file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>my-cache</cache-name>
                   <scheme-name>my-cache</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <distributed-scheme>
                   <scheme-name>my-cache</scheme-name>
                   <service-name>my-cache</service-name>
                   <serializer>
                        <class-name>
                             com.tangosol.io.pof.ConfigurablePofContext
                        </class-name>
                        <init-params>
                             <init-param>
                                  <param-type>string</param-type>
                                  <param-value>pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <lease-granularity>thread</lease-granularity>
                   <thread-count>10</thread-count>
                   <backing-map-scheme>
                        <local-scheme>
                        </local-scheme>
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
         </caching-schemes>
    </cache-config>
    POF config file:
    <?xml version="1.0"?>
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
         xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
         <user-type-list>
              <!-- coherence POF user types -->
              <include>coherence-pof-config.xml</include>
              <user-type>
                   <type-id>1460</type-id>
                   <class-name>com.test.PofObject1</class-name>
              </user-type>
         </user-type-list>
    </pof-config>

    Hi,
    POF uses certain byte values as an optimization to represent well known values of certain Object types - e.g. boolean True and False, some very small numbers, null etc... When you do read/write Object instead of using the correct method I suspect POF gets confused over the type and value that the field should be.
    There are a number of cases where POF does not know what the type is - Numbers would be one of these, for example if I stored a long of value 10 on deserialization POF would not know if that was an int, long double etc... so you have to use the correct method to get it back. Collections are another - If you serialize a Set all POF knows is that you have serialized some sort of Collection so unless you are specific when deserializing you will get back a List.
    JK

Maybe you are looking for

  • Desktop will not boot. (hp pavilion p7-1000c)

    purchased refurbished desktop. It will not boot up.  error: no boot disk has been detected or disk has failed. This question was solved. View Solution.

  • How can i get my n97 back to work properly?

    Hi everybody! I need some help, i don't know what to do with my n97... I have updated its firmware every time was needed, i've done a lot of hard resets, i've free a lot of space in C, a lot of RAM memory and....it keeps randomly freezing!! After six

  • ITunes cannot read the contents of the iPhone/iPad -restore to factory set

    I've had this issue with my iPhone for almost a year now , every time I connect my device to my laptop I get this error : iTunes cannot read the contents of the iPhone/iPad . Go to summary tab in your device and restore to factory settings ! And afte

  • Exploding Pics

    First post to this forum and I haven't looked for a way to search it, so if I'm asking a common question . . .. When I now double click a photo to enlarge it, it explodes. There is a pause and then a black screen with a gray-white circle in the middl

  • How can I get my ipod to sync on my new laptop?

    I have downloaded the latest version of itunes on my new laptop and my ipod won't sync, it does not seem to be recognised by itunes tho' it is in my computer. I have reset the ipod but that hasn't worked. I have been advised to restore my ipod to its