How to know if the current application jar file has been overwritten?

When I overwrite a jar file that is being used, the buttons that call new windows stop responding silently but is there some check I can make from within the application to know if the jar file has been overwritten, so that I can warn the user to restart it?
I know this sounds bad so let me explain why I would want this, if you don't care then skip everything below this point.
I have close to a hundred of users executing Java applications from a central repository in the network. This is important because the applications are always changing and evolving so it's important that I only have to update one binary. I do most updates after work hours so I don't have a problem there but sometimes there are critical errors that need to be corrected immediately. Depending on the amount of people using an application it may be impractical to warn and wait for everyone to close it and make everyone else wait for that so I just overwrite the files that need to be updated and then warn everyone to restart the application. The result is that buttons that call for frames that haven't been called yet stop working silently. Some users already know what to do when that happens but I want a more graceful approach. I wanted to check for this situation from inside the application so that I could inform the user of the update and provide information on what to do next. Can I do this? I tried some try and catch blocks of code but I can't seem to catch anything when that happens.

You can write your own class loader that loads classes from that jar file. Make sure it isn't on the class path and when you want to create an object from that jar file, call up your class loader to do that. (You only have to do that for your "top-level" objects, within those objects creating another object will automatically be done by your class loader.)
Periodically check whether the jar has been modified. If it has, refresh the application by creating a new instance of your class loader and using that to create new instances of all your objects.
But that sounds like a lot of work just to avoid setting up an emergency change procedure where you get everybody to close their applications.

