Run not called in thread

I'm trying to get a thread that runs in the background to update a label field in a screen, but for some reason any of the thread run() method is not called. I'm using JDE 4.3.0.

package UpdateTest;

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.system.DeviceInfo;
import java.lang.Runnable;
import java.lang.Thread;

public class UpdateTest extends UiApplication
{
    public UpdateTest()
    {
      pushScreen(new UpdateTestScreen());
    }

    public static void main(String[] args)
    {
        UpdateTest bm = new UpdateTest();
        bm.enterEventDispatcher();
    }
} 

final class UpdateTestScreen extends MainScreen
{
    LabelField _field;

    UpdateThread upThread;

    public UpdateTestScreen()
    {
        super();

        upThread = new UpdateThread();
        upThread.start();

        setTitle("Update field test");

        add( new LabelField("field: ") );
        _field = new LabelField("0");
        add(_field);
    }

    public boolean onClose()
    {
        Dialog.alert("exit");
        upThread.stop();
        System.exit(0);
        return true;
    }

    public class UpdateThread extends Thread
    {
        private volatile boolean _start = false;
        private volatile boolean _stop = false;
        private static final int TIMEOUT = 500;

        public UpdateThread()
        {
            super();
            System.out.println("UpdateThread Created");
        }

        public void stop()
        {
            _stop = true;
            System.out.println("UpdateThread Stopped");
        }

        public void start()
        {
            _start = true;
            System.out.println("UpdateThread Started");
        }

        public void run()
        {
            System.out.println("UpdateThread running");
            for(;;)
            {
                while( !_start && !_stop)
                {
                    try {
                        sleep(TIMEOUT);
                        System.out.println("UpdateThread sleeping");
                    } catch (InterruptedException e) {
                        System.err.println(e.toString());
                    }
                }

                if (_stop)
                    return;

                UiApplication.getUiApplication().invokeLater(new Runnable() {
                    public void run() {
                        _field.setText("" + System.currentTimeMillis());
                    }
                });
                System.out.println("invoked");
            }
        }
    }

}

If you go to substitute Thread.start, then call super.start () somewhere in there, like after your DD.

Tags: BlackBerry Developers

