Use of serialization

Hi..
what is the use of serialization in java? if i implements Serializable in my class, then what happens???

Konyv.java
import java.util.*;
import java.lang.*;
import java.io.*;
class Konyv implements Comparable {
private String szerzo_;
private String cim_;
private int ar_;
// get fugvenyek
public int getAr() { return ar_; }
public String getCim() { return cim_; }
public String getSzerzo() { return szerzo_; }
// set fugvenyek: nincsenek, beallitani csak a konstruktorban
// konstruktor
public Konyv(String szerzo, String cim, int ar)
szerzo_ = szerzo;
cim_ = cim;
ar_ = ar;
// egyeb helper fuggvenyek
public int getCimSzavainakSzama()
int ret = 0;
StringReader rd = new StringReader(cim_);
StreamTokenizer st = new StreamTokenizer(rd);
try
int token = st.nextToken();
while (token != StreamTokenizer.TT_EOL && token != StreamTokenizer.TT_EOF)
switch (token)
case StreamTokenizer.TT_NUMBER:
case StreamTokenizer.TT_WORD:
ret++;
break;
default:
break;
token = st.nextToken();
catch( Exception e )
// TODO: a V2-ben implementalni
System.out.println("Exception: "+e);
rd.close();
return ret;
public int compareTo(Object o)
Konyv masik = (Konyv)o;
return szerzo_.compareTo(masik.szerzo_);
public void nyomtat()
System.out.println("Szerzo: "+szerzo_);
System.out.println("Cim: "+cim_);
System.out.println("Ar: "+ar_);
Konyvtar.java
import java.util.*;
class Konyvtar {
private TreeMap allomany;
private Integer maxId;
// konstruktor public Konyvtar()
allomany = new TreeMap();
maxId = new Integer(1);
// konyvtar kezelo fuggvenyek
public void listaz()
// szerzo szerint sorrendben
if( allomany.size() > 0 )
Vector konyvek = new Vector(allomany.values());
Collections.sort(konyvek);
Iterator i = konyvek.iterator();
while( i.hasNext() )
Konyv k = (Konyv)i.next();
k.nyomtat();
public int ujKonyv(String szerzo, String cim, int ar)
int ret = maxId.intValue();
Konyv uj_konyv = new Konyv(szerzo,cim,ar);
allomany.put( maxId, uj_konyv );
maxId = new Integer(maxId.intValue()+1);
return ret;
public void konyvTorlese(int id)
Integer torlendo = new Integer(id);
if( allomany.containsKey(torlendo) )
allomany.remove( torlendo );
class CimbenLegtobbSzoSzerint implements Comparator {
public int compare(Object o1,Object o2)
int k1 = ((Konyv)o1).getCimSzavainakSzama();
int k2 = ((Konyv)o2).getCimSzavainakSzama();
if( k1 == k2 ) { return 0; }
else if( k1 > k2 ) { return 1; }
else return -1;
public void nyomtatLegtobbSzobolAlloCim()
// cimben levo szavak szerint
if( allomany.size() > 0 )
Vector konyvek = new Vector(allomany.values());
Collections.sort(konyvek,new CimbenLegtobbSzoSzerint());
int pos = konyvek.size()-1;
System.out.println(
"Legtobb szobol allo cim: "+((Konyv)konyvek.get(pos)).getCim());
public void statisztika()
System.out.println("=================");
System.out.println("= STATISZTIKA =");
HashSet szerzok = new HashSet();
HashSet cimek = new HashSet();
int ossz_ertek = 0;
if( allomany.size() > 0 )
Vector konyvek = new Vector(allomany.values());
Iterator i = konyvek.iterator();
while( i.hasNext() )
Konyv k = (Konyv)i.next();
szerzok.add( k.getSzerzo() );
cimek.add( k.getCim() );
ossz_ertek += k.getAr();
System.out.println("Szerzok szama: "+szerzok.size());
System.out.println("Cimek szama: "+cimek.size());
System.out.println("Ossz ertek: "+ossz_ertek);
main.java import java.util.*;
import java.lang.*;
import java.io.*;
class zh {
public static void printMenu()
System.out.println("=============");
System.out.println("= MENU =");
System.out.println("=============");
System.out.println("1 - Konyv felvitel");
System.out.println("2 - Konyv torles");
System.out.println("3 - Konyv lista");
System.out.println("4 - Legtobb szobol allo cim");
System.out.println("5 - Statisztikai adatok");
System.out.println("6 - Kilepes");
System.out.println("Valassza ki a kivant menupontot [1-6]: ");
public static void main(String[] args)
boolean do_loop = true;
Konyvtar kvt = new Konyvtar();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try
while( do_loop )
printMenu();
String valasz = in.readLine();
if( valasz.compareTo("6") == 0 ) { do_loop = false; }
else if( valasz.compareTo("1") == 0 )
System.out.println("Adja meg a konyv Szerzojet, Cimet, Arat (mind ujsorban)");
String szerzo = in.readLine();
String cim = in.readLine();
String ar = in.readLine();
int id = kvt.ujKonyv(szerzo,cim,Integer.parseInt(ar));
System.out.println("----------------");
System.out.println("A felvitt konyv leltari azonositoja: "+id);
System.out.println("----------------");
else if( valasz.compareTo("2") == 0 )
System.out.println("Adja meg a torolni kivant konyv leltari azonositojat");
String id = in.readLine();
kvt.konyvTorlese( Integer.parseInt(id) );
else if( valasz.compareTo("3") == 0 )
kvt.listaz();
else if( valasz.compareTo("4") == 0 )
kvt.nyomtatLegtobbSzobolAlloCim();
else if( valasz.compareTo("5") == 0 )
kvt.statisztika();
catch( Exception e )
};

Similar Messages

