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

Similar Messages

  • Question related to POF configuration and use-subclasses

    Hi,
    I noticed that the default POF configuration in coherence.jar (coherence-pof-config.xml) forces the use-subclasses flag to true (the ultimate use-subclasses value is true if whichever loaded POF configuration file specifies it to be true), and thus making it impossible to get error messages if a certain subclass of a registered type is not registered specifically in the POF-configuration, and users may silently lose data this way.
    My question is:
    Is the use-subclasses flag in the coherence-pof-config.xml set to true only because of Throwable-s, or are there other Coherence-provided classes which are serialized by subclass resolution and thus depend on the use-subclasses flag being true?
    If only the Throwable-s depend on that, then instead of setting it to true, we can set it to false and use the following class instead of ConfigurablePofContext as the Serializer class for the POF-enabled services:
    import com.tangosol.io.pof.ConfigurablePofContext;
    import com.tangosol.run.xml.XmlElement;
    * This class extends ConfigurablePofContext with the possibility to
    * configurably disable the subclass-allowed setting forced true in the
    * coherence-pof-config.xml, and still be able to use ThrowablePofSerializer for
    * each not specifically configured Throwable subclass.
    * @author Robert Varga
    public class ThrowableAwareConfigurablePofContext extends
          ConfigurablePofContext {
        * By setting this flag to true, it is possible to disable subclass
        * resolution. Interface resolution remains untouched.
       private boolean m_fDisableSubclassAllowed;
        * {@inheritDoc}
       public ThrowableAwareConfigurablePofContext() {
        * {@inheritDoc}
        * @param sLocator
       public ThrowableAwareConfigurablePofContext(String sLocator) {
          super(sLocator);
        * {@inheritDoc}
        * @param xml
       public ThrowableAwareConfigurablePofContext(XmlElement xml) {
          super(xml);
        * Sets the {@link #m_fDisableSubclassAllowed} flag. You can set this as an
        * &lt;init-param&gt; in the Coherence cache configuration file.
        * @param disableSubclassAllowed
       public void setDisableSubclassAllowed(boolean disableSubclassAllowed) {
          this.m_fDisableSubclassAllowed = disableSubclassAllowed;
        * @return false if disableSubclassAllowed is true, or result from the super
        *         implementation otherwise.
       @Override
       protected boolean isSubclassAllowed() {
          return (!m_fDisableSubclassAllowed) && super.isSubclassAllowed();
        * If the super implementation could not resolve the type id for the class,
        * and subclass-allowed is disabled and clz is a {@link java.lang.Throwable}
        * subclass then it falls back to the configuration for
        * {@link java.lang.Throwable}.
       @Override
       protected int getInheritedUserTypeIdentifier(Class clz) {
          int result = super.getInheritedUserTypeIdentifier(clz);
          if (result == -1 && !isSubclassAllowed()
                && Throwable.class.isAssignableFrom(clz)) {
             result = getUserTypeIdentifier(Throwable.class);
          return result;
    }Thanks and best regards,
    Robert

    dcarrano wrote:
    Hi Robert,
    If you are only interested in Java you are correct.
    If you need more detail please let me know but I hope this answers your question.
    Best regards,
    -DaveHi Dave,
    I am also interested in other environments, so I need more detail.
    I am looking at the portability of my POF Serializer generator in which I assume that use-subclasses is false, because supporting use-subclasses being true would be quite hard to define, not to mention implement.
    Thanks and best regards,
    Robert

  • 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!

  • Can't setup PofAnnotationSerializer in pof-config.xml

    Hi,
    i have class annotated with @Portable and @PortableProperty, and pof-config.xml for setup serializer:
          <user-type>
             <type-id>1001</type-id>
             <class-name>entity.dto.base.EmployeeBaseDTO</class-name>
             <serializer>
                <class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
                    <init-params>
                    <init-param>
                        <param-type>int</param-type>
                        <param-value>1001</param-value>
                     </init-param>
                     <init-param>
                        <param-type>java.lang.Class</param-type>
                        <param-value>entity.dto.base.EmployeeBaseDTO</param-value>
                     </init-param>
                  </init-params>
             </serializer>
          </user-type>
    While starting Coherence 3.7.1 cluster, I get error:
    Unable to instantiate PofSerializer class: com.tangosol.io.pof.PofAnnotationSerializer (Config=...\pof-config.xml, Type-Id=1001,
    Class-Name=entity.dto.base.EmployeeBaseDTO))
    java.lang.InstantiationException: Could not find a constructor for com.tangosol.io.pof.PofAnnotationSerializer(java.lang.Integer, com.tangosol.run.xml.SimpleElement)
    Why second PofAnnotationSerializer contructor parameter is com.tangosol.run.xml.SimpleElement and not java.lang.Class ?
    BTW setup PofAnnotationSerializer programatically works fine:
    SimplePofContext pofCtx = new SimplePofContext();
    int typeId = 1001;
    pofCtx.registerUserType(typeId, EmployeeBaseDTO.class , new PofAnnotationSerializer<EmployeeBaseDTO>(typeId++, EmployeeBaseDTO.class, true));
    Thanks,
    L.V.

    OK, so to enable auto indexing then yes, you need to specify the serializer in the POF configuration, as it says in the documentation 19.3.3 Enabling Automatic Indexing.
    So in your case the configuration should look like this
          <user-type>
             <type-id>1001</type-id>
             <class-name>entity.dto.base.EmployeeBaseDTO</class-name>
             <serializer>
                <class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
                    <init-params>
                    <init-param>
                        <param-type>int</param-type>
                        <param-value>{type-id}</param-value>
                     </init-param>
                     <init-param>
                        <param-type>class</param-type>
                        <param-value>{class}</param-value>
                     </init-param>
                     <init-param>
                        <param-type>boolean</param-type>
                        <param-value>true</param-value>
                     </init-param>
                  </init-params>
             </serializer>
          </user-type>
    You do not replace the param-values that are inside { } or change the param-type values as these are macros that Coherence will automatically replace with the correct values.
    Regarding your error, I'm not sure if that is related to your original question/issue.
    JK

  • He I have a very basic question regarding reporting of invoice lines and related receiver lines

    The documentation shows that receiver transaction id and receiver shipment header and line id should be joined to the same columns  in AP invoice lines but these columns are not populated. What is the join for Payables and Purchasing 12.0 and beyond. We are on 12.2.4.
    Please advise.

    Yes, he does not want redirects because it is POF. Also, redirects don't stay in address bar (at the one I created) - once the screen loads you see the same long URL in address bar. He says I should be able to create another public name for the website (made of forms and reports). Maybe I should go with MOD_REWRITE module? I am reading about it now and they say it's more like renaming then redirecting and I think that's more like what my boss is looking for. Key question: if I use MOD_REWRITE to redirect, would the original (long) URL string be displayed once the first screen loads? I am trying to avoid that. I need users to type http://virtualserver/welcome and to STAY that way in address bar.
    Thanks.

  • POF serialization with replicated cache?

    Sorry again for the newbie question.
    Can you use POF serialized objects in a replicated cache?
    All of the examples show POF serialized objects being used with a partitioned cache.
    If you can do this, are there any caveats involved with the "replication" cache? I assume it would have to be started using the same configuration as the "master" cache.

    Thanks Rob.
    So, you just start up the Coherence instance on the (or at the) replication site, using the same configuration as the "master"? (Of course with appropriate classpaths and such set correctly)

  • How to config POF to handle inner class

    Hi, I have the following vo object:
    public class Obj implements java.io.Serializable, PortableObject
    public static class InnerObj implements java.io.Serializable, PortableObject
    1) If i put both classes in the pof config xml, it throws class not found exception for the inner class InnerObj (as expected since there is no separate class files for it). My question is what is the correct way to handle the inner class? Should i just leave it out of the pof config xml and coherence will be smart enough to handle it?
    <pof-config>
    <user-type-list>
    <user-type>
    <type-id>111</type-id>
    <class-name>some.package.Obj</class-name>
    </user-type>
    <user-type>
    <type-id>222</type-id>
    <class-name>some.package.InnerObj</class-name>
    </user-type>
    </user-type-list>
    </pof-config>
    2) Also want to confirm if implement both java.io.Serializable & PortableObject in the vo, coherence will ALWAYS take the portable object serialization if <pof-enabled>true</pof-enabled> is set in the config?
    thanks!

    Hi i got the inner class config to work but now struggling to get it to run from the java client that connects to the cache. Went through the documents, it only made me more confused, so many config files...
    The exception i am getting now is from the java application that connects to the cache, when it tried to do a cache.putAll() it's throwing the following exception:
    An exception occurred while encoding a PutAllRequest for Service=ExtendTcpCacheService:TcpInitiator: java.io.IOException: unknown user type: some.package.Obj
    So far I have done the below to enable POF:
    1) On cache server I made the below changes, and both the cacheserver and extendproxy are running fine now.
    - changed xml to: <pof-enabled>true</pof-enabled>
    - dropped the jar containing the pof objects in the classpath
    - added override pof config xml:
    <pof-config>
    <user-type-list>
    <user-type>
    <type-id>8888</type-id>
    <class-name>some.package.Obj</class-name>
    </user-type>
    <user-type>
    <type-id>8889</type-id>
    <class-name>some.package.Obj$InnerObj</class-name>
    </user-type>
    </user-type-list>
    </pof-config>
    2) On the java project that connects to the cache:
    - changed -Dtangosol.coherence.cacheconfig xml file and added:
    <defaults>
    <serializer>pof</serializer>
    </defaults>
    I am sure i am missing some config somewhere, thank you for your help.
    Edited by: 920558 on Mar 28, 2012 2:15 PM

  • POF & Invokable

    Hi,
    I am trying to make all invokable objects in my application POF. However when I call                
    Map mapQuery = service.query(task, setMembers);
    the remote node is getting exceptions. What it looks like is that the client making the call is not sending the invokable object in POF. in fact, I did verify that my writeExernal(PofWriter out) is not getting called. I noticed that the Invokable interface implements Serializable. Is that causing an issue?? The remote node is trying to read in in POF. So my initial question is, should invocation be able to do POF? If so, any ideas as to why this is not working. Here is the stack trace from the remote node.
    2008-09-16 09:43:20.275 Oracle Coherence GE 3.4/403 Release Candidate 3 <Error> (thread=Invocation:InvocationService, member=1): Terminating InvocationService due to unhandled exception: java.lang.IllegalStateException
    2008-09-16 09:43:20.275 Oracle Coherence GE 3.4/403 Release Candidate 3 <Error> (thread=Invocation:InvocationService, member=1):
    java.lang.IllegalStateException: type=-7349
    at com.tangosol.io.pof.PofHelper.skipUniformValue(PofHelper.java:1146)
    at com.tangosol.io.pof.PofHelper.skipValue(PofHelper.java:938)
    at com.tangosol.io.pof.PofBufferReader$UserTypeReader.readRemainder(PofBufferReader.java:3510)
    at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:156)
    at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
    at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3284)
    at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2599)
    at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:348)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:4)
    at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService$InvocationRequest.read(InvocationService.CDB:8)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:117)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:37)
    at java.lang.Thread.run(Thread.java:619)
    2008-09-16 09:43:20.276 Oracle Coherence GE 3.4/403 Release Candidate 3 <D5> (thread=Invocation:InvocationService, member=1): Service InvocationService left the cluster
    2008-09-16 09:43:24.603 Oracle Coherence GE 3.4/403 Release Candidate 3 <Info> (thread=main, member=1): Restarting Service: InvocationService
    2008-09-16 09:43:24.621 Oracle Coherence GE 3.4/403 Release Candidate 3 <D5> (thread=Invocation:InvocationService, member=1): Service InvocationService joined the cluster with senior service member 2

    Here it is.
    import java.io.IOException;
    import com.tangosol.io.pof.EvolvablePortableObject;
    import com.tangosol.io.pof.PofReader;
    import com.tangosol.io.pof.PofWriter;
    import com.tangosol.net.AbstractInvocable;
    import com.tangosol.util.Binary;
    * A runnable task used to report information about a cluster node's VM.
    * @author erm 2003.09.12
    * @author jh 2004.10.06
    * @see AbstractInvocable
    * @version 2.5
    public class ReportTask extends AbstractInvocable implements
              EvolvablePortableObject {
         static final long serialVersionUID = -7945927591486291724L;
         Object result;
         // Evolvable members
         private int version;
         private Binary binaryData;
         public ReportTask() {
         // ----- Invocable interface ----------------------------------------------
          * Called exactly once by the InvocationService to invoke this Invocable
          * object.
         public void run() {
              System.out.println("IN REPORT TASK INVOKED with POF");
              // get runtime stats, including free and total VM memory
              Runtime runtime = Runtime.getRuntime();
              long free = runtime.freeMemory();
              long total = runtime.totalMemory();
              NodeInfo nodeInfo = new NodeInfo(free, total);
              // set the result of the invocation
              setResult(nodeInfo);
         public int getDataVersion() {
              return version;
         public void setDataVersion(int nVersion) {
              version = nVersion;
         public Binary getFutureData() {
              return binaryData;
         public void setFutureData(Binary binFuture) {
              binaryData = binFuture;
         public int getImplVersion() {
              return 1;
         public void writeExternal(PofWriter out) throws IOException {
              System.out.println("IN WRITEEXTERNAL.. REPORTTASK");
         public void readExternal(PofReader in) throws IOException {
              System.out.println("IN READEXTERNAL.. REPORTTASK");
    }

  • Error : com.adobe.pof.POFException

    Hi All,
    I am getting this error repeated on JBoss with MS SQL 2005 server and I think due to this some of my short lived processes are not working as expected.
    2012-03-30 15:09:03,510 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract com.adobe.pof.omapi.POFObjectSet com.adobe.pof.omapi.POFObjectManagerLocal.retrieveObjectSet(com.adobe.pof.omapi.POFQuery, int,int,com.adobe.idp.Context) throws com.adobe.pof.POFException:
    com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 79) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    Can anyone please help me to understand this error.
    Regards-
    Chalukya.

    Yes, you are correct. This is caused when I try to start the first member of the cluster and do the bootstraping.
    The installation & bootstrapping is completed now anyways. I understood something from the installation.
    "If we don't run the TCP locators first before running the jboss, the instance is not running properly and failing while bootstrapping too"
    One more question related to this. After the installation I configured the load-balancing using MOD_JK.
    Followed all the steps as mentioned in the documentation. Now the URLs are
    http://lces1:8080 (JBoss instance 1)
    http://lces2:8080 (JBoss instance 2)
    http://lces (Apache)
    I don’t know how to proceed from there. The users must have a single URL to launch the application. However if I try using http://lces/workspace which is not working.

  • C++ primitive versus Coherence Primitive POF encoding

    I was wondering if anyone can shed some light on the differences b/w POF encoding of C++ primitives vs encoding of Coherence Primitive.
    I've noticed using Coherence Primitives retain both type & value allowing readObject() to work as expected, whereas there are nuances where only the value is retained when using primitives.
    * Is there an inherent difference as to how primitive types are POF encoded versus Coherence Primitives ? ie. Do they both use packed optimizations? Are Coherence Primitives encoded as a Type which contains the primitive type, or are they both encoded the same.
    * Is it possible for readObject() to infer the correct types from the stream, or must the type definition always be implicit. ie. The deserializer and serializer must always agree on read/write methods. How is readObject() affected by the optimizations?
    * The return type and name of the function readObject() implies it only deals with objects, but its documentation states it reads a property of ANY type including a user type from the stream. How does it internally handle primitive types? ie. If it encounters a primitive in the stream, does readObject() wrap it in a (correct) Coherence Primitive?
    * Is there any cross-language implications when using Coherence Primitives?

    Hi Mark,
    For those who may be confused by what a "Coherence Primitive" is I'll clarify. The coherence::lang::Primitive<T> template class is a common template base class used for building up wrapper classes for C++ primitive types such as bool, int32_t, int64_t. For instance the coherence::lang::Integer32 class extends Primitive<int32_t>, and works similar to the relationship between int and java.lang.Integer in Java. Primitive<> extends from coherence::lang::Object class which is the root of our manage object class hierarchy. As with Coherence for Java these primitive wrappers are POF serializable. In fact the description I give here applies equally to our Java and C++ extend clients.
    Language primitives and primitive wrappers are bit for bit identical when serialized in POF format. There is however a subtle but important difference. For some values PofWriter may choose to entirely optimize out the value from the byte stream, and this does differ between the primitives and wrappers. The basic rule is that primitives can be optimized out of the POF stream entirely when writing the types default 'zero' value, and this is not true for the wrapper types. For instance:
    hWriter->writeInt32(PROP_ID_BLAH, 0); // this will be a noop
    This will be a noop, and the corresponding readInt32() call will treat the lack of a property in the POF stream as a zero value.
    int32_t nVal = hReader->readInt32(PROP_ID_BLAH); // will return 0
    However if you were to write out the corresponding wrapper object a zero would be written to the stream.
    hWriter->writeObject(PROP_ID_BLAH, Integer32::create(0)); // writes a zero to the stream
    Integer32::View vnVal = cast<Integer32::View>(hReader->readObject(PROP_ID_BLAH)); // will return an Integer32 representing zero
    This optimization works beautifully so long as the reader and writer are symmetric, using either the same type of methods for a given property. If you mix and for instance use writeInt32, and then readObject, you can see some surprising results. For instance zero's come out as NULLs, and all other numeric types (such as Integer64 or Float32/64) will come out as Integer32 for certain small numeric values. This has caused us some issues with the initial release of PofExtractor which always returns Objects, and as such will show behavior similar to the above when the primitive based writer methods were used during serialization. This fix for this specific issue will be made available soon in an upcoming 3.5 service pack.
    So this leaves the question what method should you use for writing primitives. I would say that in the vast majority of cases it would be preferable to use the primitive variants, rather then writing the wrapper object via writeObject(). The biggest advantage of this is that it avoids the unneeded object creation. The primary benefit of using writeObject() for the wrappers is that it gives you one additional value, i.e. NULL. So for instance which writeBoolean() can only communicate one of two values (true, false), writeObject() passing a Boolean, can communicate one of three values (true, false, NULL). Outside of that writeObject() on a primitive wrapper is also beneficial for generic code which doesn't know the type of the object being serialized.
    I suppose the docs for writeObject need some cleanup. This method supports the serialization of any type which extends from coherence::lang::Object, and has a registered POF serializer.
    To answer your final question the two variants produce language neutral POF streams, and can be read from Java and .NET just fine.
    hope that helps,
    Mark
    Oracle Coherence

  • Why I need the same pof conf on client+srver if Coherence is used as cache?

    Hi,
    I have first defined my own pof-config.xml only on my client.
    And Coherence wrote me a very ackward msg: "StreamCorruptedException unknown user type 6" !!!????
    I have made another try, while defining my own pof-config.xml on my servers too !
    Then, Coherence has worked smoothly, as expected.
    QUESTION: as I use Coherence as a cache, using no index, no EP... I expect Coherence is not going to dig into my byte[] for the 'server' nodes.
    Then, I expect only the clients have to serialize/deserialize, I expect they send the byte[], and the servers store only them, that is, without needing any pof config.
    If it works as I have written, why Coherence is not working ("StreamCorruptedException unknown user type 6"), if I define my own pof-config.xml only on my client ?
    Thanks.
    Regards,
    Dominique

    Hi Dominique,
    user4947403 wrote:
    Hi Robert,
    robvarga wrote:
    Hi Dominique,
    Coherence does not know what you will do with the data. It has to assume that you may want to send an entry-processor or entry aggregator or query the items with a filter, or you may simply want to get the item from the cache WITHIN the cluster not only via Extend. imho, I feel it as counter-intuitive.
    I have expected something like: as far as no EP is run, no pof config is searched+if no pof config exists in order to deserialize when needed, raise an exception.
    1. There is no such thing as no config. If you don't specify an explicit configuration, default configuration is used, which (depending on whether POF is globally enabled or not) is either a DefaultSerializer, or a ConfigurablePofContext loading stuff from pof-config.xml.
    2. If some data travels across the proxy connection, it has to travel in the serialization format configured for the proxy service. If you put data into a cache, it has to travel on the network in the serialization format configured for the cache service of the cache. Period.
    If this rule was not followed, Coherence would not know what serialization format any piece of data has. Therefore as mentioned below, if the proxy service serialization configuration differs from the cache service serialization configuration, data has to be de- and reserialized on the proxy.
    Again, imagine the case if your logic were followed: Just because you used some service to put data into the cache, Coherence cannot know that you will use the same service to get the data back. If some code inside the cluster tried to deserialize it, it would fail as it has no idea, that it was serialized with the proxy serialization format. It actually doesn't even have an idea that the data came from the proxy, or even that there is a proxy. Also, if you used some other code to put data into the cache which is not coming via the proxy, you would have another piece of data sitting in the cache which was not serialized by the proxy serialization format. If you tried to retrieve that via the TCP*Extend, you could not deserialize it on the client as it is not in the serialization format used by the proxy. Moreover, the client does not even have any chance of even knowing what it was serialized with as the client does not even see the serialization configuration of services inside the cluster.
    Because of this it has to ensure that it can deserialize it with the serializer configured for the cache service within the cluster, so not with the one used for TCP*Extend.Well, in my case, my client is a cluster node+localstorage=false => are the explanations you wrote ok for this case too ?
    It does not matter how your cluster looks like at the moment when you consider consistency checks. Nothing prevents you to start another cluster node, therefore Coherence cannot be lenient in the service configuration consistency checks just before .
    By the way, if you have only a single storage-disabled cluster node (and that means that no cache server node is running) and you tried to put something into a distributed cache then if the serialization error did not happen because you have correct configuration, then you would have received a Storage not configured error instead, as no cache server node is running to actually store your data.
    So if you did not get any errors, then you were either putting the data into a replicated cache where being storage-disabled is not relevant as that is a distributed cache setting, or you had a cache server node running or you only believed that the node was storage disabled.
    Best regards,
    Robert

  • Reloading POF context -- broken integration tests

    Adding in POF support has broken our integration tests. Each test passes by itself, but running the suite causes some to fail. Based on the log messages, it looks like one test A loads the default POF config from the coherence jar. Then test B sets tangosol.pof.config to a file that contains user types, but test B fails because the user type is not recognized. We call CacheFactory.shutdown() after every test, so I would expect the POF config to be fully reloaded.
    My question is: how can I reload the POF context so it will use the current tangosol.pof.config value?
    Here's the source for a junit test that reproduces the problem. It fails on the assertion in bold.
    public class ReloadPofConfigTest
    private static final String CACHE_NAME = "SearchResultCache";
    @Test
    public void pofContextShouldBeReconfigurable()
    ConfigurablePofContext pofContext pofContext = getPofContext(CacheFactory.getCache(CACHE_NAME));
    assertFalse(pofContext.isUserType(PortableSearchFuture.class));
    CacheFactory.shutdown();
    System.setProperty("tangosol.coherence.cluster", "SearchResultCache-local");
    System.setProperty("tangosol.coherence.ttl", "0");
    System.setProperty("tangosol.pof.config", "search-pof-config.xml");
    pofContext = getPofContext(CacheFactory.getCache(CACHE_NAME));
    assertTrue(pofContext.isUserType(PortableSearchFuture.class));
    CacheFactory.shutdown();
    public static ConfigurablePofContext getPofContext(NamedCache cache)
    Serializer serializer = cache.getCacheService().getSerializer();
    assertEquals(ConfigurablePofContext.class, serializer.getClass());
    ConfigurablePofContext pofContext = (ConfigurablePofContext) serializer;
    return pofContext;
    }

    Hi user10646670,
    If you change your configuration to
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
        <caching-scheme-mapping>
            <cache-mapping>
                <cache-name>SearchResultCache</cache-name>
                <scheme-name>search-result-cache</scheme-name>
            </cache-mapping>
        </caching-scheme-mapping>
        <caching-schemes>
            <distributed-scheme>
                <scheme-name>search-result-cache</scheme-name>
                <backing-map-scheme>
                    <local-scheme/>
                </backing-map-scheme>
                <autostart>true</autostart>
                <serializer>
                    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                    <init-params>
                        <init-param>
                            <param-type>string</param-type>
                            <param-value system-property="my.pof.config">coherence-pof-config.xml</param-value>
                        </init-param>
                    </init-params>
                </serializer>
            </distributed-scheme>
            <local-scheme>
                <scheme-name>search-result-local-cache</scheme-name>
            </local-scheme>
        </caching-schemes>
    </cache-config>and use my.pof.config system property in your test:
    System.setProperty("my.pof.config", "search-pof-config.xml");it should work.
    Regards,
    Dimitri

  • Questions on Print Quote report

    Hi,
    I'm fairly new to Oracle Quoting and trying to get familiar with it. I have a few questions and would appreciate if anyone answers them
    1) We have a requirement to customize the Print Quote report. I searched these forums and found that this report can be defined either as a XML Publisher report or an Oracle Reports report depending on a profile option. Can you please let me know what the name of the profile option is?
    2) When I select the 'Print Quote' option from the Actions drop down in the quoting page and click Submit I get the report printed and see the following URL in my browser.
    http://<host>:<port>/dev60cgi/rwcgi60?PROJ03_APPS+report=/proj3/app/appltop/aso/11.5.0/reports/US/ASOPQTEL.rdf+DESTYPE=CACHE+P_TCK_ID=23731428+P_EXECUTABLE=N+P_SHOW_CHARGES=N+P_SHOW_CATG_TOT=N+P_SHOW_PRICE_ADJ=Y+P_SESSION_ID=c-RAuP8LOvdnv30grRzKqUQs:S+P_SHOW_HDR_ATTACH=N+P_SHOW_LINE_ATTACH=N+P_SHOW_HDR_SALESUPP=N+P_SHOW_LN_SALESUPP=N+TOLERANCE=0+DESFORMAT=RTF+DESNAME=Quote.rtf
    Does it mean that the profile in our case is set to call the rdf since it has reference to ASOPQTEL.rdf in the above url?
    3) When you click on submit button do we have something like this in the jsp code: On click call ASOPQTEL.rdf. Is the report called using a concurrent program? I want to know how the report is getting invoked?
    4) If we want to customize the jsp pages can you please let me know the steps involved in making the customizations and testing them.
    Thanks and Appreciate your patience
    -PC

    1) We have a requirement to customize the Print Quote report. I searched these forums and found that this report can be defined either as a XML Publisher report or an Oracle Reports report depending on a profile option. Can you please let me know what the name of the profile option is?
    I think I posted it in one of the threads2) When I select the 'Print Quote' option from the Actions drop down in the quoting page and click Submit I get the report printed and see the following URL in my browser.
    http://<host>:<port>/dev60cgi/rwcgi60?PROJ03_APPS+report=/proj3/app/appltop/aso/11.5.0/reports/US/ASOPQTEL.rdf+DESTYPE=CACHE+P_TCK_ID=23731428+P_EXECUTABLE=N+P_SHOW_CHARGES=N+P_SHOW_CATG_TOT=N+P_SHOW_PRICE_ADJ=Y+P_SESSION_ID=c-RAuP8LOvdnv30grRzKqUQs:S+P_SHOW_HDR_ATTACH=N+P_SHOW_LINE_ATTACH=N+P_SHOW_HDR_SALESUPP=N+P_SHOW_LN_SALESUPP=N+TOLERANCE=0+DESFORMAT=RTF+DESNAME=Quote.rtf
    Does it mean that the profile in our case is set to call the rdf since it has reference to ASOPQTEL.rdf in the above url?
    Yes, your understanding is correct.3) When you click on submit button do we have something like this in the jsp code: On click call ASOPQTEL.rdf. Is the report called using a concurrent program? I want to know how the report is getting invoked?
    No, there is no conc program getting called, you can directly call a report in a browser window, Oracle reports server will execute the report and send the HTTP response to the browser.4) If we want to customize the jsp pages can you please let me know the steps involved in making the customizations and testing them.
    This is detailed in many threads.Thanks
    Tapash

  • Satellite P300D-10v - Question about warranty

    HI EVERYBODY
    I have these overheating problems with my laptop Satellite P300D-10v.
    I did everything I could do to fix it without any success..
    I get the latest update of the bios from Toshiba. I cleaned my lap with compressed air first and then disassembled it all and cleaned it better.(it was really clean insight though...)
    BUT unfortunately the problem still exists...
    So i made a research on the internet and I found out that most of Toshiba owners have the same exactly problem with their laptop.
    Well i guess this is a Toshiba bug for many years now.
    Its a really nice lap, cool sound (the best in laptop ever) BUT......
    So I wanted to make a question. As i am still under warranty, can i return this laptop and get my money back or change it with a different one????
    If any body knows PLS let me know.
    chears
    Thanks in advance

    Hi
    I have already found you other threads.
    Regarding the warranty question;
    If there is something wrong with the hardware then the ASP in your country should be able to help you.
    The warranty should cover every reparation or replacement.
    But I read that you have disasembled the laptop at your own hand... hmmm if you have disasembled the notebook then your warrany is not valid anymore :(
    I think this should be clear for you that you can lose the warrany if you disasemble the laptop!
    By the way: you have to speak with the notebook dealer where you have purchased this notebook if you want to return the notebook
    The Toshiba ASP can repair and fix the notebook but you will not get money from ASP.
    Greets

Maybe you are looking for