Error in for loop

I have this small code snippet but its always giving errors. I have included the java.util.Random package in the import statement as well
        for (int i = 0; i < 100; i++)
            char c = (char) (Math.random() * 26 + ?a?);  // FIRST ERROR IS ON THIS LINE
            switch(c)
            case ?a?:
            case ?e?:
            case ?i?:
            case ?o?:
            case ?u?:
                System.out.println(?Vowel?); break;
            case ?y?:
            case ?w?:
                System.out.println(?Sometimes a vowel?); break;
            default:
                System.out.println(?Not a vowel?);
        }What exactly is the problem i am unable to figure out?

Hi, we probably share the share the same problem , any ideas please? i have try the code given in this post but with no success
goldfish

Similar Messages

  • PNA Guided Calibration: GPIB write error in for loop

    Hi,
    I have a LabVIEW program that creates a Guided Power Calibration on a PNA.
    After initializing everything properly, I have a for loop that loops through all the manual steps that the user must go through (ex: Connect Channel A of Power meter to Port 1" "Connect male Short to port 1" etc).
    The problem is, the program displays an error at the first command: sens:corr:coll:guid:acq STAN1
    I says there is an error with the GPIB Write function.
    Here are the commands I send:
    SYSTRES
    DISPlay:WINDow2TATE ON
    CALCulate2ARameterEFine:EXT 'MyMeas',S21
    DISPlay:WINDow2:TRACe1:FEED 'MyMeas'
    CALC1AREL 'CH1_S11_1'
    SENS:FREQTAR 2e9
    SENS:FREQTOP 4e9
    SENSWEOINTS 3
    SENS:CORR:COLL:GUID:CONNORT1 'APC 2.4 male'
    SENS:CORR:COLL:GUID:CONNORT2 'APC 2.4 male'
    SENS:CORR:COLL:GUID:CKITORT1 '85056D'
    SENS:CORR:COLL:GUID:CKITORT2 '85056D' 
    SENSe:CORRection:COLLect:GUIDedSENsor1 ON
    SYSTem:COMMunicateSENsor gpib, "13"   
    SENSe:CORRection:COLLect:GUIDedSENsor1OWer:LEVel -20
    sens:corr:coll:guid:init
    sens:corr:coll:guid:steps?
    //for loop from 1 to total_number_of_steps
    sens:corr:coll:guid:desc? <step#>
    sens:corr:coll:guid:acq STAN<step#>
    The program quits right at the first step, when I send "sens:corr:coll:guid:acq STAN1", although the command is executed.
    Also, the VBScript with the same commands works fine.
    Can anybody help me? I've been stuck for a while now.
    I attached the block diagram of the for loop.
    Thanks in advance,
    Nicolas
    Attachments:
    Guided cal for loop.vi ‏27 KB

    Sending SENS:corr:coll:guid:acq STAN1 \n gives me a different error: -101 "Invalid Character".
    From my different attempts at figuring this out, I thought the problem would come from LabVIEW, since the vbscript with the same commands works on the PNA.
    I also modified the for loop because I thought each iteration should be linked to the previous one with the error wire (see attached).
    I still have the same issue, only the first iteration is executed, then the program quits.
    Attachments:
    Guided cal for loop.vi ‏28 KB

  • Logic error in for loop

    I have a JSP form which list modules that student can take. Some of these modules have prerequisite and some do not.
    In order to successfully register a student, I have a number of requirements e.g. must not be already register; the registration date must not have passed etc.
    My problem is in my code logic. For example, when a student selects a module, which does not have a prerequisite, and a module, which has a prerequisite and click on the Register button, an Error.jsp page is displayed because he has not satisfied the prerequisite for the second module.
    What the program does is that it registers the first module which dose not has a prerequisite and display the Error.jsp page.
    This is confusing for the user because they expect to do the process again and do not know that the first module has been register successfully.
    Here is my code
    private int enroll()throws SQLException,IOException
          // Get the check box values
          String checkboxNames[] = request.getParameterValues( "checkbox" );
          moduleVector = (Vector) session.getAttribute( "moduleVector" );
          //Get the student bean
          studentBean = (StudentBean) session.getAttribute( "studentBean" );
          boolean isEnrolled = false;
          String studentId = studentBean.getStudentId();
          int maxModule = Integer.parseInt(studentBean.getMaxModule());
          for (int i = 0; i < checkboxNames.length; i++) {
            String moduleId = checkboxNames;
    // First, make sure that this student is not already
    // enrolled for this module, and he/she has never
    // taken and passed the module before.
    isEnrolled = srsBean.isEnrolledIn( moduleId, studentId );
    if (isEnrolled){
    session.setAttribute("pre_enrolled", moduleId);
    return PREVIOUSLY_ENROLLED;
    // Now we make sure that the registration date has not
    // already passed
    Calendar rightNow = Calendar.getInstance();
    int rightNowMonth = rightNow.MONTH;
    int rightNowDay = rightNow.DAY_OF_MONTH;
    if ( rightNowMonth > Constants.REGISTER_DATE_MONTH ) {
    return PASSED_REGISTER_DATE;
    }else if( rightNowMonth == Constants.REGISTER_DATE_MONTH ) {
    if ( rightNowDay > Constants.REGISTER_DATE_DAY ) {
    return PASSED_REGISTER_DATE;
    int noModule = srsBean.noModuleEnrolledIn( studentId );
    // Now we make sure we don't erroll student on more
    // modules that the are allowed to do.
    if (!(noModule < maxModule)){
    // convert maxModule into string so we can use setAttribute
    String max = String.valueOf(maxModule);
    session.setAttribute("exceed_max_no", max);
    return EXCEEDED_MAX_NO_MODULE;
    // if there are any prerequisites for this module, check
    // to ensure that the student has completed them.
    if ( srsBean.hasPrerequisites(moduleId)) {
    Enumeration e = srsBean.getPrerequisites(moduleId);
    while ( e.hasMoreElements() ) {
    String pre = (String) e.nextElement();
    // See if the Student's Transcript reflects
    // successful completion of the prerequisite.
    if (!srsBean.verifyCompletion(moduleId, studentId)){
    session.setAttribute("prereq_not_sat", moduleId);
    return PREREQ_NOT_SATISFIED;
    // if we made it to here in the code, we're ready to
    // officially enroll the student.
    srsBean.enroll( studentId, moduleId );
    return SUCCESSFULLY_ENROLLED;
    How can i fix this problem ?

    1. well first check whether all modlues can be registered..
    2. you need to remove that in your for loop
    srsBean.enroll( studentId, moduleId );
    3. if all conditions are satisfied.
    for (int i = 0; i < checkboxNames.length; i++) {       
      String moduleId = checkboxNames<i>;
      srsBean.enroll( studentId, moduleId );
    }4. put the above code before
    return SUCCESSFULLY_ENROLLED;

  • Statement error in for loop noobq

    Hi
    Could anyoe tell me why this wont work? Its supposed to count upp to tal in the first one and then count down from tal in the second and its the second one that dont work. I get a statement error for the text i put in between stars (supposed to be bold but i dont know..)
    thanks
    class r?knaa {
        public static void main(String[] args) {
            new r?knaa().run();
        void run() {
         int tal = Keyboard.nextInt ("Ange ett tal ? s? ska vi r?kna...(^_^): ");
         for (int upp = 1; upp <= tal; upp = upp + 1) {
             System.out.print ( upp+ " " );
         System.out.println (" ");
         System.out.println (" ");
         for (*tal*; tal > 0; tal = tal -1 ){
             System.out.print ( tal+ " " );
    }Edited by: gibitlib on Feb 19, 2010 3:02 PM

    jverd wrote:
    sharkura wrote:
    I assumed that it would decrement after the block of statements associated with the while loop, as is true with the for loop.Not sure what you mean by "as is true with the for loop", but I'm catching a hint of a very common misconception about the post-inc/dec operators.
    A LOT of people think that post-inc/dec means "last step in the statement" or "after everything else has been done" or something like that. That kind of thiiking is just black magic hocus pocus and serves no purposeI don't think I thiik like that, Jeff. I've never used a post-inc operator in a while loop. Certainly, if I felt a need to do so, I would test it, and try to understand why it works the way it does. Empirically, I know that given the following for loop:
    for ( int i = 0; i < limit; i++ )
      ... some statements
    }the incrementation of i occurs after the statements in the block execute. It may be specific to the for loop that the third statement in the for loop executes after the block of statements, in which case
    for ( int i = 0; i < limit; ++i )
      ... some statements
    }would work the same, and you can bet I will test that.
    I did make an assumption last night, and did not test it. That is not typical of me. I do resent somewhat the accusation of black magic hocus pocus. My last statement in that post was:
    sharkura wrote:
    I'll have to play with this some.Implicit in that remark was my intent to read more about pre/post decrementation and experiment until I more fully understood it. You have pointed out my lack of complete understanding, and, odd as it may seem, I appreciate that. I do log into these forums, partly, to improve my understanding of java.
    {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Handle Error in for Loop and finish the iteration

    I am using a for Loop now i encounter an error.
    i want to handle this error but after that carry on with iteration of the loop.
    Any Parallel to "Continue" in JAVA or any other solution for this...
    Please Suggest.

    You can use pl/sql block with exception inside the loop
    Re: Continue beyond expcetion in proc...
    Message was edited by:
    jeneesh

  • WLST script is throwing errors under for loop

    I'm new to wlst and getting the below errros while running the script. the name variable within cd command does not replaced with right value and abort the error. I would appropriate if some can point me to right direction.
    cat serverName2.py
    connect('test','test123','t3://test-app-dev-a:12619')
    domainRuntime()
    svrs = adminHome.getMBeansByType('Server')
    for s in svrs:
    name = s.getName()
    cd('/ServerRuntimes/'+'name')
    ls()
    disconnect()
    java weblogic.WLST serverName2.py
    getting the below errors
    Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
    For more help, use help(domainRuntime)
    No stack trace available.
    Problem invoking WLST - Traceback (innermost last):
    File "<iostream>", line 170, in cd
    WLSTException: 'Error cding to the MBean'

    You should remove quotes for name.
    cat serverName2.py
    connect('test','test123','t3://test-app-dev-a:12619')
    domainRuntime()
    svrs = adminHome.getMBeansByType('Server')
    for s in svrs:
    name = s.getName()
    cd('/ServerRuntimes/'+ name )
    ls()
    disconnect()
    Thanks,
    Krishna.

  • Syntax error in For Loop statement

    Hello
    Normally my FOR staements have not been a problem as only access one table. I the example below I am accessing three table and therefore I get a Syntax error.
    I only wish to select the "Product" recored but need the other table to enable the select the right results.
    FOR product_rec IN (SELECT * from PRODUCT, PRODUCT_GROUP,PROD_PROD_GROUP
    where PRODUCT_GROUP.PRODUCT_GROUP_KEY = PROD_PROD_GROUP.PRODUCT_GROUP_KEY
    and PROD_PROD_GROUP.PRODUCT_KEY = PRODUCT.PRODUCT_KEY
    and product.supplier_key = company_no
    and PROD_PROD_GROUP.MULTI_WEB_DIS = 1
    order by PROD_PROD_GROUP.MULTI_WEB_SEQ)
    Can anyone let the correct syntx for this statement.
    Thanks
    Pete

    Like Dom said:
    FOR product_rec IN (SELECT PRODUCT.* from PRODUCT, PRODUCT_GROUP,PROD_PROD_GROUP
    where PRODUCT_GROUP.PRODUCT_GROUP_KEY = PROD_PROD_GROUP.PRODUCT_GROUP_KEY
    and PROD_PROD_GROUP.PRODUCT_KEY = PRODUCT.PRODUCT_KEY
    and product.supplier_key = company_no
    and PROD_PROD_GROUP.MULTI_WEB_DIS = 1
    order by PROD_PROD_GROUP.MULTI_WEB_SEQ) Or what he meant by "nice to have", use aliases:
    select p.*
    from
      product p,
      product_group pg,
      prod_prod_group ppg
    where
      pg.product_group_key = ppg.product_group_key
      and ppg.product_key = p.product_key
      and p.supplier_key = company_no
      and ppg.multi_web_dis = 1
    order by
      ppg.multi_web_seqAlso, note that company_no is not aliased in the above query. If this is a column, it should be aliased as well (either with the full table name or the alias if you switch to using them). If it is a PL/SQL variable, it is fine as is.
    Edited by: cmartin2 on Feb 2, 2011 1:56 PM

  • For loop issue and error exception

    I am finishing up a program and having a few issues....I can send my instructions so it may seem easier to what I want...the first issue deals with the for loop for the 2nd for loop in the actionperformed when i click on go it does not change any of the boxes to yellow
    Also when I check for errors it does not check with the code I have...I know it says on the instructions to use try\catch but I am just going to use if statements because I am not very familar with the try\catch and will accept some points takin off...any help with this by tonight id really appreciate it as long as noone is too busy...Thanks
    instructions:
    This will incorporate arrays, for loops, and Frames all in one.
    Create a panel containing an array of 16 TextArea components that change color to correspond with the start, stop, and step values entered by the user. Perform the following tasks to create the Checkerboard Array application shown below. When the user enters the start, stop, and step fields and then clicks the Go button, the results are also shown below.
    1.     Call your application Checkerboard.java
    2.     You will need the following variables� declare them as private:
    a.     16 component TextArea array
    b.     a Panel to hold the array
    c.     3 TextField components with length of 10
    d.     3 int variables to receive the start, stop, and step values
    e.     3 Labels to display the words Start, Stop, and Step
    f.     a Go button
    g.     a Clear button
    h.     a Panel to hold the 3 TextFields, 3 Labels, and the 2 Buttons
    3.     Create a constructor method to:
    a.     construct each of the components declared above and initializes the start, stop, and step variables to zero (when constructing the TextArea components, use the following parameters: null, 3, 5, 3)
    b.     set the Frame layout to BorderLayout
    c.     write a for loop to loop the array and set each of the 16 TextArea components in that array so they cannot be edited. In the same loop, set each of the TextArea components text to be 1 more than the index number. Also in this same loop, set the background of each of the TextArea components to white.
    d.     set the Panel for the TextArea components to GridLayout with 4 rows, 4 columns, and both gaps set to 10
    e.     set the Panel for the TextFields, Labels, and button to GridLayout with 3 rows, 3 columns, and both gaps set to 5
    f.     add the components to their respective Panels
    g.     make the buttons clickable
    h.     place the Panels in the Frame� put one in the NORTH and one in the CENTER
    i.     Enter the addWindowListener() method described in the chapter� this is the method that overrides the click of the X so it terminates the application
    4.     In your actionPerformed() method:
    a.     convert the data in your TextFields to int and store them in the variables declared above
    b.     write a loop that goes through the array setting every background color to blue
    c.     write another loop that�s based on the user inputs. Each time the loop is executed, change the background color to yellow (so� start your loop at the user�s specified starting condition. You�ll stop at the user�s specified stopping value. You�ll change the fields to yellow every time you increment your loop based on the step value. REMEMBER: Your displayed values are 1 off from your index numbers!!)
    5.     Write a main() method that creates an instance of the Checkerboard Frame.
    a.     set the bounds for the frame to 50, 100, 300, 400
    b.     set the title bar caption to Checkerboard Array
    c.     use the setVisible() method to display the application Frame during execution
    6.     After you get all of this complete, include error handling to make sure:
    a.     the values entered in the TextFields are valid integers
    b.     the start value is greater than or equal to 1 and less than or equal to 16
    c.     the stop value is greater than or equal to 1 and less than or equal to 16
    d.     the step value is greater than or equal to 1 and less than or equal to 16
    e.     the start condition is less than the stop condition
    f.     when an error occurs, give an error message in a dialog box that is specific to their error, remove the text from the invalid field, and put the cursor in that field so the user has a chance to re-enter� this can be accomplished by using multiple try/catch statements
    g.     only change the colors if the numbers are valid
    7.     Create a clear button as seen in the example below. This button should:
    a.     clear out all 3 TextFields
    b.     change the background color of all TextArea array elements to white
    c.     put the cursor in the start field
    8.     Document!!
    my code is:
    //packages to import
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class Checkerboard extends Frame implements ActionListener
         private Panel topPanel;
         private TextArea topDisplay[];
         private Panel bottomPanel;
         private TextField startField = new TextField(10);
         private TextField stopField = new TextField(10);
         private TextField stepField = new TextField(10);
         private Label startLabel = new Label ("Start");
         private Label stopLabel = new Label ("Stop");
         private Label stepLabel = new Label ("Step");
         private Button goButton;
         private Button clearButton;
         private boolean clearText;
         private boolean first;
         private int start;
         private int stop;
         private int step;
         //constructor methods
         public Checkerboard()
              //construct components and initialize beginning values
              topPanel = new Panel();
              topDisplay = new TextArea[16];
              goButton = new Button("Go");
              clearButton = new Button("Clear");
              first = true;
              bottomPanel = new Panel();
              int start = 0;
              int stop = 0;
              int step = 0;
              bottomPanel.add(startField);
              bottomPanel.add(stopField);
              bottomPanel.add(stepField);
              bottomPanel.add(startLabel);
              bottomPanel.add(stopLabel);
              bottomPanel.add(stepLabel);
              bottomPanel.add(goButton);
              goButton.addActionListener(this);
              bottomPanel.add(clearButton);
              clearButton.addActionListener(this);
              clearText = true;
              //set layouts for the Frame and Panels
              setLayout(new BorderLayout());
              topPanel.setLayout(new GridLayout(4, 4, 10, 10));
              bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));
              //construct the Display
              for(int i = 0; i <= 15; i++)
                        topDisplay[i] = new TextArea(null, 3, 5, 3);
                        topDisplay.setText(String.valueOf(i+1));
                        topDisplay[i].setEditable(false);
                        topPanel.add(topDisplay[i]);
              //add components to frame
              add(topPanel, BorderLayout.NORTH);
              add(bottomPanel, BorderLayout.CENTER);
              //allow the x to close the application
              addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                                  System.exit(0);
                   } //end window adapter
         public static void main(String args[])
              Checkerboard f = new Checkerboard();
              f.setTitle("Checkerboard Array");
              f.setBounds(50, 100, 300, 400);
              f.setLocationRelativeTo(null);
              f.setVisible(true);
         } //end main
         public void actionPerformed(ActionEvent e)
              //test go
              String arg = e.getActionCommand();
              //go button was clicked
              if(arg.equals("Go"))
                   //convert data in TextField to int
                   int start = Integer.parseInt(startField.getText());
                   int stop = Integer.parseInt(stopField.getText());
                   int step = Integer.parseInt(stepField.getText());
                   if((start <= 1) && (start > 16))
                        JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        startField.setText(" ");
                        startField.requestFocus();
                   if ((stop < 1) && (stop > 16))
                        JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        stopField.setText(" ");
                        stopField.requestFocus();
                   if ((step < 1) && (step > 16))
                        JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                        stepField.setText(" ");
                        stepField.requestFocus();
                   if (start < stop)
                        JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
                        startField.setText(" ");
                        stopField.setText(" ");
                        stepField.setText(" ");
                        startField.requestFocus();
                   for(int i = 0; i <=16; i++)
                   topDisplay[i].setBackground(Color.blue);
                   for(int i = start; i <= stop; step++)
                   topDisplay[i].setBackground(Color.yellow);
              } //end the if go
              //clear button was clicked
              if(arg.equals("Clear"))
                   clearText = true;
                   startField.setText("");
                   stopField.setText("");
                   stepField.setText("");
                   first = true;
                   setBackground(Color.white);
                   startField.requestFocus();
              } //end the if clear
         }//end action listener
    }//end class

    got the yellow boxes to come up but just one box.....so is there something wrong with my yellow set background because I am not seeing any more errors
    //packages to import
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class Checkerboard extends Frame implements ActionListener
         private Panel topPanel;
         private TextArea topDisplay[];
         private Panel bottomPanel;
         private TextField startField = new TextField(10);
         private TextField stopField = new TextField(10);
         private TextField stepField = new TextField(10);
         private Label startLabel = new Label ("Start");
         private Label stopLabel = new Label ("Stop");
         private Label stepLabel = new Label ("Step");
         private Button goButton;
         private Button clearButton;
         private boolean clearText;
         private boolean first;
         private int start;
         private int stop;
         private int step;
         //constructor methods
         public Checkerboard()
              //construct components and initialize beginning values
              topPanel = new Panel();
              topDisplay = new TextArea[16];
              goButton = new Button("Go");
              clearButton = new Button("Clear");
              first = true;
              bottomPanel = new Panel();
              int start = 0;
              int stop = 0;
              int step = 0;
              bottomPanel.add(startField);
              bottomPanel.add(stopField);
              bottomPanel.add(stepField);
              bottomPanel.add(startLabel);
              bottomPanel.add(stopLabel);
              bottomPanel.add(stepLabel);
              bottomPanel.add(goButton);
              goButton.addActionListener(this);
              bottomPanel.add(clearButton);
              clearButton.addActionListener(this);
              clearText = true;
              //set layouts for the Frame and Panels
              setLayout(new BorderLayout());
              topPanel.setLayout(new GridLayout(4, 4, 10, 10));
              bottomPanel.setLayout(new GridLayout(3, 3, 5, 5));
              //construct the Display
              for(int i = 0; i <= 15; i++)
                        topDisplay[i] = new TextArea(null, 3, 5, 3);
                        topDisplay.setText(String.valueOf(i+1));
                        topDisplay[i].setEditable(false);
                        topPanel.add(topDisplay[i]);
              //add components to frame
              add(topPanel, BorderLayout.NORTH);
              add(bottomPanel, BorderLayout.CENTER);
              //allow the x to close the application
              addWindowListener(new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                                  System.exit(0);
                   } //end window adapter
              public static void main(String args[])
                        Checkerboard f = new Checkerboard();
                        f.setTitle("Checkerboard Array");
                        f.setBounds(50, 100, 300, 400);
                        f.setLocationRelativeTo(null);
                        f.setVisible(true);
                   } //end main
                   public void actionPerformed(ActionEvent e)
                        boolean done = false;
                        //test go
                        String arg = e.getActionCommand();
                        //go button was clicked
                        if(arg.equals("Go"))
                   //convert data in TextField to int
                   int start = Integer.parseInt(startField.getText());
                   int stop = Integer.parseInt(stopField.getText());
                   int step = Integer.parseInt(stepField.getText());
                   while(!done)
                        try
                             if((start <= 1) && (start > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter start between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             startField.setText(" ");
                             startField.requestFocus();
                        } //end catch
                        try
                             if ((stop < 1) && (stop > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter stop between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             stopField.setText(" ");
                             stopField.requestFocus();
                        } //end catch
                        try
                             if ((step < 1) && (step > 16)) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "You must enter step between 1 and 16", "Error", JOptionPane.ERROR_MESSAGE);
                             stepField.setText(" ");
                             stepField.requestFocus();
                        } //end catch
                        try
                             if (start > stop) throw new NumberFormatException();
                             else done = true;
                        } //end try
                        catch (NumberFormatException f)
                             JOptionPane.showMessageDialog(null, "Stop cannot be larger than start", "Error", JOptionPane.ERROR_MESSAGE);
                             startField.setText(" ");
                             stopField.setText(" ");
                             stepField.setText(" ");
                             startField.requestFocus();
                        } //end catch
              } //end while
                        for(int i = 0; i <=15; i++)
                        topDisplay[i].setBackground(Color.blue);
                        for(int i = start; i <= stop; step++)
                        topDisplay[i].setBackground(Color.yellow);
                   } //end the if go
                   //clear button was clicked
                   if(arg.equals("Clear"))
                        clearText = true;
                        startField.setText("");
                        stopField.setText("");
                        stepField.setText("");
                        first = true;
                        setBackground(Color.white);
                        startField.requestFocus();
                   } //end the if clear
         }//end action listener
    }//end class

  • Calling a CAF program via web service generates QName cannot be null error, but only for 1/5 of the same call in a parallel for loop.

    I'm calling 5 identical web service calls using a parallel for loop in BPM. Obviously the data in each slightly differs. Why would this call suspend the process and give the following errors:
    handleCommunicationError( ErrorContextData, Throwable, TransitionTicket ): A technical error occurred.
    Interface namespace = myNamespace
    Interface name = myService
    Operation name = myOperation
    Connectivity type = WS
    Application name = myAppName
    Reference name = 8bd95deb-8cf1-453d-94e5-0576bb385149
    Message Id = null
    WS style = DOC
    Start time of WS call = 2014-02-26 17:51:23.297
    Return time of WS call = 2014-02-26 17:51:23.412
    Principal name = SAP_BPM_Service
    Root error message = local part cannot be "null" when creating a QName
    Error message = Could not invoke service reference name 8bd95deb-8cf1-453d-94e5-0576bb385149, component name myComp application name myappname
    com.sap.engine.interfaces.sca.exception.SCADASException: Could not invoke service reference name 8bd95deb-8cf1-453d-94e5-0576bb385149, component name
    myCompname
    at com.sap.engine.services.sca.das.SCADASImpl.invokeReference(SCADASImpl.java:341)
    at com.sap.glx.adapter.app.ucon.SCADASWrapperImpl.invoke(SCADASWrapperImpl.java:101)
    at com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallObject.invokeWebServiceOperation(UnifiedWebServiceCallObject.java:101)
    at com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallClass.invoke(UnifiedWebServiceCallClass.java:178)
    at com.sap.glx.core.dock.impl.DockObjectImpl.invokeMethod(DockObjectImpl.java:657)
    at com.sap.glx.core.kernel.trigger.config.Script$MethodInvocation.execute(Script.java:248)
    at com.sap.glx.core.kernel.trigger.config.Script.execute(Script.java:798)
    at com.sap.glx.core.kernel.execution.transition.ScriptTransition.execute(ScriptTransition.java:78)
    at com.sap.glx.core.kernel.execution.transition.Transition.commence(Transition.java:196)
    at com.sap.glx.core.kernel.execution.LeaderWorkerPool$Follower.run(LeaderWorkerPool.java:163)
    at com.sap.glx.core.resource.impl.common.WorkWrapper.run(WorkWrapper.java:58)
    at com.sap.glx.core.resource.impl.j2ee.J2EEResourceImpl$Sessionizer.run(J2EEResourceImpl.java:261)
    at com.sap.glx.core.resource.impl.j2ee.ServiceUserManager$ServiceUserImpersonator$1.run(ServiceUserManager.java:152)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:337)
    at com.sap.glx.core.resource.impl.j2ee.ServiceUserManager$ServiceUserImpersonator.run(ServiceUserManager.java:149)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:185)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:302)
    Caused by: java.lang.IllegalArgumentException: Could not process message for operation myOperation in web service plugin module.
    at com.sap.engine.services.sca.plugins.ws.WebServiceImplementationInstance.accept(WebServiceImplementationInstance.java:228)
    at com.sap.engine.services.sca.das.SCADASImpl.invokeReference(SCADASImpl.java:314)
    ... 19 more
    Caused by: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
    at javax.xml.namespace.QName.<init>(QName.java:246)
    at javax.xml.namespace.QName.<init>(QName.java:190)
    at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DInterfaceImpl.getInterfaceInvoker(DInterfaceImpl.java:126)
    at com.sap.engine.services.webservices.espbase.wsdas.impl.WSDASImpl.<init>(WSDASImpl.java:43)
    at com.sap.engine.services.webservices.espbase.wsdas.impl.WSDASFactoryImpl.createWSDAS(WSDASFactoryImpl.java:39)
    at com.sap.engine.services.sca.plugins.ws.tools.wsdas.WsdasFactoryWrapper.createWsdas(WsdasFactoryWrapper.java:30)
    at com.sap.engine.services.sca.plugins.ws.WebServiceImplementationInstance.initWsdas(WebServiceImplementationInstance.java:256)
    at com.sap.
    Surely if it was the service group unassign then reassign issue then none of the calls would have worked?

    Hi David,
    While a random error is still an error it will be difficult for support to find a problem for an error which is not reproducible. It is always a faster resolution if you can determine how to provoke the error and provide those details. If we can reproduce an error on internal systems then we can fix the problem quickly and without having to access your system.
    regards, Nick

  • Unable to put a timed structure in a parallel for loop, error -808

    If I try to place a Timed Structure in a Parallel For Loop, the TS needs a different structure name per instance to prevent collisions. However, setting the Structure Name node  to something unique per instance doesn't work, I get error -808. Have I missed something?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

    That got me thinking - something to do with the number of compiled parallel instances.
    Indeed, the compiler creates a number of parallel instances of the for loop in the compiled code (in my case 8), and uses the number requested at the Parallel Instances terminal (just under the Iterations terminal), which is set to 2. Therefore the compiler has created 8 instances of the Timed Structure, each in its own for loop instance, but they all have the same defined Structure Name. When launched, there is an immediate conflict because they can't share the same name, and error -808 is launched before the set Structure Name function can change it. Hence the error still shows when requesting only one instance, because the other seven still exist.
    I guess this means you can't have Timed Structures (or Timed Loops for that matter too) in a Parallelised For Loop?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Problem cycling through elements of an array using a for loop ~ error 200609?

    Hi,
    I'm outputting a 194-element array from a MATLAB script node into a for loop where the array is indexed then converted into a 8-bit boolean pattern which I'm trying to output using DAQ Assistant. I'm using LabVIEW 8.2 and a PCI 6133 DAQ using a counter(Ctr0InternalOutput) to time the output. The first element of the array goes through the loop perfectly however never makes it's way back through and throws error 200609: Generation cannot be started because the slescted buffer size is too small. Increase the buffer size. After probing the line before DAQ Assistant I confirmed only one element makes it through the loop and then throws this error? I've trying doing the same things with lower lowel DAQmx vi's using a DAQmx configure output buffer vi to override this buffer size problem, but still get the same result(not the error but same data flow problem)? Anybody know what's going on? I've included the vi's I've been working with. Thanks!
    Millie
    Attachments:
    Untitled 22.vi ‏228 KB
    Untitled 34.vi ‏180 KB

    Hi,
    I'm outputting a 194-element array from a MATLAB script node into a for loop where the array is indexed then converted into a 8-bit boolean pattern which I'm trying to output using DAQ Assistant. I'm using LabVIEW 8.2 and a PCI 6133 DAQ using a counter(Ctr0InternalOutput) to time the output. The first element of the array goes through the loop perfectly however never makes it's way back through and throws error 200609: Generation cannot be started because the slescted buffer size is too small. Increase the buffer size. After probing the line before DAQ Assistant I confirmed only one element makes it through the loop and then throws this error? I've trying doing the same things with lower lowel DAQmx vi's using a DAQmx configure output buffer vi to override this buffer size problem, but still get the same result(not the error but same data flow problem)? Anybody know what's going on? I've included the vi's I've been working with. Thanks!
    Millie
    Attachments:
    Untitled 22.vi ‏228 KB
    Untitled 34.vi ‏180 KB

  • [svn:fx-trunk] 11999: Fixed: ASC-3889 - Using setting in a for loop causes Verify error

    Revision: 11999
    Revision: 11999
    Author:   [email protected]
    Date:     2009-11-19 11:37:09 -0800 (Thu, 19 Nov 2009)
    Log Message:
    Fixed: ASC-3889 - Using setting in a for loop causes Verify error
    Notes: emit pop after callstatic to a void function to balance the stack.
    Reviewer: jodyer+
    Testing: asc,tamarin,flex checkin tests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/ASC-3889
    Modified Paths:
        flex/sdk/trunk/modules/asc/src/java/macromedia/asc/semantics/CodeGenerator.java

    Blacklisting the ahci module does indeed get rid of the error. Would be nice to figure out why it was conflicting with the ahci module though.
    I have not yet tried the 173xx drivers, but the latest drivers for the Quadro FX 580 are the 256.53 drivers according to nvidia.
    Posted at the nV forums (http://www.nvnews.net/vbulletin/showthread.php?t=155282), so we'll see what they suggest.

  • [svn:fx-trunk] 11530: Fix ASC-3790 ( conditional expression in for loop causes verifier error) r=jodyer

    Revision: 11530
    Author:   [email protected]
    Date:     2009-11-06 13:23:05 -0800 (Fri, 06 Nov 2009)
    Log Message:
    Fix ASC-3790 (conditional expression in for loop causes verifier error) r=jodyer
    Ticket Links:
        http://bugs.adobe.com/jira/browse/ASC-3790
    Modified Paths:
        flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/ConditionalExpressionNode.java

  • Error -200429 DAQmx read (counter u32 1ch 1samp).vi -append- Edge count in for loop

    I am receiving error -200429 DAQmx read (counter u32 1ch 1 samp).vi <append>. This is occuring on the second loop of a for loop.
    I have a sequence inside the for loop that is using four DAQmx assistant vi's for edge count at various times in the sequence. All four of these count fine the first time through but at the beginning of the second loop the first edge count receives this error and does not count.
    Any ideas?

    The code you have supplied is similar to the converted subvi but this code will give an empty task error on the DAQmx Create Channel vi.
    Notice on the Daqmx create task vi that there is nothing wired to the "Task to copy" or the "Global virtual channels" connectors - I believe this is why the task is empty when sent to the Daqmx create channel vi.
    The code we are currently using is a modification of a previous code used before a recent upgrade. It may be better in your/NI eyes to re-write this into a State machine but time constraints and resources do not allow that at this time - All other parts of the current program work except for the counter on the second iteration. Would rather not reinvent the wheel at this point. 
    If the task is being cleared was the issue then the other three should also not execute. The issue appears to be the "First Call"
    I have attached a zip file of the complete program as it is now written to give you a better idea of the whole picture.
    Attachments:
    Test Machine current code.zip ‏657 KB

  • Error CreateImage in for loop array

    Hi,
    I would like to dynamically create images inside a for loop. It dependent on the array_size that the sevlets will send. Snapshots of code:
    for (int i = 0; i < ARRAY_SIZE; i++)
    img[i] = Image.createImage("\"/nike" + (i+1) + ".png\"");
    }Error:
    java.io.IOException
         at javax.microedition.lcdui.ImmutableImage.getImageFromStream(+15)
         at javax.microedition.lcdui.ImmutableImage.<init>(+20)
         at javax.microedition.lcdui.Image.createImage(+8)
         at SlidesCanvas.createImages(+138)
         at SlidesCanvas.<init>(+146)
         at ListSlides.commandAction(+113)
         at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
         at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
         at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
         at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
         at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+250)
    Is this a known bug in CreateImage? Or am i doing it in a wrong way?

    Herlena
    I tried this, it works.
    for (int i = 0; i < ARRAY_SIZE; i++) {
        img[i] = img.createImage("nike" + (i+1) + ".png");
    Hope your problem is solved, Darryl

Maybe you are looking for

  • My Macbook Pro Mid 2012 Runs Slow

    Hi My Macbook has started to run quite slow the last cople of months. I have a file from Etrecheck and here it is.I would be grateful for soe help. Brian EtreCheck version: 1.9.11 (43) - report generated 31 May 2014 01:26:17 BST Hardware Information:

  • Set tab page property

    In the new form instance of my form, I'm disabling all tab pages but I'm getting an error that the last enterable tab page cannot be set to false. Is there some way to go around this and achieve the same effect? Thanks a lot Marija

  • Numeric Integration of positive and negative values in the same signal

    Hello.. I need to perform an evaluation of Area Under Curve of my signal, but it contains positive and negative values. I am using the "Numeric Integration" function, but the result expressed by my VI represent: AREA OF POSITIVE VALUES - AREA OF NEGA

  • [svn:fx-trunk] 11027: Changes to enable using multiple style managers.

    Revision: 11027 Author:   [email protected] Date:     2009-10-20 08:50:09 -0700 (Tue, 20 Oct 2009) Log Message: Changes to enable using multiple style managers. Multiple style managers are not the default yet. Can be enabled by compiling with -creat

  • What services are these ?

    hi, when I give the command crs_stat -t I get everything online but the following Name          type          target     state ora....BSRV.cs     application     offline offline ora....db1.srv     application     offline     offline plz tell me what