How to instanciate/restore an object in the target JVM

Hi,
For the needs of a runtime project, I'd like to be able to interrupt the main method of my target VM as it starts (that, I can do), and call a static method that takes an object as parameter. At this point, obviously, the argument object is not defined, so I'd like to instanciate it from my runtime program (debugger). I don't know how to do that. I thought I could use the ClassType.newInstance() method, but the class I want to instanciate is not loaded yet, so I don't know how to get the right ClassType object.
Actually what I'd like to do in the end is to be able to recreate an object (deserialize) to the target VM, so what I'm really looking for is a way of setting an entire object without having to invoke its constructor method. Does the redefineClass() method help here ? I'm not sure...
Does someone knows a way of doing this ?
Thanks

Hi Tatayya,
so I understand you right, that you want to launch a JSP from a different PAR file? You could do the following in this case.
Create an additional JSP in the (first) PAR that simply does a redirect to the second iView (form the other PAR). In the contoller class of your first PAR, perform a this.setJspName("redirectMe.jsp").
If you want to keep displaying the original JSP in the iView and simply display an additional popup, you could try:
don't change the this.setJspName() (i.e. set it to the original page)
Use a bean that stores a value like "showPopup yes/no"
Query the bean in the JSP and render some javascript:window.open() code if "showPopup=true".
Hope that helps,
Dominik