Similar Questions

  • the menu item run method not called

    Eclipse SDK Version: 3.4.1

    BlackBerry JDE plugin for Eclipse Version: 1.0.0.50

    BlackBerry JDE component package Version: 4.5.0.14

    I added a menu item to the contacts list. I would like to get the context when the user clicks the menu item, but the run method is not entered. When the user clicks the item in the menu the main routine is entered with correct arguments. Should not called run with the context method? No exception is thrown.

     

    Import net.rim.blackberry.api.menuitem.ApplicationMenuItem;
    Import net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository;
    Import net.rim.device.api.system.Application;
    Import net.rim.device.api.system.ApplicationDescriptor;

    SerializableAttribute public class BwMain extends Application {}
    private static final long APP_ID = 0xf46f5a7867d69ff0L;
    private static final String ARG_LAUNCH_BW = "1";

    public BwMain() {}
    long menuItemLocation = ApplicationMenuItemRepository.MENUITEM_ADDRESSBOOK_LIST;
    ContactsBwMenuItem menuItem = new ContactsBwMenuItem();
    ToolBarMenuButton.AddMenuItem (menuItemLocation, ARG_LAUNCH_BW, menuItem);
    System.Exit (0);
    }

    Public Shared Sub main (String [] args) {}
    If (args == null | args.length == 0) {}
    BwMain bwMain = new BwMain();
    bwMain.enterEventDispatcher ();
    }
    else {}
    System.out.println ("App launched from the menu");
    }
    }

    private public static Sub ToolBarMenuButton.AddMenuItem (long location, String argOfAppl, ApplicationMenuItem appMenuItem) {}
    Amir ApplicationMenuItemRepository = ApplicationMenuItemRepository.getInstance ();
    ApplicationDescriptor app = ApplicationDescriptor.currentApplicationDescriptor ();
    app = new ApplicationDescriptor (app, new String [] {ARG_LAUNCH_BW});
    amir.addMenuItem (location, appMenuItem, app);
    }

    private static class ContactsBwMenuItem extends ApplicationMenuItem {}
    {ContactsBwMenuItem()}
    Super (20);
    }

    public String toString() {}
    return "PC connection";
    }

    public Object execute (object context) {}
    try {}
    System.out.println ("input run method");
    } catch (Exception e) {}
    e.printStackTrace ();
    }
    Returns a null value.
    }
    }
    }

    You call system.exit() in the Builder before entering the EventDispatcher. I'm guessing that you add the menu item, but leave the application, and when the menu item is called it is more a reference to the context of the application and decides not to continue. The menu item will not remove itself when the application closes.

  • Call any thread DLLs the application crashes

    I have a built in 2015-labview application that acquires spectra of 6 spectrometers via an external dll. The dll triggers an event in labview when data is ready to be pulled from the spectrometers. Since this event, I am running a reentry no void / vi which contains a node function to retrieve the data, that are configured to run in any thread, as it gives a drastic improvement of performance as apposed to run in the UI thread.

    However this can slow down the application crash with a message from windows like the following journal:

    Name of the failing application: axiom 2.0.exe, version: 1.0.0.82, time stamp: 0x5581a6b7
    The failed module name: lvrt.dll, version: 15.0.0.4024, time stamp: 0x5581ac03
    Exception code: 0xc0000005
    Offset: 0x0000000000bec7c0
    ID of the process failed: 0x15c0
    Start time of application vulnerabilities: 0x01d11e6face9febd
    The failing application path: C:\Axiom 2.0\builds\Axiom 2.0\Axiom 2.0.exe
    Path of the failing module: C:\Program NIUninstaller Instruments\Shared\LabVIEW Run-Time\2015\lvrt.dll
    Report ID: 7d4ef3a8-8a91-11e5-94e9-90b11c894ef8

    I don't know if the dll is said to be thread safe or not. Also I do not understand how this causes a problem anyway since it is the only node that accesses the dll at the time, and each of the 6 spectrometers are interviewed in order?

    Is there anyway that I can still enjoy the benefits that the call of any thread dll provides without causing my application crash.

    An example of the increase in performance, it's that I can query the spectrometer from 6 to 70-80 Hz when configured to run in any thread, as opposed to a simple 10 Hz when the Run value in the UI thread.

    Thank you

    Jimmy01 wrote:

    I don't know if the dll is said to be thread safe or not. Also I do not understand how this causes a problem anyway since it is the only node that accesses the dll at the time, and each of the 6 spectrometers are interviewed in order?

    Is there anyway that I can still enjoy the benefits that the call of any thread dll provides without causing my application crash.

    Looks like that the DLL is not thread-safe. If you do not run in the UI thread, there is no guarantee that the DLL will be always called from the same thread, even if you only call it in one no reentrante Subvi. By default, LabVIEW allocates multiple threads by the enforcement system, with the exception of the user interface. If the DLL stores certain information of one call to the other, this context can be lost when run in a different thread.

    Here's a thread that provides two possible solutions; a wrapper DLL is required, use the other the utility 'threadconfig' (or the corresponding INI file settings) to force a subsystem of a thread executing unique http://forums.ni.com/t5/LabVIEW/Force-DLLs-to-tun-in-the-same-thread-expect-the-UI-Thread/td-p/11438...

    Another option would be to put the call to the DLL in a timed loop that runs constantly, and you can use a queue or the notifier to pass data to. A timed loop runs in a single dedicated thread, so I think it will work.

  • Call a thread after a specific interval of time?

    Hello, any help is appreciated...

    I use this to call my thread each time interval... .but I noticed that if my request is at bottom the timertask won't calls on the interval specified... sometimes its end a minute | 5 minutes | 10 minutes...
    Is there a better way to run this.
    This is the code:
    TimerTask _tt;
    _Timer timer;

    _tt = new TimerTask() {}
    public void run() {}

    new FlightCheckThread (_sqlmanager) .run ();
    } / / end of race
    };
    _Timer.scheduleAtFixedRate (_tt, 180000, 300000);

    Run is not the right way to start a thread's start().
    like the timertask documentation notes that it is not intended to block stains, using start() should solve the problem of synchronization.

  • onExposed not called

    Hello

    I have a problem that a screen is not be changed because it's "onExposed" method is not called when I expect to be.

    Here's the scenario:

    1 screen 'foo' extends screen and is displayed.

    2. the user selects a menu item which, among other things, displays the 'bar' screen that extends PopupScreen.

    -'bar' screen in the event thread by using the following statement

    application.pushGlobalScreen (bar, 0, Dialog.GLOBAL_STATUS);

    3. the 'bar' screen gets popped display by a background with the following thread.

    synchronized (application.getAppEventLock ()) {}
    application.popScreen (bar);
    }

    4. after step 3 I was expecting the overloaded method 'onExposed' of the screen 'foo' to be called and refresh the data in the form. But this isn't the case.

    I tried a number of things, but I can't get the screen hidden to cool off when it is displayed.

    I run on the global phone OS4.2.1 Simulator.

    Any suggestions would be greatly appreciated.

    News Flash! The problem was in my code. onExposed has been called, but not when I thought it would be.

  • JavaFX binding throws illegal state Exception: not on the thread of Application FX

    Hi all

    I am updating a label of a task using bindings.

    However, when I 'Bind' the label text property with a property of the task, Illegal state exception string is thrown. Saying: this is not not on the thread of JavaFX.

    The Exception occurs whenever I try to set the property of the task of the Interior string.

    Please do not suggest to use the platform. RunLater(). I want to do this through links as the values I am trying to display in the label (later on) could change too frequently, and I don't want to flood the queue of the thread of the user interface with executable objects.

    Please let me know what I'm doing wrong and what I need to change to make it work properly with links. (I'm new to links and concurrency JavaFx API)

    Here is my Code.

    public class MyTask extends Task<String>{
    
        MyTask(){
           System.out.println("Task Constructor on Thread "+Thread.currentThread().getName());
    
    
        }
        private StringProperty myStringProperty = new SimpleStringProperty(){
            {
                System.out.println("Creating stringProperty on Thread "+Thread.currentThread().getName());
            }
        };
        private final void setFileString(String value) {
            System.out.println("Setting On Thread"+Thread.currentThread().getName());
            myStringProperty.set(value); }
        public final String getFileString() { return myStringProperty.get(); }
        public final StringProperty fileStringProperty() {
            System.out.println("Fetching property On Thread"+Thread.currentThread().getName());
            return myStringProperty; }
        
        @Override
        public String call() throws Exception{
            System.out.println("Task Called on thread "+Thread.currentThread().getName());
    
    
           for(int counter=0;counter<100;counter++){
               try{
               setFileString(""+counter);
               }catch(Exception e){
                   e.printStackTrace();
               }
               Thread.sleep(100);
               System.out.println("Counter "+counter);
           }
           return "COMPLETED";
        }
    }
    
    
    public class MyService extends Service<String> {
    
    
        MyTask myTask;
    
        public MyService(){
            System.out.println("Service Constructor on Thread "+Thread.currentThread().getName());
            myTask=new MyTask();
        }
    
        @Override
        public Task createTask(){
            System.out.println("Creating task on Thread "+Thread.currentThread().getName());
            return myTask;
        }
    
    }
    
    
    public class ServiceAndTaskExperiment extends Application {
        @Override
        public void start(Stage stage) throws Exception {
            Parent root = FXMLLoader.load(getClass().getResource("Sample.fxml"));
            Scene scene = new Scene(root);
            stage.setScene(scene);
            stage.show();
        }
        public static void main(String[] args) {
            launch(args);
        }
    }
    
    
    public class SampleController implements Initializable {
        @FXML
        private Label label;
    
        @FXML
        private void handleButtonAction(ActionEvent event) {
            System.out.println("You clicked me!");
            myTestService.start(); //This will throw out exceptions when the button is clicked again, it does not matter
        }
    
        MyService myTestService=new MyService();
        @Override
        public void initialize(URL url, ResourceBundle rb) {
            label.setText("Hello World!");
            //adding the below Line causes the exception
            label.textProperty().bind(myTestService.myTask.fileStringProperty()); //removing this line removes the exception, ofcourse the label wont update.
        } 
    }
    //sample.fxml
    <?xml version="1.0" encoding="UTF-8"?>
    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    
    
    <AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="serviceandtaskexperiment.SampleController">
        <children>
            <Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />
            <Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />
        </children>
    </AnchorPane>
    
    
    
    

    And it is the output with links on:

    Output: when the link is activated label.textProperty () .bind (myTestService.myTask.fileStringProperty ());

    Service on JavaFX Application Thread constructor

    Creating string on thread JavaFX Application Thread

    Task, Builder on JavaFX Application Thread

    Get the property on request ThreadJavaFX wire

    You clicked me!

    Creating a task on a thread Thread Application JavaFX

    Task called threadThread-4

    Setting on ThreadThread-4

    java.lang.IllegalStateException: not on the application thread FX; currentThread = Thread-4

    at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:237)

    at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:398)

    to javafx.scene.Parent$ 1.onProposedChange(Parent.java:245)

    at com.sun.javafx.collections.VetoableObservableList.setAll(VetoableObservableList.java:90)

    at com.sun.javafx.collections.ObservableListWrapper.setAll(ObservableListWrapper.java:314)

    at com.sun.javafx.scene.control.skin.LabeledSkinBase.updateChildren(LabeledSkinBase.java:602)

    at com.sun.javafx.scene.control.skin.LabeledSkinBase.handleControlPropertyChanged(LabeledSkinBase.java:209)

    to com.sun.javafx.scene.control.skin.SkinBase$ 3.changed(SkinBase.java:282)

    at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:107)

    to com.sun.javafx.binding.ExpressionHelper$ SingleChange.fireValueChangedEvent (ExpressionHelper.java:196)

    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)

    at javafx.beans.property.StringPropertyBase.fireValueChangedEvent(StringPropertyBase.java:121)

    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:128)

    in javafx.beans.property.StringPropertyBase.access$ 100 (StringPropertyBase.java:67)

    to javafx.beans.property.StringPropertyBase$ Listener.invalidated (StringPropertyBase.java:236)

    to com.sun.javafx.binding.ExpressionHelper$ SingleInvalidation.fireValueChangedEvent (ExpressionHelper.java:155)

    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)

    at javafx.beans.property.StringPropertyBase.fireValueChangedEvent(StringPropertyBase.java:121)

    at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:128)

    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:161)

    at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:67)

    to serviceandtaskexperiment. MyTask.setFileString (MyTask.java:24)

    to serviceandtaskexperiment. MyTask.call (MyTask.java:36)

    to serviceandtaskexperiment. MyTask.call (MyTask.java:11)

    to javafx.concurrent.Task$ TaskCallable.call (Task.java:1259)

    at java.util.concurrent.FutureTask.run(FutureTask.java:262)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:615)

    at java.lang.Thread.run(Thread.java:724)

    Output with links removed: (label will not be updated)

    Service on JavaFX Application Thread constructor

    Creating string on thread JavaFX Application Thread

    Task, Builder on JavaFX Application Thread

    You clicked me!

    Creating a task on a thread Thread Application JavaFX

    Task called threadThread-4

    Setting on ThreadThread-4

    Counter 0

    Setting on ThreadThread-4

    1 meter

    Setting on ThreadThread-4

    2 meter

    Setting on ThreadThread-4

    If myStringProperty is bound to the textProperty of etiquette, you can only change it on the Thread of the JavaFX Application. The reason is that change its value will result in a change of the label, and changes of live parts of the graphic scene cannot be performed on the Thread of the JavaFX Application.

    Task and Service classes expose a messageProperty you could use here. The Task class has a updateMessage (...) method that changes the value of the message on the Thread of the JavaFX Application property. It also merges calls in order to prevent the flooding of this thread. If you could do the following in your MyTask.call () method:

    updateMessage(""+counter);
    

    and then in your controller just do

    label.textProperty().bind(myTestService.messageProperty());
    

    If you don't want to use the messageProperty for some reason any (for example you are already using it for something else, or you want to make something similar to a property that is not a string), you must merge the updates yourself. What follows is based on the source code of the task:

    public class MyTask extends Task {
    
         // add in the following:
        private final AtomicReference fileString = new AtomicReference<>();
    
        private void updateFileString(String text) {
            if (Platform.isFxApplicationThread()) {
                setFileString(text);
            } else {
                if (fileString.getAndSet(text) == null) {
                    Platform.runLater(new Runnable() {
                        @Override
                        public void run() {
                            final String text = fileString.getAndSet(null);
                            MyTask.this.setFileString(text);
                        }
                    });
                }
            }
        }
    
       // Now just call updateFileString(...) from your call() method
    }
    
  • AddIndex() single call is threaded?

    Hey guys

    I have a question about indexing of coherence, I hope you can clarify.

    Currently, our indexing process takes up to 60 minutes to create indexes for 500 K entered on a cache.
    There is an XML cache and uses reflection Extractor to extract the XPath attribute to create indexes.

    Boot cache is a two-step process: first, we have finished priming the cache; Second, we start adding indexes.

    60 minutes is too long, so we wrote a quick code to test whether the addition of index in parallel (using nodes of treatment) would reduce overall creation time.

    But it made no difference. It is always in 60 minutes.

    Does this mean addIndex() call will block the entrance so that it's staged, that makes the other threads to wait his turn?

    I checked all the documents, could not find any answers. Advice will be a great help.

    Note:
    -Business wants certainly maintain XML cache and index attributes based on XPATH.

    Thank you
    Khaldi

    Oh dear... If I had £1 for everywhere where I worked there where the company was certain that they had need to store the XML within a coherence cache I'd be a rich man (well, I would have a few pounds anyway). If you really need to store large amounts of XML and querying so as much as it pains me to say it is perhaps best products that the consistency to do it in.

    Running regarding several addIndex calls in parallel, as far I'm aware consistency only runs a call on one single addIndex hiding both.

    As for your problem, 60 minutes to add the index seems like a very long time. There are various reasons why this might be. How many clues you add? What size (in bytes) are the XML values that put you in the cache. How many storage nodes are in your cluster and what is the chunk size for them. If you use extractors of reflection then needed to deserialize the entire cache for each index storage nodes you add which could cause a lot of GC.

    JK

  • Display background running on the UI threads

    Hello

    Sometimes I get the situation, that an action of the user needs time to perform. So I put this work to a task or Service.

    I want to inform the user, that its action is still ongoing. Just a simple ProgressIndicator.

    I know how to do it with a single task, but theoretically, there could be multiple tasks running, even some who were not triggered by the action of the user.

    So I want a similar thing as in Eclipse or IntelliJ: a 'background' control, which displays all running threads.

    Y at - it an easy way to do it, I mean from the perspective of Service/task/Thread, not the user interface.

    Do I need to record each scheduled thread that I start control, for example, when it is scheduled?

    Should I derive from task to make this logic?

    Is there a way to "look" all discussions?

    What is the best approach?

    My idea was to add each task to the control. And control of listening to the property running. When it is finished, it is removed from the list of observable controls.

    But what of the simple Threads, which can be started somewhere outside the Thread of the JavaFX Application?

    For the more general part of the question (of Threads that can be lit outside the Thread of the JavaFX Application):

    I've never worked with this part of the Thread API, but the Threads belong to the ThreadGroups. You can retrieve the group that belongs to a Thread with Thread.getThreadGroup (). ThreadGroups are hierarchical; each ThreadGroup except the top-level ThreadGroup has a ThreadGroup parent (ThreadGroup.getParent ()) and you can get references to all children with ThreadGroup.enumerate (ThreadGroup []) ThreadGroups. Wire also has a getState() method that returns an instance of the enum Thread.State.

    Of course, none of this is observable in the sense of JavaFX properties, so you should probably periodically this survey instead of being able to listen passively to state changes.

    For the easier part, a few ideas:

    I did something that is conceptually similar to what you're trying to do. I have a client-server application in which the data model communicates with a remote EJB service layer. All calls to the service layer are threaded. The model exposes an IntegerProperty represents the number of tasks that are pending (i.e. waiting to be executed or running). Most of the calls to the model to result in the creation of a task which the call() method runs on the remote service. The relevant parts of the model look like this:

    public class Model {
      private final ExecutorService executorService ;
      private final IntegerProperty pendingTasks ;
      // ...
      public Model() throws NamingException {
        // ...
      executorService = Executors.newSingleThreadExecutor() ;
      pendingTasks = new SimpleIntegerProperty(0);
    }
    
      private void addListenersToTask(final Task task) {
      task.stateProperty().addListener(new ChangeListener() {
      @Override
      public void changed(ObservableValue observable,
      State oldValue, State newValue) {
      State state = observable.getValue();
      if (state == State.SUCCEEDED) {
      decrementPendingTasks();
      task.stateProperty().removeListener(this);
      } else if (state == State.FAILED) {
    task.stateProperty().removeListener(this);
      try {
      context.close();
      } catch (NamingException exc) {
      System.out.println("Warning: could not close context");
      }
      status.set(ConnectionStatus.DISCONNECTED);
      }
      }
      });
      }
    
      private void scheduleTask(Task task) {
      addListenersToTask(task);
      incrementPendingTasks();
      executorService.submit(task);
      }
    
      private void decrementPendingTasks() {
      if (! Platform.isFxApplicationThread()) {
      throw new IllegalStateException("Must be on FX Application thread");
      }
      if (pendingTasks.get()<=0) {
      throw new IllegalStateException("Trying to decrement non-positive number of pending tasks");
      }
      pendingTasks.set(pendingTasks.get()-1);
      }
    
      private void incrementPendingTasks() {
      if (! Platform.isFxApplicationThread()) {
      throw new IllegalStateException("Must be on FX Application thread");
      }
      pendingTasks.set(pendingTasks.get()+1);
      }
    
      public int getNumberOfPendingTasks() {
      return pendingTasks.get() ;
      }
    
      public ReadOnlyIntegerProperty numberOfPendingTasksProperty() {
      return pendingTasks ;
      }
    
      // ...
    }
    

    All jobs are scheduled to run by calling the scheduleTask (...) method above, which increments the property pendingTasks, and adds a listener to decrement it when it is finished. The only way for tasks to fail in this application is whether the remote service goes down (the other exceptions are thrown by tasks), this is why I close the naming failure context, and there is currently no functionality to cancel tasks. The code will have to change to meet the cancellation or failure, if this isn't the case.

    Of course, you could do more than a simple counter here using similar techniques. For example, you could keep a ObservableList for the tasks, add a task to the list when it is submitted and remove it when it is finished. Then, you could provide this list to control which can display the status of each task.

    Another option could be to write a wrapper for ExecutorService that has implemented this feature, rather than to implement in your model. (I can elaborate a little if it is not clear, but I have not actually tried it myself). If you somehow exposed this wrapper ExecutorService to the entire application and used for all your threading (which he is called to leave FXApplication thread or not) then you could at least be aware of these threads and should be able to monitor their relatively easily. All threads that were not executed via your wrapper ExecutorService would still be difficult to control.

    Not sure how much help that is.

  • the disk you inserted is not called by this computer

    Whenever I start the computer, it starts flashing on the screen "the disk you inserted was not called by this computer.

    When I booted into it, it shows me the Macintosh HD. I activated the 'first aid' keys and able to diagnose and the result was ok.

    Is - it my Fusion drive is causing the problem?

    Mr. Chua

    Mr. Chua,

    Please post a report of EtreCheck of your system. We then look for obvious problems. Please click on the link, download the application and run the report. Once you have the report, please copy and paste into your response to this post.

  • How do I know if a VI is already running before calling Start Asynchronous Call?

    The new node to start the asynchronous call is great for the spawning of several instances of the reentrant vis.  However, I fell a little bit using for screws not reentrant the old practice of using the method "Run a VI" would allow us to check the Execution.State of the VI before calling the method to execute.  This way if the State was running or running at a higher level, we could spend the invoke node and just use a property node to open the front panel.  With the starting node the asynchronous call, it seems that we must use a strictly typed static VI reference, and when we open the reference VI, VI gets booked and his Execution.State = running.  So, how whether it is not only reserved by wire, but actually running before calling Start redundant?

    Moreover, the redundant beginning has an interesting behavior.  Actually, it will cause the targeted VI must be performed again after it stops.  Even if you tap the Abort button on the target VI, it run immediately still and always the same number of times as the starting node the asynchronous call is executed.  There is nothing wrong with that, and I guess the simple answer is to simply go back to the old method of "run a VI.  It's just that ability over these inputs directly to the connector pane is so nice.  Maybe missing me something obvious.  Oh, I am referring to the call and forget mode (0x80).

    Thank you

    Dan

    Maybe missing me something obvious.  Oh, I am referring to the call and forget mode (0x80).

    Yes you have forgotten that he forgets the Run method always seems to be a better choice for this mode

  • You can not call a method on a null value expression.

    Hello

    We are working on the tool of basic hygiene WMI for windows 2008 server of health check of the scent system but in error during the run automation tool

    "Cannot call a method on a null expression."

    LE000561ERROR: You can not call a method on a null value expression.
    ERROR: The value of the argument cannot be an empty string.

    Please suggest the same

    Hi Diakité Srivastava,

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet forum.

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • C++ class destructor not called on request nearby

    I started playing with waterfall and C++ development but im having a problem where I can link my class to the qml and use breast but firm request the something on my class hangs the request and its icon in the emulator will slightly transparent and can no longer be clicked.

    It's the call to add it to the qml

    File: Applicationui.cpp
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app): QObject(app){ // create scene document from main.qml asset // set parent to created document to ensure it exists for the whole application lifetime QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
    //My classGpsCommunicator* gps = new GpsCommunicator();
    
    //Add the Classqml->setContextProperty("_gps",gps);
    
    // create root object for the UI AbstractPane *root = qml->createRootObject();
    
    // set created root object as a scene app->setScene(root);
    }
     
    

    Here is the class.hpp

    
    class GpsCommunicator : public QObject {
    Q_OBJECT
    
    Q_PROPERTY(double latitude READ latitude) Q_PROPERTY(double longitude READ longitude) Q_PROPERTY(double accuracy READ accuracy) Q_PROPERTY(double altitude READ altitude) Q_PROPERTY(double heading READ heading) Q_PROPERTY(double satellites READ satellites) Q_PROPERTY(double speed READ speed)
    Q_PROPERTY(bool isRegistered READ isRegistered) Q_PROPERTY(bool isAltitudeValid READ isAltitudeValid) Q_PROPERTY(bool isAccuracyValid READ isAccuracyValid) Q_PROPERTY(bool isHeadingValid READ isHeadingValid) Q_PROPERTY(bool isSpeedValid READ isSpeedValid)
    public: GpsCommunicator(QObject *parent = 0); virtual ~GpsCommunicator();
    //Latitude Property double latitude();
    //Latitude Property double longitude();
    //Accuracy Property double accuracy(); bool isAccuracyValid();
    //Altitude Property double altitude(); bool isAltitudeValid();
    //Heading Property double heading(); bool isHeadingValid();
    //Speed Property double speed(); bool isSpeedValid();
    //Number of Satellite Property double satellites();
    //Registered successfully to geolocation events bool isRegistered();
    Q_INVOKABLE void StartPollTimer(int i = 0); Q_INVOKABLE void StopPollTimer();
    signals:
    
    private:
    //Bool to track if this class is registered to receive geo-location events bool m_isRegistered;
    double m_latitude; double m_longitude; double m_accuracy; bool m_accuracy_valid; double m_altitude; bool m_altitude_valid; double m_altitude_accuracy; bool m_altitude_accuracy_valid; double m_heading; bool m_heading_valid; double m_speed; bool m_speed_valid; double m_num_satellites; bool m_num_satellites_valid;
    void InitializeGps(); void InitializeCommunicator();
    //Poll timer QTimer *pollTimer;
    
    public slots:
    void CheckForGPSEvent();
    };
     
    

    Here is the .cpp for her

    
    GpsCommunicator::GpsCommunicator(QObject *parent): QObject(parent) { //Start up sequence this->InitializeCommunicator(); this->InitializeGps();}
    void GpsCommunicator::InitializeCommunicator() { this->m_isRegistered = false;}
    GpsCommunicator::~GpsCommunicator() { // TODO Auto-generated destructor stub this->StopPollTimer(); delete this->pollTimer; geolocation_stop_events(0); bps_shutdown();}
    double GpsCommunicator::latitude() { return this->m_latitude;}
    double GpsCommunicator::speed() { return this->m_speed;}
    double GpsCommunicator::altitude() { return this->m_altitude;}
    double GpsCommunicator::longitude() { return this->m_longitude;}
    double GpsCommunicator::accuracy() { return this->m_accuracy;}
    double GpsCommunicator::heading() { return this->m_heading;}
    double GpsCommunicator::satellites() { return this->m_num_satellites;}
    bool GpsCommunicator::isRegistered(){ return this->m_isRegistered;}
    bool GpsCommunicator::isSpeedValid() { return this->m_speed_valid;}
    bool GpsCommunicator::isAccuracyValid() { return this->m_accuracy_valid;}
    bool GpsCommunicator::isAltitudeValid() { return this->m_altitude_valid;}
    bool GpsCommunicator::isHeadingValid() { return this->m_heading_valid;}
    void GpsCommunicator::StartPollTimer(int i) { this->pollTimer->start(i);}
    void GpsCommunicator::StopPollTimer() { this->pollTimer->stop();}
    void GpsCommunicator::InitializeGps() {
    if( bps_initialize() != BPS_FAILURE) { if ( geolocation_request_events( 0 ) != BPS_SUCCESS ) { //Report that the initialize failed this->m_isRegistered = false; //emit this->registeredChanged(this->m_isRegistered); } else { geolocation_set_period(1);
    //Update that the communicator is now registered and emit the signal this->m_isRegistered = true; //emit this->registeredChanged(this->m_isRegistered);
    //Create the timer instance this->pollTimer = new QTimer();
    //Connect it to the polling function this->connect(this->pollTimer, SIGNAL(timeout()), this, SLOT(CheckForGPSEvent())); this->StartPollTimer(100); } }}
    void GpsCommunicator::CheckForGPSEvent() {
    bps_event_t *event = NULL; bps_get_event(&event, 100); // -1 means that the function waits // for an event before returning if (event) {
    if (bps_event_get_domain(event) == geolocation_get_domain()) {
    if (event == NULL || bps_event_get_code(event) != GEOLOCATION_INFO) { return; }
    // TODO: change this so the emit is only called if the information is new
    this->m_latitude = geolocation_event_get_latitude(event); //emit this->latitudeChanged(this->m_latitude);
    this->m_longitude = geolocation_event_get_longitude(event); //emit this->longitudeChanged(this->m_longitude);
    this->m_accuracy = geolocation_event_get_accuracy(event); //emit this->accuracyChanged(this->m_accuracy);
    this->m_altitude = geolocation_event_get_altitude(event); //emit this->altitudeChanged(this->m_altitude);
    this->m_altitude_valid = geolocation_event_is_altitude_valid(event);
    this->m_altitude_accuracy = geolocation_event_get_altitude_accuracy(event);
    this->m_altitude_accuracy_valid = geolocation_event_is_altitude_accuracy_valid(event);
    this->m_heading = geolocation_event_get_heading(event); //emit this->headingChanged(this->m_heading);
    this->m_heading_valid = geolocation_event_is_heading_valid(event);
    this->m_speed = geolocation_event_get_speed(event); //emit this->speedChanged(this->m_speed);
    this->m_speed_valid = geolocation_event_is_speed_valid(event);
    this->m_num_satellites = geolocation_event_get_num_satellites_used(event); //emit this->satellitesChanged(this->m_num_satellites);
    this->m_num_satellites_valid = geolocation_event_is_num_satellites_valid(event); } }
    return;}
    

    I was checking to see if the deconstructor was called, but it doesn't seem to be. So I think it might be the QTimer not cleaned but I don't know how I get it to call on family members since I thought that once I signed with qml my QObject class would be deconstructed with other resources in a certain order.

    Thanks in advance for any help

    Do not call bps_get_event from an application of stunts that you might fly the main event loop events.  Rather implement AbstractBpsEventHandler to the BPS events delivered on the thread of your event.

  • onPageLoad activity was not called in jsff child page

    Hi all

    I've implemented the onPageLoad feature in my grain of support by the RegionController extension, but the method is not called in jsff child page.

    I'm having jsff parent and child jsff. In my parent jsff, I invoke the jsff as pop-up child. I want to do something different on the loading of the page parent and child.

    for example... I have traced superclass jsff pagedefinition backingbean A controller and controller pagedefinition class child jsff on back bean B

    When the parent page opens action onload in the controller's class. runs but when I open the child page onload in the controller B class action does not run.

    But if I delete the parent page definition controller class mapping, then the action of onload child page in the class controller B is executed.

    Kindly help me to solve this problem.

    Thank you and best regards,

    Synthia

    And your version of jdev?

    You can try to lazy initialization of a property of beans as shown on this blog https://tompeez.wordpress.com/2014/10/18/lazy-initalizing-beans/

    If youbdefine a view range of the bean in the child workflows that bean is initialized when the child is in charge.

    Timo

  • Why my converter is not called

    I defined a custom converter registered in faces - config.Xml. I entered a value in the field, but that the converter is not called (I put traces inside). I tried like a converter and also as Converter element attribute.

    < af:inputText id = value = "#{bindings.percent1.inputValue 'it2'} ' simple ="true"contentStyle =" width: 100% ""
    Converter required = "#{pageFlowScope.myBean.action eq 'CREATE'}" = "myBigDecimalConverter" > "
    <!-< f: converter converterId = "myBigDecimalConverter" / >-->
    < / af:inputText >

    Can you explain what I am doing wrong?

    Thank you

    JDev 11.1.2.4

    Hello

    A converter is run on the client and its role to transform to "string" which is written in HTML component to an "object" you use a model in the State of post page (and vice Bader in the page rendering stage).

    Then

    1. normally, to be called, the page must be submitted to the server (which runs the converter).

    2 - the value is converted by getAsObject is stored in your model (bean property) and not reflected in the value of the HTML component (once again, this value can be an object, not a string). On the other hand, the getAsString method converts the 'object' in the string template to use in the HTML component.

    Kind regards.

  • Onyx you can not call a method on a null value expression

    Hello

    I "cracked" code powershell with Onyx.

    Here's the Script:

    Claire

    SE connect-VIServer

    1. -UpdateVirtualSwitch-

    $spec = new-Object VMware.Vim.HostVirtualSwitchSpec

    $spec.numPorts = 128

    $spec.bridge = new-Object VMware.Vim.HostVirtualSwitchBondBridge

    $spec.bridge.nicDevice = new-Object System.String [] (2)

    $spec.bridge.nicDevice [0] = "vmnic9".

    $spec.bridge.nicDevice [1] = 'vmnic2.

    $spec.bridge.beacon = new-Object VMware.Vim.HostVirtualSwitchBeaconConfig

    $spec.bridge.beacon.interval = 1

    $spec.bridge.linkDiscoveryProtocolConfig = new-Object VMware.Vim.LinkDiscoveryProtocolConfig

    $spec.bridge.linkDiscoveryProtocolConfig.protocol = "cdp".

    $spec.bridge.linkDiscoveryProtocolConfig.operation = 'listen '.

    $spec.policy = new-Object VMware.Vim.HostNetworkPolicy

    $spec.policy.security = new-Object VMware.Vim.HostNetworkSecurityPolicy

    $spec.policy.security.allowPromiscuous = $false

    $spec.policy.security.macChanges = $false

    $spec.policy.security.forgedTransmits = $false

    $spec.policy.nicTeaming = new-Object VMware.Vim.HostNicTeamingPolicy

    $spec.policy.nicTeaming.policy = "loadbalance_ip".

    $spec.policy.nicTeaming.reversePolicy = $true

    $spec.policy.nicTeaming.notifySwitches = $true

    $spec.policy.nicTeaming.rollingOrder = $false

    $spec.policy.nicTeaming.failureCriteria = new-Object VMware.Vim.HostNicFailureCriteria

    $spec.policy.nicTeaming.failureCriteria.checkSpeed = 'minimum '.

    $spec.policy.nicTeaming.failureCriteria.speed = 10

    $spec.policy.nicTeaming.failureCriteria.checkDuplex = $false

    $spec.policy.nicTeaming.failureCriteria.fullDuplex = $false

    $spec.policy.nicTeaming.failureCriteria.checkErrorPercent = $false

    $spec.policy.nicTeaming.failureCriteria.percentage = 0

    $spec.policy.nicTeaming.failureCriteria.checkBeacon = $false

    $spec.policy.nicTeaming.nicOrder = new-Object VMware.Vim.HostNicOrderPolicy

    $spec.policy.nicTeaming.nicOrder.activeNic = new-Object System.String [] (1)

    $spec.policy.nicTeaming.nicOrder.activeNic [0] = 'vmnic2.

    $spec.policy.nicTeaming.nicOrder.standbyNic = new-Object System.String [] (1)

    $spec.policy.nicTeaming.nicOrder.standbyNic [0] = "vmnic9".

    $spec.policy.offloadPolicy = new-Object VMware.Vim.HostNetOffloadCapabilities

    $spec.policy.offloadPolicy.csumOffload = $true

    $spec.policy.offloadPolicy.tcpSegmentation = $true

    $spec.policy.offloadPolicy.zeroCopyXmit = $true

    $spec.policy.shapingPolicy = new-Object VMware.Vim.HostNetworkTrafficShapingPolicy

    $spec.policy.shapingPolicy.enabled = $false

    _this $ = get-view-Id "HostNetworkSystem-networkSystem-43'.

    _this $. UpdateVirtualSwitch ("vSwitch2", $spec)

    When you run the script I get the following error:

    You can not call a method on a null expression.* to: tank line: 47:26+ $_C. UpdateVirtualSwitch & lt; & lt; & lt; & lt; ('vSwitch2', $spec) What I'm doing wrong? *

    concerning

    Jean

    It seems that the $_this variable is empty.

    You may enter the code in another environment under which you are running the script?

    The Onyx product code contains references that are hardcoded to the object, in this case "HostNetworkSystem-networkSystem-43.

    It is preferable to obtain the MoRef yourself, that way, the code becomes p [?

    Something like that might be used.

    $_this = Get-View  (Get-VMHost ).Extensiondata.ConfigManager.networkSystem
    

    Instead of

    $_this = Get-View -Id 'HostNetworkSystem-networkSystem-43'
    

    Assuming you use of course PowerCLI 4.1.

    ____________

    Blog: LucD notes

    Twitter: lucd22

Maybe you are looking for