  • For what is used the Serializable?

    Hi! I'm wondering for what can I use the Serializable interface. Since it do not have methods or fields. Can you tell me for what it is used and provide a little example of it?
    Thanks a lot!
    Raul

    Please tell me if the interface Serializable is having
    no methods and variables. Then whats the use of this
    kind of interfaces...
    Marker Interface Pattern
    The marker interface pattern is a design pattern in computer science.
    This pattern allows a class to implement a marker interface, which exposes some underlying semantic property of the class that cannot be determined solely by the class' methods. Whereas a typical interface specifies functionality (in the form of method declarations) that an implementing class must support, a marker interface need not do so. The mere presence of such an interface indicates specific behavior on the part of the implementing class. Hybrid interfaces, which both act as markers and specify required methods, are possible but may prove confusing if improperly used.
    One good example of a marker interface comes from the Java programming language. The Cloneable interface should be implemented by a class if it fully supports the Object.clone() method. Every class in Java has the Object class at the root of its inheritance hierarchy and so every object instantiated from any class has an associated clone() method. However, developers should only call clone() on objects of classes which implement the Clonable interface, as it indicates that the cloning functionality is actually supported in a proper manner.

  • The use of serialize

    Hi all,
    I am trying to use the serialize xpath function to serialize an xml variable to a string, but nothing is stored in the string:
    /process_data/myString = serialize(/process_data/myXmlVar/*, true())
    What am I doing wrong?
    Thanks in advance.
    Sincerely
    Kim

    Do you need the /*? I think I've serialized an XML document without it.
    Ryan D. Lunka
    Cardinal Solutions Group
    [email protected]

  • Does FrameMaker 12 have an LEID value for use with serialization via AAMEE?

    Does FrameMaker 12 have an LEID value for use with serialization via AAMEE?

    I wish life was that easy :-).
    You have a valid argument; So I had this kind of test going. I had 50,000 messages of
    type-1 first loaded into the queue. Then I had 100 messages of type-2 loaded on to the
    queue.
    At this point, I issued a conditional dequeue that skipped type-1 messages and only
    asked for type-2 messages. I saw the full table scan.
    Then I created another test case 1 million type-1 messages had to be skipped.
    Still full table scans. I am not convinced that the doing full table scans is the best query
    plan out there. Cost Based Optimizer tends to disagree for some reason. May be
    it is right; But I have to avoid FTS when possible. As you know, not only blocks
    used by the existing rows in the table get scanned, but also every block until the
    high water mark level.
    One might say for a table with volatile data that comes and goes on a daily basis, million is an extreme case. Howvere, I am building a general purpose infrastructure based
    on AQ and cannot rule out consumers who misbehave.
    Are there better ways to handle multiple types of consumers on a single physical queue ? I need to be able dequeue specific consumer types if necessary, and this has to be
    done in a performant manner.
    Other alternatives I can think are
    1. Using a multi consumer queue such that there is one subscriber for each message
    type. Use multiple agent sets in a listen method to listen to messages and then
    control what agents we pass into listen method.
    Any pattern suggestions welcome.
    Thanks
    Vijay

  • How to use Avro Serialization for ASA input

    Hi There,
    I am trying to use Avro serialization format for Streaming Analytics input data. I am using Event Hub as my data source. Based on the answer to a similar question in this forum about CSV format, it seems like ASA expects header/schema information to
    be included with each event, rather than defined externally. So, each of my input events is a proper Avro Data File, with schema included followed by multiple binary records. I have tried to verify this format using the "Test" button in the Azure
    Streaming Portal. When I upload a file containing my Avro event, the portal returns "Unable to parse JSON" error. I have double checked that my input is indeed marked as Avro serialization and not JSON.
    Can you let me know what the expected Avro data format is? 
    Thanks,
    Dave

    Hi Mahith,
    I am now able to reproduce the FieldsMismatchError. I am attaching the log. Could you help debug this issue?
    Correlation ID:
    000593f0-4c05-412b-b096-2cf818bf6e9f
    Error:
    Message:
    Missing fields specified in create table. Fields expected: avgLight, avgOffLight, avgHum, avgLrTemp, avgBrLight, avgBrTemp, avgLrLight, avgOffHum, avgLrHum, avgOffTemp, avgBrHum, avgTemp, groupId, ts. Fields found: avgLight, avgOffLight, avgHum, avgLrTemp, avgBrLight, avgBrTemp, avgLrLight, avgOffHum, avgLrHum, avgOffTemp, avgBrHum, avgTemp, groupId, ts.
    Message Time:
    2015-01-15 00:28:59Z
    Microsoft.Resources/EventNameV2:
    sharedNode92F920DE-290E-4B4C-861A-F85A4EC01D82.hvac-input_0_c76f7247_25b7_4ca6_a3b6_c7bf192ba44a#0.output
    Microsoft.Resources/Operation:
    Information
    Microsoft.Resources/ResourceUri:
    /subscriptions/d5c15d24-d2ef-4443-ba7e-8389a86591ff/resourceGroups/StreamAnalytics-Default-Central-US/providers/Microsoft.StreamAnalytics/streamingjobs/hvac
    Type:
    FieldsMismatchError

  • What is the use of Serializable Interface in java?

    Hello friends,
    I have one dout and i want to share with u guys:
    Why Serializable interface made and actully
    what's the use of it?
    At which place it become useful ?
    It is not contain any method then why it is made?
    If anyone have any idea about this then please reply.
    Thanks in advace
    Regards,
    Jitendra Parekh

    t is not contain any method then why it is made?To point out to the user of a class (and the programs) that the design of this class is conforming to certain restraints needed for Serialization.

  • XSQL-022 error on using FOP - serializer class not found; urgent!

    Hi all,
    currently using XDK 9.2.0.1.0. On trying to invoke Apache FOP serializer I just get the following error message:
    XSQL-022: Cannot load serializer class oracle.xml.xsql.serializers.fopserializer
    and I really don't know why....
    Running XSQL Servlet within Tomcat 4 Engine, but error pops up using both, Tomcat way and/or just the commandline invoker xsql.bat.
    Generally XSQL Servlet is working correctly.
    My classpath setting contains:
    xmlparserv2.jar; batik.jar; classes12.jar; fop.jar; fopserializer.jar; oraclexsql.jar; sax2.jar; xalan-2.0.0.jar; xalanj1compat.jar; xerces-1.2.3.jar; xschema.jar; XSQLConfig.jar; xsu12.jar
    The serializer being redefined in XSQLConfig is just:
    <serializer>
    <name>FOP203</name>
    <class>oracle.xml.xsql.serializers.fopserializer</class>
    </serializer>
    This is because of using FOP 0.20.3, so having my own serializer class due to API change in FOP 0.20.x; my fopserializer is looking like that:
    package oracle.xml.xsql.serializers;
    import org.w3c.dom.Document;
    import java.io.PrintWriter;
    import oracle.xml.xsql.*;
    import org.apache.fop.messaging.MessageHandler;
    import org.apache.fop.apps.*;
    import java.io.*;
    // FOP 0.20.3 Serializer implementation for XSQL
    public class fopserializer implements XSQLDocumentSerializer
    private static final String PDFMIME="application/pdf";
    public void serialize(Document doc, XSQLPageRequest req) throws Throwable
    try
    Driver FOPDriver = new Driver();
    FOPDriver.setRenderer(FOPDriver.RENDER_PDF);
    MessageHandler.setOutputMethod(MessageHandler.NONE);
    FOPDriver.setupDefaultMappings();
    req.setContentType(PDFMIME);
    FOPDriver.setOutputStream(req.getOutputStream());
    FOPDriver.render(doc);
    catch (Exception e)
    e.printStackTrace(System.err);
    In my XSQL file I'm using the following PI:
    <?xml-stylesheet type="text/xsl" href="listemps.fo" serializer="FOP203"?>
    Any suggestions what is wrong in here ?
    Can't use the original xsqlserializer.jar either - same error.
    Thanks in advance
    Jochen

    Hi Jochen,
    I'm working with Tomcat 4.0.3, FOP 20.0.3 and XDK 9.2.0.1.0, too.
    I've copied all the jar-files into tomcat/common/lib. I think that you can't use the MessageHandler in fop20.0.3. I'm using the following serializer:
    package diva.xml.xsql.serializers;
    import org.w3c.dom.Document;
    import java.io.PrintWriter;
    import oracle.xml.xsql.*;
    import org.apache.fop.apps.*;
    import org.apache.log.*;
    import org.apache.log.format.*;
    import org.apache.log.output.io.*;
    import org.apache.avalon.*;
    import java.io.*;
    public class XSQLFOP203Serializer implements XSQLDocumentSerializer {
    private static final String PDFMIME = "application/pdf";
    private static final String CONFPATH = "/usr/local/fop/conf/userconfig.xml";
    public void serialize(Document doc, XSQLPageRequest env) throws Throwable {
    try {
    // Open user config file
    File userConfigFile = new File(CONFPATH);
    Options options = new Options(userConfigFile);
    // First make sure we can load the driver
    Driver FOPDriver = new Driver();
    // Setup logging
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    PatternFormatter formatter = new PatternFormatter("[%{priority}]: %{message}\n%{throwable}" );
    LogTarget target = null;
    target = new StreamTarget(System.out, formatter);
    hierarchy.setDefaultLogTarget(target);
    Logger log = hierarchy.getLoggerFor("fop");
    log.setPriority(Priority.INFO);
    FOPDriver.setLogger(log);
    // Then set the content type before getting the reader/
    env.setContentType(PDFMIME);
    FOPDriver.setRenderer(FOPDriver.RENDER_PDF);
    FOPDriver.setOutputStream(env.getOutputStream());
    FOPDriver.render(doc);
    catch (Exception e) {
    // Cannot write PDF output for the error anyway.
    // So maybe this stack trace will be useful info
    e.printStackTrace(System.err);
    Hope this helps
    Uwe

  • Inbound scenario using tRFC - serialization

    Hi Guys,
    I have the following scenario:
    An external System is communicating with SAP using tRFC queue.
    So from the SAP perspective this is an inbound scenario.
    I am wondering if the sequence of the IDocs that are attached to the tRFC queue by that external system
    is kept while they get processed on the SAP side.
    To say it in other words: Will SAP process the IDOcs in the same sequence as they were attached to the RFC queue before?
    So if there is a communication error will be the sequence kept after communication is established again?
    Or do I have to build the timestamp serialization - what I want to avoid as the ALE input function module doesn't provide this.
    Thanks a lot.
    Achim

    Hi Dheeraj,
    the challenge with the "map the TLOG and create WPUUMS Idoc" is that inside the TLOG you are getting receipt based data. But for the WPUUMS IDOC you'd be expecting to see aggregated information.
    The better and recommended way to integrate SAP POS with SAP Retail is to use the delivered standard integration with the following two data streams:
    1. SAP Retail master data (e.g. articels, prices, promotions) to SAP PI to SAP POS
    2. SAP POS - Transnet - SAP PI - SAP POS DM - SAP BW/SAP Retail
    The advantage would be that aggregation is handled in POS DM and you have all the detail available in SAP BW and that you will be able to utilize the data collected for other processes as well.
    Please check the Wiki for POS Integration which will give you a good overview about the integration and covered scenarios:
    https://wiki.sdn.sap.com/wiki/display/CK/ExchangeInfrastructure-SAPPOS+Integration
    For SAP POS DM you will find a wiki here:
    https://wiki.sdn.sap.com/wiki/display/Retail/SAPPOSDM%28SAPPoint-of-SaleDataManagement%29
    Additionally there are two courses focussing on this topics:
    Integration: W26TGI
    POS Data Management: W26POS
    Kind regards,
    Stefan

  • What is the main use of serialization?

    Can anyone plz tell me the purpose of serialization?

    It's just state, just raw data. People tend to get
    caught up in thinking they need to serialize an
    entire object, but the truth about serializationis,
    it's just taking enough of the state of an object
    that you can re-construct that object It's also the relationships, which form a directed
    graph that allows cycles. Those relationships, too, are manageable. I've got a serialization library that serializes to - naturally! - XML, and takes care of those relationships, too. Each reference object in a graph is serialized exactly once, regardless of how many objects refer to it.
    That's just one of the tricky parts, and where most
    of the "magic" occurs in Java serialization. Also
    much of the pain -- it seems that everyone who uses
    serialization reaches a point of wondering why their
    program is leaking memory (then they discover that
    the input and output streams hold onto the references
    needed to break cycles and preserve within the
    graph).
    Even more tricky is the question of static versus
    instance data, given that static data can change over
    time, and the instance state may depend on the static
    data (although, to be honest, this is more an issue
    of design than serialization).
    However, in general I agree with you that most cases
    that need "serialization" can get away with simple
    state marshaling. I know of one project that
    eliminated a huge amount of communication overhead by
    marshaling their POJOs as CORBA objects.
    I'm not so sure that JLabel fits into that category.
    You could say that a label is defined by its
    dimensions, position, and content. However, it's
    place in the hierarchy is also important, and in most
    cases the dimensions and position are determined by
    the parent's layout manager ... except in the cases
    where they aren't. Presumably you'd be serializing the parent as well, though
    On the other hand, you can't
    simply serialize a Swing GUI and expect to
    deserialize it in another application, because the
    GUI is tied to the display, and the serialization
    mechanism has no way to recreate that relationship.You wouldn't want to, anyway. There's enough state to be serialized that you can re-build it without having to clone like that
    My point is, though, that there's nothing the Serializable-centric mechanism does that you can't do yourself

  • How to use SERIALIZABLE

    I want to use the serializable object for storing records of information but i am not clear about how to use it. Could someone kindly explain how to go about it.

    public class MyClass implements Serializable{}
    Once you implement serializable (you don't have to do anything, just indicate that your class implements Serializable) then you can use getBytes() to get a serialized version of your object.

  • Error while posting Customer with Multiple sales areas using DEBMAS05.

    Dear experts,
    We are generating IDOCS vis SAP DS for posting Customer master. The message type used is DEBMAS and basic type is DEBMAS05.  we have a requirement to create 1 customer with multiple sales areas. However, we are ending up with a strange error:  "Fill all required fields SAPMF02D 0111 ADDR1_DATA-NAME1". Despite the IDOC going into status 51, the customer gets created and the 1st sales area too. the 2nd sales area however is not created!  The IDOC data definitely contains Name1, otherwise the customer would not have been created in the first place.
    As the error message is related to the Address data, I also explored upon exploring this erorr further on the lines of Central Address management where in the ADRMAS and DEBMAS have to be passed together(IDOC Serialiization).  OSS Note (384462)  provides further details about this. One Important point from the note is: 
    "As you have to specify the logical name of the sending system among other things, SAP is not able to make any default settings in the standard systems. When you use the serialization groups delivered as a standard by SAP, the address objects are imported before the master objects.Thus the sequence address data before master objects must only be adhered to if one of the following points applies to your application:
    Such fields are set as required entry fields that are only provided by the BAS in the Customizing of the customer or vendor master.
    For your customers, contact persons exist to which a private address or a different business address is assigned.".
    This is not the case in our situation, as we do not have required entry fields in customizing that are only provided by the BAS, so the error is all the more confusing and I am not too sure what the cause is.
    If someone have experienced the same issue before and have found a solution to it, kindly help out.

    I have found the cause and solution to this problem.
    This error ”Fill all required fields SAPMF02D 0111 ADDR1_DATA-NAME1” and other similar errors like “Fill all required fields SAPMF02D 0111 ADDR1_DATA-SORT1“ which occurrs during the IDOC posting when there are more than one sales area or company code occurs when the customer number range is set up for Internal numbering. This means, that the number gets generated only at the time of save and upon debugging the IDOC, we found out that after creating the customer and the first sales area/company code record, the segment E1KNA1M is cleared completely! This is the reason, it throws an error which points to a mandatory KNA1 field as missing. (Like NAME1, SORT1 etc.)
    This was resolved by splitting the IDOC into 2.
    The solution is to First post only the KNA1 segment and create the customer.
    In the second step, pass the IDOC with all other segments along with E1KNA1M, but pass only KUNNR in E1KNA1M and the rest of the fields in E1KNA1M as “/”:  you would have got the KUNNR after the first step.
    Important note: This requirement to split the IDOCs does not occur when the customer number is known upfront. (Meaning cases where the customer number is externally generated) I also tested this and created a customer with external numbering and I was able to post more than 1 sales area with the same IDOC. 
    I noticed multiple threads with the same issue, but none of it had a concrete answer. I hope this information will be useful for anyone facing similar problems.
    Cheers
    Venkat

  • Adobe CS6 randomly asks for reactivation (Deployed using AAMEE 3.1)

    Hi All
    We've deployed Adobe CS6 Design and Web Premium using AAMEE 3.1 to about 500 workstation across our school campus.  However, we're having a really weird issue where either the licensing screen will randomly pop up asking for reactivation (7 days) or the program requested will just fail to run.  If I try to reactivate using the wizard onscreen it says I don't have a valid internet connection.  This causes a lot of frustration for our users (and me!!)
    The only work around I found to it is to re-serialize using a serialization package made with AAMEE.  I'm considering adding it to a start-up script to re-serialize every PC when they are booted up each day but it it seems ridiculous to need to do this.  I thought AAMEE removed all activation checks and prompts, this doesn't seem to be the case here??
    I've had a look around the forums and while there are similar issues I haven't found a resolution to this, any help/suggestions would be much appreciated!

    Hi,
    you should be able to package product and their updates via AAMEE 3.1. if some package doesnt contain updates, you can also modify the package using AAMEE and add updates to it.
    please share PDApp.log and installer log file generate on client machine. For details of location please refer to page 112-113 in Enterprise deployment guide.
    please send across these logs to email id: [email protected]
    thanks,
    Rahul | [email protected]

  • Issues with using ConfigurablePofContext Serailizer

    I am trying to use ConfigurablePofContext Serializer but getting exception :
    2010-02-02 16:34:33.861/3324.349 Oracle Coherence GE 3.5.2/463 <Error> (thread=P
    roxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while d
    ecoding a Message for Service=Proxy:ExtendTcpProxyService:TcpAcceptor received f
    rom: TcpConnection(Id=null, Open=true, LocalAddress=10.153.233.224:9099, RemoteA
    ddress=10.153.233.224:1822): java.lang.ClassCastException: com.tangosol.io.pof.P
    ortableException cannot be cast to com.tangosol.util.UUID
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.P
    eer$MessageFactory$OpenConnectionRequest.readExternal(Peer.CDB:6)
    at com.tangosol.coherence.component.net.extend.Codec.decode(Codec.CDB:29
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.P
    eer.decodeMessage(Peer.CDB:25)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.P
    eer.onNotify(Peer.CDB:47)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    at java.lang.Thread.run(Thread.java:619)
    Server coherence-cache-config:
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>dist-*</cache-name>
    <scheme-name>dist-default</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>dist-default</scheme-name>
    <serializer>
              <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
         </serializer>
    <lease-granularity>member</lease-granularity>
    <backing-map-scheme>
    <local-scheme/>
    </backing-map-scheme>
    <autostart>true</autostart>
    </distributed-scheme>
    <proxy-scheme>
    <service-name>ExtendTcpProxyService</service-name>
    <thread-count>5</thread-count>
    <acceptor-config>
    <tcp-acceptor>
    <local-address>
    <address>localhost</address>
    <port>9099</port>
    </local-address>
    </tcp-acceptor>
    <serializer>
                   <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
         </serializer>
    </acceptor-config>
    <autostart>true</autostart>
    </proxy-scheme>
    </caching-schemes>
    </cache-config>
    Client Coherence cache config:
    <?xml version="1.0"?>
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>dist-extend</cache-name>
    <scheme-name>extend-dist</scheme-name>
    </cache-mapping>
    <cache-mapping>
    <cache-name>dist-extend-near</cache-name>
    <scheme-name>extend-near</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <near-scheme>
    <scheme-name>extend-near</scheme-name>
    <front-scheme>
    <local-scheme>
    <high-units>1000</high-units>
    </local-scheme>
    </front-scheme>
    <back-scheme>
    <remote-cache-scheme>
    <scheme-ref>extend-dist</scheme-ref>
    </remote-cache-scheme>
    </back-scheme>
    <invalidation-strategy>all</invalidation-strategy>
    </near-scheme>
    <remote-cache-scheme>
    <scheme-name>extend-dist</scheme-name>
    <service-name>ExtendTcpCacheService</service-name>
    <initiator-config>
    <tcp-initiator>
    <remote-addresses>
    <socket-address>
    <address>localhost</address>
    <port>9099</port>
    </socket-address>
    </remote-addresses>
    <connect-timeout>10s</connect-timeout>
    </tcp-initiator>
    <outgoing-message-handler>
    <request-timeout>5s</request-timeout>
    </outgoing-message-handler>
    </initiator-config>
    </remote-cache-scheme>
    <remote-invocation-scheme>
    <scheme-name>extend-invocation</scheme-name>
    <service-name>ExtendTcpInvocationService</service-name>
    <initiator-config>
    <tcp-initiator>
    <remote-addresses>
    <socket-address>
    <address>localhost</address>
    <port>9099</port>
    </socket-address>
    </remote-addresses>
    <connect-timeout>10s</connect-timeout>
    </tcp-initiator>
    <outgoing-message-handler>
    <request-timeout>5s</request-timeout>
    </outgoing-message-handler>
    <serializer>
         <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
              </serializer>
    </initiator-config>
    </remote-invocation-scheme>
    </caching-schemes>
    </cache-config>
    client side code to put value in cache:
    NamedCache cache = CacheFactory.getCache("dist-extend");
              String testVal = (String)cache.get("test");
              System.out.println("Value in coherence cache::" + testVal);
              cache.put("test", "coherece");
              System.out.println("Getting cache value from coherence");
    any idea?

    Thanks for your response Bob.
    I added POFSerializer to ExtendTcpCacheService & now I am not getting error when using put/get methods. I am getting exception when I am trying to execute InvocationService code: InvocationService service = (InvocationService)CacheFactory.getConfigurableCacheFactory().ensureService("ExtendTcpInvocationService");
              Map map = service.query(new AbstractInvocable()
                        public void run()
    setResult(CacheFactory.getCache("dist-extend").get("test"));
    }, null);
              testVal = (String) map.get(service.getCluster().getLocalMember());
              System.out.println("Value in coherence cache::" + testVal);
    Exceptiion:
    2010-02-05 16:39:11.021/460.104 Oracle Coherence GE 3.5.2/463 <Error> (thread=[A
    CTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', me
    mber=n/a): An exception occurred while encoding a InvocationRequest for Service=
    ExtendTcpInvocationService:TcpInitiator: java.lang.IllegalArgumentException: unk
    nown user type: portlets.announcements.AnnouncementsController$1
    at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(Conf
    igurablePofContext.java:400)
    at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(Conf
    igurablePofContext.java:389)
    at com.tangosol.coherence.component.net.extend.Channel.getUserTypeIdenti
    fier(Channel.CDB:7)
    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:
    1432)
    at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBuf
    ferWriter.java:2092)
    at com.tangosol.coherence.component.net.extend.messageFactory.Invocation
    ServiceFactory$InvocationRequest.writeExternal(InvocationServiceFactory.CDB:3)
    Do I have to do some POF Serialization related coding for calling InvocationService? I am just setting/getting String objects. My understanding is we need additional coding only for custom objects.
    Sorry if these questions are very basic. I didn't find any document on using InvocationService with POF Serialization.
    It will be great if someone can provide link to any documentation related to the same.

  • Design Choices and is LiveCycle needed? best practices for using RTMP/AMF over HTTP/XML communicatio

    Hi,
    I am new to flex/RIA. I am exploring different design choices especially in client server communication. On client side we will be using Flash based RIA (using Actions scripts).
    There will be some simple forms (like for login, registration, payments etc) and some simple reports including with several graphs and charts. Each chart might have 1000 to 1500 data points etc. There are not video or audio content as such. On server side we have Servlets, java API and some EJBs to provide the business logic and real time prices/content (price update is usually every 10 seconds) /data. Some of the content will be static as well.
    I have following questions in my mind. Is it worth it to use RTMP/AMF channels for the followings?
    1. For simple forms processing (Mapping Actions scripts classes to Java classes). Like to display/retrieve/update data for/from registration forms.
    a. If yes, why? Am I going to be stuck with LCDS? Is it worth it? What could be the cons for heavy usage/traffic scenarios
    b. If not what are the alternates? Should I create the web services? Or only servlets are sufficient (ie. Only HTTP+Java based server side with no LCDS+RTMP+AMF)? All forms need to communicate on secure channel.
    2. For pushing the real time prices/content which we may need to update every 15 seconds on user interface using graphs and charts. Can I do it with some standard J2EE/JMS way with RIA (Flex) on front-end? i.e. Flash application will keep pulling data from some topic. Data can be updated after few secs or few minutes which cant be predicted.
    3. Are there any scalability issues for using RTMP? What happens if concurrent users increase 10 times within a year?
    4. What are the real advantages of using RTMP/AMF instead of simple HTTP/HTTPS probably using xml based objects
    5. Do I need to use LCDS if I am using AMF only on client side? Basically I mean if I am sending an object in form of xml from a servlet. Can some technology in Flash (probably AMF) in client side map it an Action script object?
    6. What are the primary advantages of using LCDS in a system? Is there any alternate solutions? Can I use some standard solutions for data push technologies?
    I would like that my server side implementation can be used by multiple types of clients e.g. RIA browser based, mobile based, third party software (any technology) etc.
    I appreciate if you can kindly refer me to some reading materials which can help me deciding the above. If this is not the right place to post this message then please do refer me to the place where I can post such questions.
    Thanks and Kind regards,
    Jalal

    Hi Jalal,
    Let me see if I can help with some of your questions
    1. Yes, you can use LCDS for simple forms processing. Any time you want to
    move data between the Flex client and the server, LCDS (or its free Open
    source cousin BlazeDS) is going to help. I would expect you would use the
    mx:RemoteObject MXML tag to invoke server side code, passing it the form
    data input by the application user.
    2. If you need to push near real-time data, LCDS gives you the RTMP channel
    which can scale quite nicely. You can then use the mx:Consumer MXML tag to
    subscribe the clients to the messages, which can come from almost anywhere,
    include JMS topics or queues.
    3. RTMP (included in LCDS) is the best option for scaling to tens of
    thousands of users and the LCDS servers can be clustered to proved better
    scaling.
    4. The AMF3 protocol used over the RTMP channels performs much faster than
    simple XML over HTTP. See this blog posting for some tests:
    http://www.jamesward.org/census/.
    5. If you are sending a Flex application XML, then I would recommend using
    the E4X API to work with the XML. This is a pretty nice and powerful way to
    work with XML. If you want Actionscript objects (and probably better
    performance), then using AMF serialization to Actionscript objects is the
    way to go.
    6. Primary advantages? There are many, but mainly you can avoid thinking
    about the plumbing and concentrate on solving your application and business
    logic problems.
    Hope this helps you a little
    Tom Jordahl
    Adobe

  • ++Custom Serialization with Complex Data type (Nested Classes)

    Hi,
    We have a scenario wherein we need to write CUSTOM SERIALIZERS for complex datatypes like INVOICE & ORDER (INVOICE inturn has ADDRESS type among others, ORDER has ADDRESS type, a COLLECTION of type ORDERITEM each of which are Java Classes in themselves)
    The example of Custom Serializer given in the SOA AS Dev Guide http://download.oracle.com/docs/cd/B31017_01/web.1013/b28975/custserial.htm#CFHHIBCA)
    shows only a simple java type used for serialization and deserialization.
    Can anyone please help us out by sharing any example depicting the CUSTOM SERIALIZERs for COMPLEX DATA TYPES?
    Thanks in advance,
    Pavan.

    Hello,
    Could you please post the code of your classes in the forum (at least the interfaces) ?
    Regards
    Tugdual Grall

Maybe you are looking for

  • Error while importing an item

    Guruz, my scenario is, I have inserted a record in item interface table with all mandatory columns + some other optional columns. Now i'm running standard conc import progr for items. but i'm getting following errors... especially the FIRST ERROR tha

  • MBA old gen. and Snow Leopard - TIFF images seen as blank in some web pages

    After I upgraded to Snow Leopard, I see blank the TIFF images displayed in some web sites, like for example any patent image in the www.uspto.gov web site. This happens on both Safari and Firefox. They both use the QuickTime plugin (I have version 7.

  • How to email purchase order along with body and subject line

    hi experts,        i have to email the purchase order along with the body and subject line. I am able to send the purchase order as a pdf attachment, but i have still not got a solution how to add body and subject line to this mail. plz help me out.

  • Configure a Printer for a Smartform

    Hi. I need to configure a printer in order to create an aotumatic order spool instead of print the form. Does anyone know how to do that. I already ask to the BASIS people and they said they don´t know how to configure it. Thanks a lot for your help.

  • Auto Downloader - PSE 7.0

    I see that the Auto Downloader issue (where it went wild downloading everything when a card or other device was plugged in with previous versions) is fixed in PSE 7.0. It now only works automatically if you ask it to and that's great! If you set it u