Loading/unloading

I have some midi files, on the button click (actionperformed) it plays the midis, once the midi stops playing it unloads the form. What do I have to do so that the application doesn?t unload? I can?t seem to find a way to do it.
Please advice.

what the following code does it, it creates and plays note(33). As soon as it finishes playing the note the GUI unloads.
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
           Score scale = new Score();
           Part inst = new Part("", 1, 0);
           Phrase phr = new Phrase(0.0);
           Note n = new Note(33,1);
           phr.addNote(n);
           inst.addPhrase(phr);
           scale.addPart(inst);
           Play.midi(scale); 
}

Similar Messages

  • Load / unload numerous images in air application (memory leak?)

    Hi,
    after struggling for a few days with this, I realized I need help!
    I am trying to make an application load and display A LOT (hundreds) of images thumbnails at various position in a big area. The problem is that when I try to unload and reload images, I end up with an increasing memory, that does not get collected by the garbage collector.
    My first challenge was to load images from anywhere in the computer (I am quite new to flex), which I solved by using a File reference and a Loader using the url extracted from the file:
                   private function createImage():void {
                             var img_:String = "1905_a_mondrian.jpg";
                             var imageFile:File = new File();
                             imageFile.nativePath = imagesPath + "/" + img_;
                             var imageLoader:Loader = new Loader();
                             // useWeakReference permits the GC to collect the memory when the eventListener is dropped
                             imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
                             imageLoader.load(new URLRequest(imageFile.url));
                             imageFile = null;
    I make sure I remove the eventListener in the loaded method:
         e.target.content.removeEventListener(Event.COMPLETE, loaded);
    And then Populate an external component:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/halo"
              x="-100" y="-100"  width="200" height="200" >
         <!-- The trick is right above this line: offset the anchor point to center the component around -->
         <fx:Script>
              <![CDATA[
                   import mx.controls.Image;
                   [Bindable]
                   public var image:Image;
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <mx:Image id="img_" source="{image}" horizontalCenter="0" verticalCenter="0" autoLoad="true" />
         <!-- impair width and height results in problems for centering the ellipse (e.g. for rotation) -->
         <s:Ellipse height="4" width="4"  horizontalCenter="0" verticalCenter="0" >
              <s:fill>
                   <s:SolidColor color="0x00FF00"/>
              </s:fill>
         </s:Ellipse>
    </s:Group>
    I populate a Dictionary to keep a track of all the component created. Finally I nullify all that I can to hint the garbage collector.
    Now I have a function to empty the Dictionary (componentBag below) when we want to unload the images:
                   protected function button1_clickHandler(event:MouseEvent):void
                             for each ( var g : Group in componentBag )
                                       ((ImgPanel)(g.getChildAt(0))).img_.unloadAndStop(false);
                                       ((ImgPanel)(g.getChildAt(0))).image = null;
                                       delete componentBag[g.uid];
                                       g.removeElementAt(0);
                                       this.removeElement(g);
                                       g = null;
         triggerGC();
    PROBLEM: using profiler, the loading/unloading works once or twice and after the memory keeps increasing... And if I launch the application, wait for a while and do a load/unload, the garbage collection only recovers a few megabytes, far from what was allocated for displaying the images.
    What am I missing? Is there a problem with loading a lot of images? Has anyone done this?
    In attachment is the full test code, the ImgPanel goes inside a 'views' package

    Thanks to Anton_AL, I finally solved this problem by using an URLLoader AND a plain Loader:
    var loader: URLLoader = new URLLoader( );
    loader.dataFormat = URLLoaderDataFormat.BINARY;
    loader.addEventListener(Event.COMPLETE, onLoadingComplete );
    loader.load( new URLRequest(file.url) );
    private function onLoadingComplete( e: Event ):void
         var loader: Loader = new Loader( );
         loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onParsingComplete );
         loader.loadBytes( e.target.data );
    private function onParsingComplete( e: Event ):void
         var img: BitmapImage = new BitmapImage( );
         img.source = (e.target.content as Bitmap).bitmapData;
         _images.push( img );
    private function onImageLoaded( e:Event ):void
         var img: Image = e.target as Image;
         img.removeEventListener( Event.COMPLETE, onImageLoaded );
         _images.push( img );
    See Anton's thread here: http://forums.adobe.com/message/2358653#2358653

  • New HDD Load / Unload Cycle Count increasing extremely fast !

    Hi all
    I just upgrade my Pavilion dv5 HDD. The new model is Hitachi Travelstar 7K500 (HTS725050A9A364). However, I found my new HDD's Load / Unload Cycle Count increasing extremely fast!
    Until now the number of Load / Unload Cycle is 12,127. However, the new HDD only power on 137hours. (About 1 week of my use.)  The data below is my new HDD's SMART data (by EVEREST 5.50):
    ID   
    01    Raw Read Error Rate    62    100    100    0   
    02    Throughput Performance    40    100    100    0   
    03    Spinup Time    33    159    159    2  
    04    Start/Stop Count    0    100    100    14   
    05    Reallocated Sector Count    5    100    100    0  
    07    Seek Error Rate    67    100    100    0  
    08    Seek Time Performance    40    100    100    0  
    09    Power-On Time Count    0    100    100    137  
    0A    Spinup Retry Count    60    100    100    0   
    0C    Power Cycle Count    0    100    100    14  
    BF    Mechanical Shock    0    100    100    0   
    C0    Power-Off Retract Count    0    100    100    1 
    C1    Load/Unload Cycle Count    0    99    99    12127   
    C2    Temperature    0    152    152    19, 36  
    C4    Reallocation Event Count    0    100    100    0   
    C5    Current Pending Sector Count    0    100    100    0  
    C6    Offline Uncorrectable Sector Count    0    100    100    0  
    C7    Ultra ATA CRC Error Rate    0    200    200    0  
    DF    Load/Unload Retry Count    0    100    100    0   
    I'm pretty sure that the data is correct, because I can hear the HDD's Load / Unload sound very frequently. The C1 row increase about 2,000 per day.  However my previous Hitachi 5K320 has no problem. The running operating system are both Windows 7.
    I'm so worry about this. As you know, laptop HDD's L / UL Cycle is designed at 600,000. If my HDD continue increasing like this, it will reach this number in a very short time. Any one can help me?

    It's a feature of modern 2.5" harddisks , the disk parks the head when its been inactive for a while, to avoid damage , uses less power , and reduces the heat etc gives the harddisk a better looking spec sheet , its meant to park its head after being inactive for a long time around an hour with proper management from the bios/os of the head parking feature, because there is nothing to manage this feature in hp's bios or os the disk parks the head about every minute for no reason then after 1 second the head goes back on the disk thats 1 load/unload cycle , it also effects performance as the head has to find its place back on the disk , load times will decrease by alot , videos will stutter the first few secs, i have the same problem but not as bad after 130 hours i had a count of around 1,250 load/unloads , different brands of disk have different idle timers plus i use utorrent which stops the harddisk from idling so much, there are a couple of solutions, you can find a tool to update/mod the harddisk firmware to increase the idle timer ( i decided against this as you can permently brake the harddrive and void the warrenty) , contact hp and request a bios update with proper management or the harddisk head parking feature i.e tell the harddisk it is idle after an hour, the temperary solutions are download hd tune and run it all the time this stops the harddisk from parking its head as it doesn't let it go idle , or the solution i am using at the moment download a programme called HDD scan , everytime you turn on/off  you have to run the prog go to tasks/features/ide features set the advance power management from its default value to 254 then press set, no more unnessary load/unloads, downside is the disk runs a couple of 0c hotter mine still never goes above 40c even under full load thanks to a active cooling pad, also its less well protected against shock.

  • Load/Unload Component from Main Application

    I want to load in my main application 2 components. At this moment I load them with this:
    <components:loadProject id="loadPrj" visible="false" click="loadPrj_clickHandler(event)" verticalCenter="7" horizontalCenter="0"/>
    and I only set visible to true. Inside this component there is a canvas.
    But, is there any other way to do this using an AS class file? I would like to load/unload it on click, not only set true/false to visible.

    For dynamic creation and destruction of objects, you want to use ActionScript.
    So in your main app file, you might have a button that triggers a click handler that does this:
    private function myClickHandler()void {
                    var b1:CustomComponent = new CustomComponent();
                    var b2:CustomComponent = new CustomComponent();
                    /// Be sure to add them to the display list if they are visual components
                    myPanel.addElement(b1);
                    myPanel.addElement(b1);

  • Load & Unload Movie Issue

    Hi Guys:
    Have 2 unable solve issues, would be much appreciated if anyone could help.
    // ISSUE 1 //
    I am experiencing an issue with Load & Unload Movie.  What happen is that I am trying to load an external SWF into a movie clip call movieContainer in my main website.  This external SWF file has timeline that perform a animation when it's loaded into the movieContainer.
    I can load and unload the movie with no problem...the issue is that after I unload the SWF and then at any point of the movie on the main website I click to load the SWF back to the stage.....the timeframe of the SWF file stay at where it get left off(when it's unloaded).  I am trying to make it play start all over again.
    I try the movieContainer.content.gotoAndPlay(1); but it doesn't do anything. Any idea how I could make this work?
    Here is my code:
    var content:Loader = new Loader();
    content.load(new URLRequest("externalSwf/content.swf"));
    loadMovieButton.addEventListener(MouseEvent.CLICK, loadMovieButtonClicked);
    function loadMovieButtonClicked(e:MouseEvent):void{
        movieContainer.addChild(content);
    // ISSUE 2 //
    In my external SWF file, I have create a loading loader at the 1st frame.  But it doesn't play all the time when I testing on the server.  It works just fine when I test locally with TEST MOVIE.  Not only it doesn't play all the time.....it suppose to play from 2nd frame of the movie after the loading is finished (I have a short animation play between frame 2 - frame 20)  Instead of playing from frame 2 to frame 20, the animation just jump straight to frame 20...which mean the user won't see the animation between frame 2 - frame 20.
    import flash.events.ProgressEvent;
    function update(e:ProgressEvent):void
    var percent:Number = Math.floor( (e.bytesLoaded*100)/e.bytesTotal );
    if(preloaderMC is MovieClip){
    preloaderMC.gotoAndStop(percent);
    //preload_txt.text = String(percent);
    if(percent == 100){
    gotoAndPlay(2);
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, update);
    // Extra test for IE
    var percent:Number = Math.floor( (this.loaderInfo.bytesLoaded*100)/this.loaderInfo.bytesTotal );
    if(percent == 100){
    nextFrame();
    stop();
    Many Thanks!

    Thanks for the reply, the code I use to load the external SWF is:
    The button is within a movieClip: commercialScrollBar_mc
    The button instance name is: stackPancakeBar
    The external SWF get to load into a movieClip container call: projectDetailsContainer_mc
    var ldr:Loader = new Loader();
    ldr.load(new URLRequest("projectsCommercial/stackPancakeBar.swf"));
    commercialScrollBar_mc.stackPancakeBar.addEventListener(MouseEvent.CLICK, stackPancakeBarClicked);
    function stackPancakeBarClicked(e:MouseEvent):void{
        MovieClip(ldr.content).gotoAndPlay(1);
        projectDetailsContainer_mc.addChild(ldr);
    I was thinking does it has anything to do with the UNLOAD script I have on the external SWF file? Below are the code for removing the child.
    back_btn.addEventListener(MouseEvent.CLICK, removeProjectDetails);
    function removeProjectDetails(e:MouseEvent):void{
        this.parent.parent.removeChild(this.parent);
    Thanks Heaps, by the way, do you have any idea why the loading sequence doesn't get to play every time?  Or perhape the file size is too small?

  • RSRV Load/Unload of indexes

    Not important topic, but may be someone from SAP will be interested with this observation.
    Loading and unloading (i.e. deleting) from memory of the huuuge single BIA index with RSRV I noticed incremental increase of memory consumption on the blade where this index is assigned. After couple of repetitive loads/unloads I incresed memory consumption from 6GB to 13GB. (Then I decided to stop, otherwise I would might crash my 16GB blade).
    Regards,
    -Vitaliy

    Hi Satyam,
    It was an issue with memory leak in that Revision of BWA. Current revisions (like 50+) are much-much better with that.
    Regards,
    -Vitaliy

  • Load/unload

    Hi,
    The question is for ASO specifically.
    What would be the scenario where we need load/unload application/database scripts when we load the data?. Does it depend on the amount of data loaded or any other factor.?
    Can we eliminate the load/unload part from the script. (Essbase services are stopped/started overnight, so I assume this will take care of writing everythign to the hard disk from memory).
    Can you please share your thoughts on this?
    Thanks,
    Tom Thomas

    I can see the rational for doing it. There are some commands that will fail if the ASO cube is not loaded (It will not be auto loaded) so people put in the load command to make sure it is running. As for unload, if you had limited resources on the machine or wanted to consume a lot of memory for an application unloading applicaitons not being used frees up those resources. So people will stop the application when done loading so it does not use any resources until someone needs it. This is especially important when you have a ton of applications on a server. I have one client with over 100 applications and if they start them all, they run out of memory. Most of the apps are historical and are used very little so during processing they start the app, do an export(makes sure the app is still working) and then stops it then goes on and does the next one

  • Load/Unload Picture

    Hi all,
    How to load/unload a picture into an Image Item.
    best regards
    Jansen Hutagalung

    Hi,
    Actualy what I want to know is how to remove picture from an Image Item.
    Best Regards,
    Jansen

  • Very high HDD load/unload cycles and hardware ECC (SMART)

    Hello,
    I just took a look at my Seagate HDDs SMART values and found 2 very high numbers:
    Load/Unload Cycle Count: 29.422, and increasing +1 like every 15 seconds, together with a clunking noise.
    Hardware ECC Recovered: 320.239.221, and increasing +10 or more like every second.
    The Load/Unload stuff seems to be aggressive power management of either the drive itself or the OS, I have no clue how to stop this. I tried keeping the drive busy with declunk, but it still parks the heads every few seconds.
    But what is Hardware ECC ? And can anyone give me an advice on how to stop my drive moving the heads to the parking position every 15 seconds ? When I used Tiger, opening Photo Booth did the trick, doesn't work on Leopard tho. The HDD is less than 1 month old...

    I too was getting so annoyed by the clunking sounds. The APM settings for the HDD are obviously out of whack completely. Tried Declunk which has been mentioned in other threads in the forums. It basically runs as a daemon making a small file and then deleting it every 5 seconds. I got it to work, but I had to introduce an additional parameter string to force it to create the file every 4 seconds. Visit http://kiza.kcore.de/software/declunk/ for more information on this issue.
    Overall, I was still unhappy with the solution. Creating a file ever few seconds isn't optimal.
    Having tested disabling the APM settings with hdparm for WinXP (Via Bootcamp) and found that it fixed the clunking sound, I knew that APM was definitely causing the sound. Of course, hdparm did not update the firmware of the hdd, so every time I powered down my MBP, the hdd would go back to APM being on "FULL" bringing
    back the "clunk" sound.
    The ideal solution was to obtain some kind of APM management software for OSX. Unfortunately, the historical application known as APM Tuner X was no longer being developed by the author and does not run in Leopard.
    Thats when I found HDAPM!!!
    http://mckinlay.net.nz/hdapm/
    How did you determine the load/unload cycles for your HDD? In the end I located a copy of smartmon for Windows and booted into WinXp (via Bootcamp). I think my cycles are up to over 100,000... Not sure how to easily tell?!
    Anyway, I hope that this solves your issue. Apple's Energy Saving system preference pane SHOULD disable putting the hard disk to sleep if left unchecked, but I also believe this is an issue with many HDD's. Seagate are shocking when it comes to releasing firmware upgrades too by the looks of things.

  • T400s Hard Drive Clicking - Load/unload cycle count SMART Attribute decreasing very quickly

    Hi,
    I get a T400s 2808 CVG. I degrade to XP Pro SP3.
    The Hard-drive is Toshiba MK2529CSG.
    I experience Hardrive clicking (or ticking) when the hard drive is idle. Forcing the drive to be busy silences the ticking sound.
    On the other hand I get the issue that "Load unload cycle count" SMART attribute is  decreasing very quickly. I loose 1 point each 4 or 5 days.
    I also make a little test to check the correlation between the reported number of load unload cycle count and the ticking sound. 
    Postive. Each time I hear the tick, each time the SMART attribute report one more Load/unload cycle count.
    Any one get the same issue?
    Any solution?
    I already see and read http://www.thinkwiki.org/wiki/Problem_with_hard_drive_clicking
    Thanks and regards,
    Patrick

    any harddisk that make any unusual mechanical noises probably means the the harddisk will die soon
    T400s - 2815RW1 + Win7 Ultimate
    Don't pm me for help! That's what the forum is for. Also, Google's nicer than me. Ask him.

  • How to use Load XML Data (Home Utilities Data Load/Unload Load)

    How is Load XML Data (Home>Utilities>Data Load/Unload>Load) supposed to work? Where is this documented?
    What table type/structure is required?
    How does this related to XDB functionality?

    It's not really documented that well in the XE redux documents (or even the base Apex Documents)- see http://download-west.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/sql_utl.htm#sthref2530
    However, it's reasonably easy to use - you can export a table to XML format, and then reload the table with the data by importing the XML document. It has nothing to do with XDB, it's just a different flat file representation for unloaded data than CSV

  • Diff. times are taken to complete load unload archive and unarchive

    Hi All,
    I am facing a problem with loading  unloading archiving and unarchiving repository.
    Problem is Everyday it is taking different to complete the process. Is the time deneds on the data and images availavle in the repository?
    If large amount of data is there then it will take more time to complete all these process or large amount of user are log in it will take more time to unload?
    Please Suggest
    Thanks

    Hi Shalini,
    The repository Archieving and Unarchieving operations involves the data base.
    I mean Repository  tables and fields and the data of the repository are in the underlying database and You can backup an MDM repository using the MDM archiving mechanism.That will save the repository scema .a2a file for furthere refrence.This schema contains the tables and fields inside the tables and all these things are storesd on the DBMS level.So suppose next time when you unarchieve the repository and made some changes like
    1.You have added some new Tables and Fields.
    2.You have added new Data.
    And all this is getting stored at the database leve at the end.
    In this case the amount of data of your repository in terms of Tables and Fields or Data at the DBMS Level.So next time when you  take archieve of your Repository It will take some extra time as compare to the previous one.And same thing will happen in case of Unarchieving because this time some new tables and their fields  and some new data(images,pdfs etc) they all will be unarchieved as a Part of Repository so it will take a bit extra time to Unarchieve.
    Same thing will happen in case of Loading and Unloading as the tables ,fields and amount of data increases the time to load and unload will also increases.
    At the time of loading the repository You can go to your MDM Server and check that repository in status it will show checking image ID's ,processing tables,processing sound tables,loading search indexes etc.
    Making a few minor adjustment with MDM and/or the DBMS server can enhance search and update performance by 10% to 20%.
    SQL Serveru2019s performance increases by about 10% when the main data file (.mdf) and the transaction log file (.ldf) are located on separate spindles. Remember that this means using different drives, not just
    different drive letters.
    Reward if Helpfull.
    Regards,
    Vinay Yadav

  • Load/ Unload external .swf

    ----------------------------------------
    vita | web | design | illustration
    "main" here
    I try to have external .swf on this "main" part of my flash
    design automatically using load actionscript.
    I have 3 different sets of actionscripts for load/unload.
    But, the problem is when I click vita or other menu on the
    top after loading "main" external .swf, they are overlapped.
    How can I unload the external .swf from the automatically
    loaded .swf?
    (As I know, there are mostly buttons to click on loading
    external .swf. But for my design, I want it loads automatically.)
    Thanks in advance for suggestions. Please let me know if my
    description/question is not clear to answer.

    Are you using AS2 or AS3. The approach is completely
    different for both.

  • How to Load/Unload external SWF

    Hey all, I'm in a desperate struggle to meet a deadline for college coursework. I am unable to UNLOAD an external SWF file that I have put inside another SWF file. The problem that is occurring is, although it loads successfully, when I attempt to navigate to another page after viewing the external SWF, I expect it to close as it goes on to another page however, it remains in place. If i then go back on to the page that it is loading from, it will start to keep adding more and more SWF's. The print screens should explain it easier... Below i'll post the code that I'm using currently. The external SWF I am trying to load/unload is an interactive hangman game (whether it being interactive has an effect I do not know), but any and all help with this would be seriously appreciated!
    The code currently being used is:
    var _swfLoader:Loader;
    var _swfContent:MovieClip;
    loadSWF("Real Hangman.swf");
    function loadSWF(path:String):void {
       var _req:URLRequest = new URLRequest();
       _req.url = path;
       _swfLoader = new Loader();
       setupListeners(_swfLoader.contentLoaderInfo);
       _swfLoader.load(_req);
    function setupListeners(dispatcher:IEventDispatcher):void {
       dispatcher.addEventListener(Event.COMPLETE, addSWF);
       dispatcher.addEventListener(ProgressEvent.PROGRESS, preloadSWF);
    function preloadSWF(event:ProgressEvent):void {
       var _perc:int = (event.bytesLoaded / event.bytesTotal) * 100;
       // swfPreloader.percentTF.text = _perc + "%";
    function addSWF(event:Event):void {
       event.target.removeEventListener(Event.COMPLETE, addSWF);
       event.target.removeEventListener(ProgressEvent.PROGRESS, preloadSWF);
       _swfContent = event.target.content;
       _swfContent.addEventListener("close", unloadSWF);
       addChild(_swfContent);
    function unloadSWF(event:Event):void {
       _swfLoader.unloadAndStop();
    removeChild(_swfContent);
       _swfContent = null;
    This printscreen is showing what it looks like in the Flash view (plain background and external SWF loads when this SWF is published)
    What it looks like when loaded as published swf
    Picture of the external SWF working inside the other SWF
    Picture of it not being able to unload when i navigate to another page!
    Finally, a picture of it doubling up when i proceed to go on the 'game' page again, it just keeps loading the SWF's rather than unloading them!

    for example, file1 consits of two buttons, and also considered as main page. As i click on these two buttons , it will lead me go to open the external file2.swf, and file3.swf respectively. (file2.swf and file3.swf could have other navigation buttons, however, i am just simplify here).
    the code you provided is working fine. but i want to totally remove/unlink the orginal file (file1.swf) when i click on either buttons which could lead me to other page (file1.swf or file2.swf).
    Besides that, in file2.swf and file3.swf could have another "back" button to turn it back to the main page (file1.swf). When the user click on that back button, the file2.swf will unloaded...and file1.swf will be called back again...
    can it  be done?
    so sorry if my poor explanation makes you confuse..
    thank you.

  • OSGi bundle JNI load/unload problem

    Hi everybody!!
    One more thread about the topic. I still didn't find a solution. Can anybody help me?
    I have an OSGi bundle that access native methods from a JNI library (for a medical device). I could make my bundle work once, but the second time I tried to access the methods, the dll was still in use I couldn't get data from the methods.
    This is the class I used (I even tried with a custom libloader):
    public class Omron637ITjni {
         /*Native functions from the JNI dll*/
         public native int OmronInit();
         public native int OmronClose();
         public native int OmronFinish();
         public native int OmronOpen(int disp);
         public native int OmronRead(MeasurementData MData, int pos);
         public native void OmronNumRead(DataCount DCount);
         static{
              //Using LibLoader
              /*try {
              LibLoader.loadCommLib("omron637IT");
              catch ( Exception x ) {
              // do what is necessary
                   System.out.println(x);
              //Using System Commander
              try{
                   System.out.println("Charging Library Omron");
                   System.loadLibrary("omron637IT");
              }catch(UnsatisfiedLinkError unsatisfiedlinkerror)
    System.out.println("Error loading library: " + unsatisfiedlinkerror);
    As it seems not to work, I'm trying with Singleton pattern. This is my new class:
    public class Omron637ITjni_Singleton {
              * Native functions from the JNI dll
              public native int OmronInit();
              public native int OmronClose();
              public native int OmronFinish();
              public native int OmronOpen(int disp);
              public native int OmronRead(MeasurementData MData, int pos);
              public native void OmronNumRead(DataCount DCount);
              private static Omron637ITjni_Singleton singleton;
              * Instance accessor following singleton.
              public static Omron637ITjni_Singleton getInstance() {
                   if (singleton == null){
                        System.out.println("Create Object");
                        singleton = new Omron637ITjni_Singleton();
                   else{
                        System.out.println("Object already created; use instance");
                   return singleton;
              * Private constructor to ensure that a <tt>ResourceManager</tt>
              * cannot be constructed from outside this class.
              private Omron637ITjni_Singleton() {     
              static{
                   //Using LibLoader
                   /*try {
                   LibLoader.loadCommLib("omron637IT");
                   catch ( Exception x ) {
                   // do what is necessary
                        System.out.println(x);
                   try {
                        System.out.println("Charging Omron library from Singleton");
                        System.loadLibrary("omron637IT");
                        System.out.println("Library charged");
                   } catch (UnsatisfiedLinkError ule) {
                        System.out.println("Error loading library: " + ule);
    At this very moment, when executing
    Omron637ITjni_Singleton jni = Omron637ITjni_Singleton.getInstance();
    from the Activator, I get from the Knopflerfish console:
    [stdout] omron637ITBPM starting...
    [stdout] Service registered: Omron 637IT Blood Pressure Monitor
    [stdout] Charging Library Omron desde Singleton
    [stdout] Library chatged
    [stdout] Create object
    Then, I call a services provided by the bundle:
    framework call omron637IT.Omron637ITInterface getData
    which calls the following function:
    public void getData() {
              // TODO Auto-generated method stub
              //Omron637ITjni jni = new Omron637ITjni();
              //Singleton
              Omron637ITjni_Singleton jni = Omron637ITjni_Singleton.getInstance();
              try {
                   int res = jni.OmronInit();
                   int ok_open = jni.OmronOpen(res);
                   System.out.println("The attempt of connecting the Omron637IT device ended with code: " + ok_open + " [(0) normal (1) still in process (2) error]");
                   if (ok_open == 0){ //OK
                        DataCount NumData = new DataCount();
                        jni.OmronNumRead(NumData);
                        System.out.println("DATA");
                        System.out.println("----");
                        for (int pos = 0;pos<NumData.nData1;pos++){
                             MeasurementData Data = new MeasurementData();
                             int ok_read = jni.OmronRead(Data,pos);
                             int annyo = Data.cYear + 2000;
                             int i = pos + 1;
                             if (ok_read == 0)
                                  System.out.println("Num: " + i + "; Date-> " + Data.cDay + "/" + Data.cMonth + "/" + annyo + "; Time-> " + Data.cTime + ":" + Data.cMinute + ":" + Data.cSecond + "; Sys-> " + Data.nSys + "; Dia-> " + Data.cDia + "; Pls-> " + Data.cPls);
                        int stop = jni.OmronClose();
                        System.out.println("Close with code " + stop + " Right?");
                        int finish = jni.OmronFinish();
                        System.out.println("Finish with code " + finish + " Right?");
                        System.gc();
                        System.gc();
                   else
                        System.out.println("The process of opening the device ended with error");
              }catch (UnsatisfiedLinkError ule) {
                   System.out.println("BRUTAL ERROR: " + ule);
    [stdout] The objeto already exists
    [stdout] BRUTAL ERROR: java.lang.UnsatisfiedLinkError: OmronInit
    Result: null
    which indicates that this time I'm using the same instance of the singleton class created in the activation process, but that I cannot access the method. ANY HINT??
    I also provide you the JNI dll code (because I add the exporting of the JNI_OnLoad & OnUnload methods:
    .h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class omron637IT_Omron637ITjni */
    #ifndef Includedomron637IT_Omron637ITjni
    #define Includedomron637IT_Omron637ITjni
    #ifdef __cplusplus
    extern "C" {
    #endif
    * OnLoad & UnLoad
    JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM vm, void reserved);
    JNIEXPORT void JNICALL JNI_OnUnload(JavaVM vm, void reserved);      
    * Class: omron637IT_Omron637ITjni
    * Method: OmronInit
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronInit
    (JNIEnv *, jobject);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronOpen
    * Signature: (I)I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronOpen
    (JNIEnv *, jobject, jint);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronRead
    * Signature: (Lomron637IT/MeasurementData;I)I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronRead
    (JNIEnv *, jobject, jobject, jint);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronNumRead
    * Signature: (Lomron637IT/DataCount;)V
    JNIEXPORT void JNICALL Java_omron637IT_Omron637ITjni_OmronNumRead
    (JNIEnv *, jobject, jobject);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronClose
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronClose
    (JNIEnv *, jobject);
    * Class: omron637IT_Omron637ITjni
    * Method: OmronFinish
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronFinish
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    and part of the code (.cpp):
    JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM vm, void reserved)
         return JNI_VERSION_1_4;
    JNIEXPORT void JNICALL JNI_OnUnload(JavaVM vm, void reserved)
    JNIEXPORT jint JNICALL Java_omron637IT_Omron637ITjni_OmronInit
    (JNIEnv *env, jobject obj)
         iNumberOflist = DEVLISTMAX;
         iSpeed = USF_SPEED4800;
         iStopBit = USF_STOP2;
         iProduct = USF_BPM;
         ret = USF_Search(hDlg, iSpeed, iStopBit, iProduct, DevList, &iNumberOflist);
         return iNumberOflist;
    Can anybody tell me what I'm doing wrong???. This really drives me crazy
    BR & very thanks in advance for any input.

    This is a known bug. Check out http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4712793

  • Bug or Feature - Loading / Unloading times before acceptable dates

    Hi Experts,
    I am facing an issue during Scheduling of Freight Orders. I have maintained 1 hr for Loading and Unloading times in the Planning Profile and set the system up to consider Freight Unit Dates.
    The Freight Order has only 1 Freight Unit stage - so a fairly easy example.
    Now when I look at the Freight Unit Dates after the scheduling run, the unloading starts at 02/13 23:00 , so even before the acceptable start date.
    Therefore my question: Is it a bug or a feature? According to my understand this should not happen.
    Thanks,
    Thomas

    2072923 - Changing pickup/delivery date to outside Pickup/delivery window triggers execution block for first and last
    This note may help.

Maybe you are looking for

  • Unable to create an encrypted disk image with Disk Utility

    Hi: With our upgrade to Lion a few weeks ago, we're now unable to create an encrypted disk image of any type using Disk Utility any more. This problem occurs on 3 different machines, and is reproducible whether one is using an internal HD or an exter

  • Url called from form question

    HELP! I created a form that allows the user to enter a number (SEATPLAN). The code below is executed on a custom PL/SQL button. It does not seem to work. The url generated runs fine typed directly into the url of a browser. But the called url from th

  • Group Space and Personal Space not listed

    Version used : 11.1.1.4 When I login to WebCenter Spaces as an administrator, I do not get the option to create a Group Space. I get links for Favourites, Logout, Help, Spaces, Administation but not for Group Space. Why is it so. I all the tutorials

  • HT1386 my sync stops due to iphone not found during the final copy step...how do I fix?

    my sync stops with an error message that iphone not founds during the final copy step...how to I fix?  always work before.

  • Tcode XK03 Search Help

    Hello All, I have a question regarding Tcode XK03 Search help.  We would like to modify the search help that is displayed when a user does a F4 on the vendor field.  There is a tab called Vendor by Tax Information in the search help that we do not wa