Similar Messages

  • HT201272 Having a bad day my iTunes library got corrupted and my back up disk has failed how can I restore my purchases from the iTunes store

    Having a bad day my iTunes library got corrupted and my back up disk has failed how can I restore my purchases from the iTunes store? When I try it tells me the pruchases have already been downloaded to this computer.

    Does your purchased rmusic appears under the Purchased link under Quicklinks on the right-hand side of the iTunes store home page (music can't be re-downloaded in all countries) ? If they do and you don't have the cloud symbol against them so as to re-download them, then do you still have the entries for them in your library i.e. where you would normally click on them to play them ? If you do then try deleting them from there (iTunes will be seeing them and assuming that you still have them somewhere) and they should then get the cloud symbol for re-downloading in the Purchased link.
    If you aren't in a country where music can be re-downloaded then you could try contacting iTunes support and see if they will grant you a re-download : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page,

  • Mac OS no longer available after trying to remove Windows on Bootcamp. How can I restore Mac OS without the Mac HDD in options?

    Mac OS no longer available after trying to remove Windows on Bootcamp. How can I restore Mac OS without the Mac HDD in options?
    So what I did was, I had bought my iMac from a shop and asked them to do bootcamp for me. However, they installed 32 bit instead of 64. My fault, I did not make my self clear about it. So after it has been delivered to my house, I realized that I wanted the 64 bit. I tried to remove windows on bootcamp but honestly, I have not experienced this before. So I failed. I believe, I did something wrong.
    So I opened the iMac and it keeps asking me to go to windows. Windows OS also corrupted.
    I tried the Option Key but the only option is Windows 7 only. So using a different keyboard, I press option and it only shows Windows HDD and the Mac HDD has gone.
    What am I going to do? How can I restore Mac OS without the HDD anymore?

    iMac, Mac OS X (10.7.2)   < your profile
    Try using Lion Recovery

  • How to center a JFrame object on the screen?

    Does somebody know how to center a JFrame object on the screen. Please write an example because I'm new with java.
    Thank you.

    //this will set the size of the frame
    frame.setSize(frameWidth,frameHeigth);
    //get screen size
    Toolkit kit=Toolkit.getDefaultToolkit();
    //calculate location for frame
    int x=(kit.getScreenSize().width/2)-(frameWidth/2);
    int y=(kit.getScreenSize().height/2)-(frameHeigth/2);
    //set location of frame at center of screen
    frame.setLocation(x,y);

  • How to place am mime object on the smartform ?

    Hi All,
    How to place am mime object on the smartform ?
    Is there any function module to read a mime object from mime repository?
    Any help would be appreciated.
    Regards,
    Raja Ram.

    Hi Vishwa,
    Thanks for your prompt response.
    How to get the obj ID of a MIME object?
    I checked in So2_MIME_REPOSITORY bur couldn't find?
    Is there any mapping table between MIME object and object ID ?
    I am very new to MIME objects.
    Please tell me.
    Regards,
    Raja Ram.

  • How do I remove an object from the foreground of a photo eg a fence?

    How do I remove an object from the foreground of a photo eg a fence?

    What version of Photoshop?
    If CC then try here
    Learn Photoshop CC | Adobe TV

  • Apple just replaced a defective iPad. How do I restore my data from the cloud to my iPad?

    My iPad was replaced and would like to know, how do I restore my files from the cloud to my iPad?

    http://support.apple.com/kb/HT1766?viewlocale=en_US&locale=en_US
    Go to Settings>General>Reset and tap Erase All Content and Settings.  This will erase your device.  Then you will go through the setup screens again as you did when your device was new, and when given the option, select Restore from iCloud Backup.

  • We just got a new phone for my daughter.  I am trying to restore from itunes account but the language is not English.  How do I restore to English from the Hello screen?

    We just got a new phone for my daughter.  I am trying to restore from itunes account but the language is not English.  How do I restore to English from the Hello screen?

    WHen in the setup part the first question after hello should be language

  • How can I restore my datas from the trash ( itunes music)?Thanks

    How ca I restore my datas from the trash( i-tunes) I still can read the lists, but they are not backed. Thks

    Try DataRescue from ProSoft.

  • How can I write new objects to the existing file with already written objec

    Hi,
    I've got a problem in my app.
    Namely, my app stores data as objects written to the files. Everything is OK, when I write some data (objects of a class defined by me) to the file (by using writeObject method from ObjectOutputStream) and then I'm reading it sequencially by the corresponding readObject method (from ObjectInputStream).
    Problems start when I add new objects to the already existing file (to the end of this file). Then, when I'm trying to read newly written data, I get an exception:
    java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    Is there any method to avoid corrupting the stream? Maybe it is a silly problem, but I really can't cope with it! How can I write new objects to the existing file with already written objects?
    If anyone of you know something about this issue, please help!
    Jai

    Here is a piece of sample codes. You can save the bytes read from the object by invoking save(byte[] b), and load the last inserted object by invoking load.
    * Created on 2004-12-23
    package com.cpic.msgbus.monitor.util.cachequeue;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    * @author elgs This is a very high performance implemention of Cache.
    public class StackCache implements Cache
        protected long             seed    = 0;
        protected RandomAccessFile raf;
        protected int              count;
        protected String           cacheDeviceName;
        protected Adapter          adapter;
        protected long             pointer = 0;
        protected File             f;
        public StackCache(String name) throws IOException
            cacheDeviceName = name;
            f = new File(Const.cacheHome + name);
            raf = new RandomAccessFile(f, "rw");
            if (raf.length() == 0)
                raf.writeLong(0L);
         * Whne the cache file is getting large in size and may there be fragments,
         * we should do a shrink.
        public synchronized void shrink() throws IOException
            int BUF = 8192;
            long pointer = getPointer();
            long size = pointer + 4;
            File temp = new File(Const.cacheHome + getCacheDeviceName() + ".shrink");
            FileInputStream in = new FileInputStream(f);
            FileOutputStream out = new FileOutputStream(temp);
            byte[] buf = new byte[BUF];
            long runs = size / BUF;
            int mode = (int) size % BUF;
            for (long l = 0; l < runs; ++l)
                in.read(buf);
                out.write(buf);
            in.read(buf, 0, mode);
            out.write(buf, 0, mode);
            out.flush();
            out.close();
            in.close();
            raf.close();
            f.delete();
            temp.renameTo(f);
            raf = new RandomAccessFile(f, "rw");
        private synchronized long getPointer() throws IOException
            long l = raf.getFilePointer();
            raf.seek(0);
            long pointer = raf.readLong();
            raf.seek(l);
            return pointer < 8 ? 4 : pointer;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#load()
        public synchronized byte[] load() throws IOException
            pointer = getPointer();
            if (pointer < 8)
                return null;
            raf.seek(pointer);
            int length = raf.readInt();
            pointer = pointer - length - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            byte[] b = new byte[length];
            raf.seek(pointer + 4);
            raf.read(b);
            --count;
            return b;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#save(byte[])
        public synchronized void save(byte[] b) throws IOException
            pointer = getPointer();
            int length = b.length;
            pointer += 4;
            raf.seek(pointer);
            raf.write(b);
            raf.writeInt(length);
            pointer = raf.getFilePointer() - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            ++count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCachedObjectsCount()
        public synchronized int getCachedObjectsCount()
            return count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCacheDeviceName()
        public String getCacheDeviceName()
            return cacheDeviceName;
    }

  • How do you restore your iPad on the new iTunes

    how do you restore your ipad on the new itunes

    Hi,
    From view menu, you can select show duplicate item. If you hold option key whilst selecting view menu, show exact duplicates becomes available.
    Jim

  • HT1212 how do you restore if you forgot the passcode

    how do you restore if you forgot the passcode for the iphone 4

    Follow the instructions in the article from which the question was posted.

  • How to add a ChartOfAccounts object into the database.

    how to add a ChartOfAccounts object into the database. please shows sample code
    thanks

    Dim CoA As SAPbobsCOM.ChartOfAccounts
                CoA = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oChartOfAccounts)
                CoA.Code = 11223344
                CoA.ExternalCode = "a1234"
                CoA.ForeignName = "f Test Account"
                CoA.Name = "Test Account"
                CoA.AccountType = SAPbobsCOM.BoAccountTypes.at_Other
                CoA.ActiveAccount = SAPbobsCOM.BoYesNoEnum.tYES
                CoA.FatherAccountKey = 100001
                If CoA.Add <> 0 Then
                    MessageBox.Show(oCompany.GetLastErrorDescription)
                Else
                    MessageBox.Show("Added Account")
                End If
    Remember the father account key must be a valid account number in the company where you are trying to add the new account.  (The G/L Account code seen in the SBO client)

  • My mini has a password on it now that I have iOS 7   I do not know the password. Nor will it let me restore since it has find my mini in iCloud. How can I restore and take off the password

    My mini has a password on it now that I have iOS 7   I do not know the password. Nor will it let me restore since it has find my mini in iCloud. How can I restore and take off the password

    Sounds like then maybe a "friend" got hold of your phone and set a SIM card password.  Not much you can do if that is the case if you do not know the password except go to your carrier and request a new SIM card.

  • Call to a remote object in the same JVM

    Hi,
    I want to implement a logging mechanism in my system. I'm planning to
    write an rmi object and make it a start up class.
    I wud like to know whether the calls to this start up class made by the
    ejb instances and from the servlet engine in the same JVM, wud be rmi calls
    or wud they be simple method calls.
    Does weblogic detect the calls from the objects of the same jvm and
    optimise them, or wud they be rmi calls only.
    btw, i'm using weblogic 5.1
    thx,
    Manohar

    Try:
    initialNamingContext.rebind("single",
    weblogic.rmi.server.UnicastRemoteObjcet.exportObject(obj)
    "M. Manohar" wrote:
    Hi Eduardo,
    thx for ur reply.
    I wud like to know how to make this "binding a stub".
    wat i'm using is binding an object only.
    Instantiating an object which implements the remote interface and binding
    it to the JNDI tree by,
    initialNamingContext.rebind("single", obj);
    and ofcourse defining it as a start up class in the weblogic.properties
    file.
    Can u pls explain how to do "binding a stub"
    thx,
    Manohar
    Eduardo Ceballos wrote in message <[email protected]>...
    Presuming that the start up class binds itself into the jndi tree, then itonly depends on what you bind: binding a stub results in the RMI runtime
    overhead; binding the object itself, results in the simpler function call
    overhead.
    "M. Manohar" wrote:
    Hi,
    I want to implement a logging mechanism in my system. I'm planning to
    write an rmi object and make it a start up class.
    I wud like to know whether the calls to this start up class made by the
    ejb instances and from the servlet engine in the same JVM, wud be rmi
    calls
    or wud they be simple method calls.
    Does weblogic detect the calls from the objects of the same jvm and
    optimise them, or wud they be rmi calls only.
    btw, i'm using weblogic 5.1
    thx,
    Manohar

Maybe you are looking for

  • Free goods qty

    If i change the quantity in the free goods item manually in the sales order, system should not allow. where is the control for that? Those who have really worked on free goods, pls help. regards vikas chhabra

  • Warning message required when we chnage invoicing party in MIRO

    HI All, Our client require the below settings. If we change the invoicing party in MIRO which is different than the PO vendor then system should throw warning message or pop up. I had tried to convence them that it can impact scenarios but they says

  • Suggestions needed on retracting bw data using Infospokes

    Dear all, Unable to dump the BW 3.5 Info cube data using info spokes. Info cube contains huge historical data (5 Crores), we are using maximum selection conditions on available time characteristics in info cube. Regards, Sreehari.

  • Regarding VT11 Selection Screen

    Hi Guys,              I copied VT11 Selection Screen into my Z Program and added 2 new selection fields to VT11. My requirement is if the user enters any details I should get the shipment details. Should i copy the entire program of VT11 for this iss

  • *** I keep getting a render error

    I am trying to conform my HDV footage and keep getting the same warning. Specs: Project is HDV - length 53 minutes Video and audio render files set to a drive that has 149.8gb of space left on it. Here is the message I keep getting: "Render Error: In