How to serailize Object

hi
i am using JMS and i want ot use
message.setObject(Object )
but this object must be serialized before passing to setObject() method.
i have Object type but i cant able to put it in mesage as it is not serialize
so how can i serialize this object.
public boolean SendSync(Object body)
if (sendTo == null)
return false;
if (body != null && session != null )
message.setObject(body);
Regards
Praveen

Cast it to Serializable. If it isn't Serializable you will then get a ClassCastException. In which case you are hosed unless you can get the class to implement Serializable.

Similar Messages

  • How to show object creation in UML

    How to show object creation in UML

    In a sequence diagram, it's a line (with arrow) pointing to the new object and the <creates> or <new> tag as mentioned above.
    | obj 1  |
         |
         |    <creates>     ----------
         | -------------->  | obj 2  |
         |                  ----------or----------
    | obj 1  |
         |
         |      <new>       ----------
         | -------------->  | obj 2  |
         |                  ----------

  • How to "get object" -- ResourceBundle

    According to the ResourceBundle API:
    ResourceBundle myResources =  ResourceBundle.getBundle("MyResources");Besides getString, ResourceBundle also provides ... a generic getObject method for any other type of object. When using getObject, you'll have to cast the result to the appropriate type. For example:
    int[] myIntegers = (int[]) myResources.getObject("intList");
    {code}
    Elsewhere,
    +getBundle+ attempts to locate a property resource file.
    Does it make sense/Is it possible to +getObject+ from a property resource file? If so, how is the object "expressed" in the property resource file?
    For example, if the resource file looks like
    1=Person
    then the key 1 is associated with the String "Person"
    If
    [code]class Person {
    String firstName;
    String lastName;
    ... }[/code]
    is it possible to associate "1" with a Person object, where firstName is "Foo" and lastName is "Bar"?
    If so, how would it look in the property resource file?
    Thanks in advance,
    C                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    In the resource file, you can save the data like this:
    numberofperson=2
    firstname1=Foo
    firstname2=dummyfirst
    lastname1=Bar
    lastname2=dummylast
    For programming, you can code like this:
    public class Person{
    private String firstname;
    private String lastname;
    public Person(String firstname, String lastname){
    this.firstname = firstname;
    this.lastname = lastname;
    int personNum = Integer.parseInt(myResources.getString("numberofperson"));
    Person personArr[] = new Person[personNum];
    for (int i=1; i<personNum; i++){
    personArr[i] = new Person(myResources.getString("firstname"+i),myResources.getString("lastname"+i));
    }

  • How to create objects in ABAP Webdynpro?

    Hi,
    I want to create the object for the class: <b>CL_GUI_FRONTEND_SERVICES.</b>
    then i want to call file_save_dialog method.
    how shoud i write the code, plz?

    I have written this code:
    v_guiobj TYPE REF TO cl_gui_frontend_services.
    <u> ?????????????</u>
    v_guiobj->file_save_dialog( ...).
    How to create object in the place of ?????????????.
    Bcoz, when i run this i am getting:
    <b>Access via Null object reference not possible.</b>

  • How to delete object in Integration Repository SAP PI 7.0

    how to delete object in Integration Repository SAP PI 7.0

    Hi Rashmi,
    Right click on the object, you would find the option to delete--> select it. Goto Changelist Tab and activate the changes.
    Ref: /people/siva.maranani/blog/2005/05/22/how-to-delete-software-component-from-integration-builder
    Re: How to delete/remove the software component from integration repository
    Thanks,

  • [svn:osmf:] 15505: Fix image smoothing, which had been broken as a result of some changes to how the display object of an ImageElement is exposed .

    Revision: 15505
    Revision: 15505
    Author:   [email protected]
    Date:     2010-04-16 09:29:26 -0700 (Fri, 16 Apr 2010)
    Log Message:
    Fix image smoothing, which had been broken as a result of some changes to how the display object of an ImageElement is exposed.  Add integration test.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/elements/ImageElement.as
        osmf/trunk/framework/OSMFIntegrationTest/org/osmf/elements/TestImageElementIntegration.as

    That's a comment in the file. It has no effect at all.

  • How to transport objects from one server to another server?

    How to transport objects from one server to another server.ie..from development to testing sewrver....

    Hi Manoj,
    Check these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/93/a3a74046033913e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a8/5e56006c17e748a68bb3843ed5aab8/frameset.htm
    Transporting Objects IR ID using CMS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f85ff411-0d01-0010-0096-ba14e5db6306
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e1/69a740aa053a13e10000000a155106/frameset.htm
    You can choose either File transfer methor or CMS. File transfer method is the simplest.
    Sachin

  • "a"+"b"+"c", how many String objects created?

    Hello everyone,
    String s = "a" + "b" +"c";
    How many String objects are created?
    I guess 5, is it right?
    regards

    > How many String objects are created?
    >
    I guess 5, is it right?
    Nope. Just one.

  • How to unlock objects in a transport request

    Hi, can you help me? I don't know how to unlock objects during a transport request. At the moment I have to unlock them one by one manually. I'm looking for a way to do it automatically.
    Thanks..

    Hi Bay,
    goto SE03,on the right side drill down Requests//task
    double click on unlock objects>give your transports request>execute
    Hope this helps
    Regards,
    Venkatesh

  • How to create object at infoview

    Hi all
    i am using SAP BO 3.1
    How to create object called SL NO this is not available at universe and second object  "code" is coming from universe.
    final output should be like this
    SL NO
    code
    1
    Non-Emergency ED Utilization
    2
    Office Visits
    3
    Inpatient Stays
    thanks in advance!!
    Ranjeet

    Hi Ranjeet
    Insert one column in that report. Write formula like this...
    =LineNumber()-1
    Regards,
    G

  • How to create objects in stack

    I am working on Weblogic 10 and JDK 1.5. In Java the objects are always created in heap. Can anybody tell me how to create objects in stack?

    SKMoharana wrote:
    i need objects to be allocated in stack as my application should respond in real time (time predictable).I heard this is possible in Mustang.If I am understanding you correctly, allocating objects on the stack will not help you, and creating objects on the heap will not hurt you.
    It is provably impossible to create a truly time predictable application (in any language), so what you're really looking to do is create a program that responds acceptably quickly for an acceptable percentage of the time. For this you can create benchmarks like "responds in 250 milliseconds or less 99.5% of the time".
    To this end, you could create a prototype program that creates the objects you wish on the heap, and see if there actually is a problem. Don't fall into the trap of premature optimization.
    Even if you do discover that your object creation IS the problem, heap allocation is not the problem. Take a look at this article. It takes ten machine instructions, less than 1 millisecond, to allocate an object.
    Your performance problems are most likely in the object initialization (look for long loops or deep recursions), the display (if this is a GUI application), or your network connection (if this is a web application).

  • How to create objects to paint itselfs without specifiy the location

    How to create objects to paint itselfs without specifiy the location using Java 2D

    shot in the dark: pass in the Graphics2D context to the method ?

  • How to resize objects simultaneously

    Hi,
    I originally posted a question in the past regarding how to transform objects simultaneously in Illustrator, and the answer had to do with using "transform each" in the object menu. I am trying to do the same in Indesign, but since there is no "transform each" option (or maybe I just missed it, or there is something similar), I am looking for another way..
    I have arrows heads in a diagram that need to be scaled down to about 50% their current size. The problem with scaling is that when all objects are selected, they are treated as though they are one large object, and then scaled so that they all meet in the center (ie. at 50% their size, they all shift together as a photo would scale). Is there any way to do this so that the arrow heads stay in place after each one is scaled up or down?
    I'd appreciate any help. Thanks.

    Yep. Choose one, scale then select the rest and
    Object > Transform Again > Transform Again Individually

  • How to shift object slightly in keynote?

    How to shift object slightly in keynote? It always jumps to be alighned with other objects.

    First, the reason why that's happening is because you have Alignment Guides turned on in the Preferences under Rulers. If you turn that off, then it'll stop snapping to other objects.
    If you do generally want alignment, BUT, every now and then just need it to move objects so that they won't SNAP to it, you can hold down the Command key either before you start dragging or after you've already started dragging. This will cause the object you're dragging to stop snapping to alignment guides for as long as you're holding down Command.
    Also, if you just need to move an object 1 pixel, you can use the arrow keys. Holding down Shift while pressing the arrow keys moves you 10 pixels for every arrow press instead of 1.

  • How to unlock objects in EP

    Hi,
    I am new to EP any body know How to unlock objects in EP. thanks in Advance.
    Thanks,
    Vikas

    Go to system admin, Monitoring ,Portal , Object locking.
    You should be able to see all your locked objects.
    Select and unlock.

Maybe you are looking for