Similar Messages

  • How to know whether the current database is using a password file or not?

    How to know whether the current database is using a password file or not?

    The remote_password_file is the parameter that determines if you can use or not a password file. The values this parameter can have are NONE, SHARED, EXCLUSIVE. It is pretty obvious, if it is set to either SHARED or EXCLUSIVE the oracle instance has enabled the access through a password file for the SYSDBA and SYSOPER roles.
    ~ Madrid

  • How do I determine the # of times a song has been down loaded; 7 is max?

    How do I determine the # of times a song has been down loaded? Is 7 max?

    Jim, I apprecite your help. Im still  lost...not that efficient on computer. Some notes, If burn playlist to disc doesn appear in the menu, it means that the playlist you selected cant be burned to a CD because it contains items that have usage restrictions;  if the playist contains itunes store purchases that are not itune plus songs, you can burn the playlsit to a CD up to 7 times;  DRM - Digital Rights Management????  Any help is appreciated Thank You

  • How can I quit the photos app? It has been trying to create a library for hours but nothing happens. when I try to quit, it won't let me.

    How can I quit the photos app? It has been trying to create a library for hours but nothing happens. when I try to quit, it won't let me. Have just upgraded from iPhotos so don't want to lose any content.

    How can I quit the photos app? It has been trying to create a library for hours but nothing happens. when I try to quit, it won't let me. Have just upgraded from iPhotos so don't want to lose any content.
    Force-quit Photos as recommended by Arsenal1607.
    Make backup of your iPhoto Library and run the iPhoto Library First Aid tools to repair the permissions on your library and rebuild the iPhoto Library.
    To launch the First Aid Tools hold down the  alt/option and the command key simultaneously while double clicking the iPhoto Library to launch the iPhoto Library First aid tools. You'd to hold down both keys firmly and long enough, until the First Aid panel will appear.
    Try both the options "Repair Permissions" and "Rebuild library".  Then try again to migrate the iPhoto Library to Photos by dragging it onto the Photos icon in the Dock.
    Make sure, you have plenty of free storage. Don't try the migration, if you are running out of storage.

  • How can I turn off the "this application's signature HAS been verified do you want to run it?" message?

    I'm running Firefox 22.0 on the Mac, OS X 10.6, Java 6 SE fully updated on the Mac. I have corporate web sites I must use throughout the day that have Java applets associated with them, one of them being the Ephox web text editor. EVERY TIME I open a page that has the editor being invoked on it, I get FOUR messages that say "This application's signature has been verified. Do you want to run this application?" Two of them will have the name of the editor. Two of them will have blanks. ALL of them show "ALWAYS TRUST content from this publisher" as checked. RUN, RUN, RUN, RUN.
    Although I have a number of addins installed, I have had to disable them to get these apps to load without crashing.
    NOTE that this does not happen in Firefox 22 on Windows 7; nor did it with the same apps (no upgrades at the corp. website) on Firefox 18 or 19 on the Mac.
    Help???

    We are sorry this is more like a Java issue than a Firefox one.
    However, I found this that may be helpful to solve your problem, check it out: [http://stackoverflow.com/questions/1472494/suppressing-applications-digital-certificate-has-been-verified-do-you-want-to-ru http://stackoverflow.com/questions/1472494/suppressing-applications-digital-certificate-has-been-verified-do-you-want-to-ru]

  • Finding a file in the current executable jar file.

    Hi all,
    I am writing a little command line type application and I thought it would be neat to embed it's 'help file' into it's executable JAR file.
    Please can someone show me how to code my application to extract a file from the JAR file from which the Main.class also came?
    (Is that possible?)
    I've been looking around, I can find out how to work with a different JAR file but NOT how to examine the currently 'executing' one.
    Many thanks,
    - jon.

    Excellent! Thank you very much. It's easy when you know how. This works a treat!:
         private static void printHelp() {
              InputStream helpFile = Misql.class.getClassLoader().getResourceAsStream("doc/MISQLhelp.txt");
              if (helpFile == null) {
                   _out.println("Help file: doc/MISQLhelp.txt not found.");
                   return;               
              try {
                   int c;
                   while ((c = helpFile.read()) != -1)
                        _out.write(c);
                   helpFile.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return;
         }

  • How to step thru the code in jar file.

    I am trying to step through the code in the jar file. My code is a Java stored procedure which uses a jar file. Whenever I try to Trace into the code residing in the jar file I am always hitting the
    JDeveloper API Decompiler STUB SOURCE generated from class file.
    I tried to set up the Class path and Source path in the Project Options but it didn't help.
    Any help is appreciated.
    Thanks.

    If are trying to debug the Java Stored Procedure deployed in Oracle8i (816), then you should be using Remote Debugging feature in JDeveloper 3.1
    check out http://technet.oracle.com/products/jdev/info/jdev/rdjsproc/s000.html http://technetinside.us.oracle.com/products/jdev/info/rdebugwp/rdebugwp.html
    raghu

  • How do you know all the pages where a portlet has been included??

    Hello everybody, please ...
    I'd like to know the way to find out all the portal pages in which a particular portlet has been published/inlcuded
    I'm deploying on OAS (10g, I think).
    I have access to the portal builder and the portal data base too.
    I hope someone can answer!. Thanks very much.
    - Pablo -

    Hi, thank you for having responded to me so quickly. Excuse me instead for the delay with which you answer.
    I tried "lifetime" or a similar word in my preferences panel but I could not find. I have the software in Italian.
    I attach screens. You see something that might look like the "lifetime"? Thank you very much!

  • How do I see the group that my contact has been assigned  to when I view the individual contact card?

    I have added my contacts to specifics groups via icloud. I want to be able to see the group my contact belongs to when I bring a contact up (either on my iphone or on icloud).  How can I get the "Group"  the contact has been assigned to to show on their contact?

    what do you mean by game-state
    PS: i asked this question and they told me to be more specific.

  • How do you fix the error message, An error has been encountered while writing the current CD list.

    The error message goes on to say, Please check your device settings or consult your device documentation regarding resolving writing errors. Which device do you think they are referring to? The message came up half way through writing Track 5. So I selected a second set of tracks and got the same error message, this time at Track 3. I tried to play written CD (imation CD-R 1x 52x 700 mb). Opened the tracks using Windows Media Player. First time I was able to play one or two tracks, next time Window Media Player gave me the error message error message C00D0FAB. I have twice before successfully recorded the tracks using a Rode Podcaster, mixed them down and successfully wrote two version of my audio book. Now its not working. Any solutions?

    David GW wrote:
    The error message goes on to say, Please check your device settings or consult your device documentation regarding resolving writing errors. Which device do you think they are referring to?
    Sorry, but I would have thought that this was rather obvious! The only device capable of being written to under these circumstances is your CD drive; after all, it's a CD you are trying to create...
    You have two potential major causes of problems here. The most common cause of these difficulties is the disks themselves - you only need a batch with poor reflectivity to cause all sorts of read errors, so that's the first thing to try - using a different brand of disk to write to. The second thing you have to realise is that CD writers have a finite life - the lasers in them simply don't last for ever, and towards the end of their lives the power behaviour tends to be a bit erratic, and it tends to fall off somewhat - which causes the same sorts of errors, simply because the dye doesn't get evaporated efficiently. This causes mis-formed pits, hence the read errors. The only solution here is to install a new drive.
    When it comes to reading, commercial CDs have a much higher reflectivity than ones you write yourself, so often these will play whilst your own will fail - a common cause of confusion, this. But it's worth checking; if you get failures to reproduce all of the tracks from a commercial pressed CD, then almost certainly your drive is failing.

  • How do i save the fact that a button has been clicked.

    So im creating a game in which I collect objects that represent money.After I die in the game i get into the Shop Class in which i can buy different items depending on the money i have. So lets say that after dying i have enough money to get item1 and item2. So i Click on button1 (representing item1) andbutton2 (representing item2) (when clicked their alpha gets to 0.5) and start the game again.Ok so now i have 1 life more and i get more money.But suddenly out of nowhere i feel something strange deep in me, something that i have never felt before -> HUNGER,
    I shut down the PC and run as fast as possible to the nearest shop.
    //lets say item1 is : +1life and item2 is : get more money from objects
    After I had satisfied my primal needs I feel the strong urge to play that awesome game of mine again. But when i start the game I start to see some strange things: It seems that I havent got one life moreand neither do i get more money and just to be sure that Im not hallucinating (or that i didnt rememer the lifes i had last time) I die on purpose so the Shop menu shows. So now what I see is making me sad -> button1 and button2 are active and have an alpha of 1( and that means that the game thinks that they were never bought/clicked, that i have never played this game before in my life) So i go crazy (cause all that play before was for nothing and i have to start all over again).
    After i calm down, I decide to change my life. 1st BIG change is adding some code into the game. To be more specific: a method that will save the items that i bougth, so when i close the game and start again the things i see will bring joy to my life - >: I still have the items that i bougth last time.
    So long story short:
    how do i make that when i click a button (it changes its alpha to 0.5)and close the FLA , whenever i open the same FLA, the button that i clicked before will be shown as clicked now(it alpha will be 0.5)
    I know it has to be with sharedObject and yet i dont know how
    currently i have this:
                            private var savedData:SharedObject = SharedObject.getLocal("sharedStorage12");
                        private var buttonInfoArr:Array = [];
                        private var numberOfSavedObjects:int = 0;
                        private var brokenBtnArray:Array = [];
                        public function Main()
                                   for (var i:int = 0; i < 4; i++)
                                            var myImage_mc:MovieClip = new MovieClip();
                                            myImage_mc.graphics.beginFill( 0xFFFFFF * Math.random() );
                                            myImage_mc.graphics.drawRect(0,0,100,100);
                                            myImage_mc.graphics.endFill();
                                            myImage_mc.x = 50 + i * (myImage_mc.width + 10);
                                            myImage_mc.y = 100;
                                            myImage_mc.name = "myImage_mc" + i;
                                            this.addChild(myImage_mc);
                                            myImage_mc.mouseEnabled = true;
                                            myImage_mc.buttonMode = true;
                                            myImage_mc.addEventListener(MouseEvent.CLICK, onClick);
                        private function onClick(ev:MouseEvent):void
                                  var thisButton:MovieClip = ev.currentTarget as MovieClip;
                                  trace(thisButton.name);
                                  thisButton.alpha = 0.5;
                                  thisButton.buttonMode = false;
                                  thisButton.removeEventListener(MouseEvent.CLICK, onClick);
                                  buttonInfoArr.push( thisButton.name );
                                  savedData.data.myArray = buttonInfoArr;
    How do i use that savedData or how would you do it?
    PS: can it be done without Dictionary class, cause i still havent grasp my mind over it.

    what do you mean by game-state
    PS: i asked this question and they told me to be more specific.

  • UDF: how to find out the context in in-queue has been changed? (java)

    Hi,
    does anybody know?
    Is there som function for this? Because I have a inbound queue with 2 separate contexts, let's say:
    A
    B
    C->changes context
    X
    Y
    Z-?changes context
    Let's say I need to return first values in each context. how to do that in UDF?
    Thank you,
    Olian
    Edited by: Olian Saludew on Aug 12, 2008 7:11 PM

    Hi,
    Create the Advanced UDF as below
    While creating the UDF select the Cache parameter as Context
    Then just use below code.
    here a---> Source field
    result.addValue(a[0]);
    This will always take only 1st value of queue.
    Thanks
    swarup

  • How can we change the structure after a Journal has been created??

    Hi Experts,
                    We have made an application and create a journal for it using the journal wizard.
    But later on on the development, we need to change or modify the structure of the application.
    so when we try to do it, the system prompt that we cant change the structure because it has journals.
    so we use the clear journal function and try it again. It still give the same prompt.
                    How can we deal with this problem?? we really need to change the structure.
    Thanks,
    Bennie Jay

    Hi Shova V.
                  I tried it and it worked!!! thanks!!  although it doesn't work for the first time when i try to modify. if have to process it first for  it to work.
                  I just hope in the next version it shouldn't be manually done.
    Thanks,
    Benniejay

  • HT1766 hi, how to call back the back up when its has been overwrite with the new one?

    hi, i was tried to back up and restore my iphone 5 and then update to the latest version with my mac itunes, unfortunately my iphone 5 hang in the middle and it reback-up and overwrite the previous one and i didnt know how com it will overwrite the old one with the new back up, which means all my datas gone, how am i going to call back them?

    You don't unless you keep regular backups of your computer in which case you can restore previous backup files.

  • How can i find the history of devices that has been connected to my itunes?

    i wanna see old device that i once connected to my itunes. is there a way that can check. i have gone to manage my device but thats only for currect devices. im just wanna see back a couple of months.

    pvillecisco wrote:
    i wanna see old device that i once connected to my itunes. is there a way that can check. i have gone to manage my device but thats only for currect devices
    Actually, that is for devices that have been set to automatically download or you have used to redownload previously purchased items.
    They will show until you delete them.

Maybe you are looking for

  • Report program for  purchasing doucment per vendor

    hi gurus am using ME2L tcode in which i need to include a new field called last delivery date in my report how to give a start to that program. i have tried own way in that i dont no how to give link to the table .I tried with views but some tables d

  • Who's Who Widget

    Hi experts, I'm trying to use who's who widget. Previously I deployed  zcap.prt.widget.whoswho.par in the Portal, but when I load de widget, set the preferences (host,port,user,pasdw) and make a search,   the following  error message appears: failed

  • How to open winmail.dat attachment on N95

    Hi everyone please help V10.0.018 15-03-07 RM-159 Nokia N95(09.01) I have a nokia N95 and when i recieve any email attachment which is excel file or word file by email it is shown as winmail.dat and i cannot open the file or even save it with a diffe

  • Burning Student-made GarageBand music to CDs??

    My students made their own songs in GarageBand. It was an end-of-the-year reward for them to burn them onto a CD to take home. We tried sending to iTunes and then burning a CD as well as just changing the file to an MP3 - neither approach worked in a

  • [SOLVED][ext4]Tuning "bytes-per-inode ratio" ?

    Hi, I'd like to format two partitions (under LVM) with ext4, a / (20GB) and a /home (890GB). The usage pattern for the /home partition will be fairly standard (smalls documents, configuration files, a lot of media). The wiki mentions something about