Infinite looping code. Why?

Hi,
Have 2 rules. Rule 1, searches IdM repository for users matching params entered by a user. This rule generates a list as [GenericObject:000001,GenericObject:000034]. I pass this list to the searchResultList variable in rule below (Rule2) which (atlease I expect to) gets teh firstname aand sotre number from the GenericObjects in the list generated by Rule1.However, Rule2 always goes in a infinite loop, adn I dont understand why? Can any one help me pleae?
<block trace='true'>
  <defvar name='displaysearchlist'>
    <dolist name='searchlist'>
      <ref>searchResultList</ref>
      <defvar name='displaystring1'>
        <get>
          <ref>searchlist</ref>
          <s>firstname</s>
        </get>
      </defvar>
      <defvar name='displaystring2'>
        <get>
          <ref>searchlist</ref>
          <s>storenumber</s>
        </get>
      </defvar>
      <append name='displaysearchlist'>
        <concat>
          <ref>displaystring1</ref>
          <s> - </s>
          <ref>displaystring2</ref>
        </concat>
      </append>
    </dolist>
  </defvar>
  <ref>displaysearchlist</ref>
</block>Thanks in advance.

When you use the defvar the variable isn't actually created until it is referenced, which then goes back and uses the code to set the variable. So the defvar outside the list is evaluated when you call the displaysearchlist inside the dolist, creating the infinite loop.
since you are appending the list inside the dolist, use defvar name displaysearchlist, then set it to null.
ie
<defvar name='displaysearchlist'/>
<set name='displaysearchlist'>
<null/>
</set>
<dolist...
David

Similar Messages

  • I am getting an infinite loop.  Why?

    This small block of code is giving me an infinite loop. I can't understand why. The file is called "owners.dat" and it only has 10 lines. The purpose of this block of code is to count how many lines are in a file. What the heck is going on here?
                   Scanner countFile = new Scanner(new FileReader("owners.dat"));
                   while (countFile.hasNextLine())
                        size = size +1;
                   }Thanks for any advice

    You're never advancing the file, you're just continually checking that it has a next line, which it always does. You need to call Scanner.nextLine() in the loop.
    BufferedReader.readLine() would be a lot more efficient if this is a large file, but then why do you need to know the number of lines in a file at all?

  • Why am I getting an infinite loop?

    I have a for loop that never stops as the question suggests. If the boolean expression is true the loop does not stop. I tried tracing the loop and still cant figure out the solution. Please help. The code where the error is below with comments where the error is encountered:
        public static void printGame()
             //DECLARING
             //User input, height of wall
             int height = 0;
             //User input, how much R2-D2 climbs each day
             int climb;
             //User input, how much R2-D2 slips each day
             int slip;
             //Count of how many days it takes for R2-D2 leaves
             int count = 1;
             //Total after each day which is total + climb - slip
             int total = 0; 
             //User input, play again option
             char plyagn;
             //Gameplay         
             System.out.println("Please type in the height of the wall");
             //Height input
             height = In.getInt();
             System.out.println("Please type in how much R2-D2 climbs each day");
             //Climb input
             climb = In.getInt();
             System.out.println("Please type in how much R2-D2 slips each day");
             //Slip input
             slip = In.getInt();
             //Evaluation       
             for( ; height != total; count++) //<----My ERROR which is an infinite loop that never exits
                  total = total + climb - slip;
                  System.out.println(total); //I tried tracing the error
                  System.out.println(height); //I tried tracing the error
              //Printing the result of the evaluation
             System.out.println("R2-D2 will leave on the " + count + " day");
             System.out.println("Press Enter to continue");
             In.getChar();
             clear();
             System.out.println("Do you want to play again? (y/n)");
             plyagn = In.getChar();
             //If statment, prints appropriate message if or if not to play again
             if(plyagn == 'y' || plyagn == 'Y')
                  printMenu();
             //If n or any other value end program
             else
                  printEnd();
        }//End of printGame method

    flounder wrote:
    Lets say th variables have these values
    height = 10
    climb = 4
    slip = 1 which effectively adds 3 to total at each step.
    So total is 0, 3, 6, 9, 12, 15, 18 etc
    Total will always be not equal to height.
    So change your condition. Also, why are you using a for loop instead of a while loop.Flounder, I was hoping you would answer my question as you always provide good answers. Continuing, I feel so dumb for missing that error. Oh and as for using the for loop instead of a while loop is something i was meaning to change. Anyhow, Thank You.

  • Why does javadoc goes into an infinite loop

    at my dos prompt , in the same directory as my Page.java file, i type javadoc Page.java
    why does it go into an infinite loop? instead of producing any documentation
    it just says for example
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    Stephen

    this is a sample page -- i'm using jdk 1.4 trying to run javadoc Tracer.class or javadoc Tracer.java or javadoc Tracer gives throws the console into an infinite loop with the statement being printed over and over again. But i haven't just noticed this problem with javadoc -- i noticed this problem with certain types of mistakes in the code rather than just displaying the compiler error -- it creates this infinite loop in the dos console window. any thoughts ?
    here is my version.
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    * Tracer.class logs items according to the following criteria:
    * 2 = goes to text file Crawler_log.txt
    * 1 = goes to console window because it is higher priority.
    * @author Stephen
    * @version 1.0
    * @since June 2002
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    class Tracer{
         public static void log(int traceLevel, String message, Object value)
              pout.write(getLogFileDate(new Date()) +" >" + message + " value = " + value.toString());
         public static void log(int traceLevel, String message )
              pout.write("HI HOW ARE YOU " ) ;
              pout.flush();
         //public static accessor method
         public static Tracer getTracerInstance()
              return tracerInstance;
         private static String getLogFileDate(Date d )
              String s = df.format(d);
              String s1= s.replace(',','-');
              String s2= s1.replace(' ','-');
              String s3= s2.replace(':','.');
              System.out.println("getLogFileDate() = " + s3 ) ;
              return s3;
         //private instance
         private Tracer(){
              System.out.println("Tracer constructor works");
              df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
              date                    = new java.util.Date();
              try{
              pout = new PrintWriter(new BufferedWriter(new FileWriter("Crawler_log"+getLogFileDate(new Date())+".txt", true)));
              pout.write("**************** New Log File Created "+ getLogFileDate(new Date()) +"****************");
              pout.flush();
              }catch (IOException e){
              System.out.println("**********THERE WAS A CRITICAL ERROR GETTING TRACER SINGLETON INITIALIZED. APPLICATION WILL STOP EXECUTION. ******* ");
         public static void main(String[] argz){
         System.out.println("main method starts ");
         Tracer tt = Tracer.getTracerInstance();
         System.out.println("main method successfully gets Tracer instance tt. "+ tt.toString());
         //the next method is where it fails - on pout.write() of log method. Why ?
         tt.log(1, "HIGH PRIORITY");
         System.out.println("main method ends ");
         //private static reference
         private static Tracer tracerInstance = new Tracer();
         private static Date date     = null;
         private static PrintWriter pout = null;
         public static DateFormat df = null;
    }

  • [svn:osmf:] 14765: Put gate around autoRewind code, to prevent possibility of an infinite loop ( which could happen if you create a SerialElement with the last child a DurationElement of duration zero ).

    Revision: 14765
    Revision: 14765
    Author:   [email protected]
    Date:     2010-03-15 13:48:04 -0700 (Mon, 15 Mar 2010)
    Log Message:
    Put gate around autoRewind code, to prevent possibility of an infinite loop (which could happen if you create a SerialElement with the last child a DurationElement of duration zero).
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/media/MediaPlayer.as

    Step by step, how did you arrive at seeing this agreement?

  • Can anyone figure out why this runs into an infinite loop?

    Hi,
    I have the following class, and if i run it, I encounter an infinite loop. I have pinpointed the problem and it is because of the lines:
    try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch (Exception exp) {
                   System.err.println("Failed");
                exp.printStackTrace();
            }Here is the class. Any and all help is greatly appreciated. Thanks!
    package org.aemf.clinical.tol.gui.printing;
    import org.aemf.clinical.tol.model.TOLBion;
    import org.aemf.clinical.tol.model.Range;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.*;
    import java.awt.print.*;
    import java.awt.*;
    import java.util.Iterator;
    import java.util.ArrayList;
    * Created by IntelliJ IDEA.
    * User: arashn
    * Date: Feb 9, 2005
    * Time: 1:26:38 PM
    public class printTableTest implements Printable, Pageable {
         private PageFormat pf;
         private String[] headers = { "Heading 1", "Heading 2", "Heading 3"};
         private java.util.List bions = null;
         private ArrayList<Object[][]> data = new ArrayList<Object[][]>();
         public printTableTest(PageFormat format) {
              this.pf = format;
         public int getNumberOfPages() {
            return 1;
        public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException {
            return pf;
         public void setBions(java.util.List b) {
              bions = b;
              for(int x=0; x < 3; x++) {
                   //TOLBion bion = (TOLBion) bions.get(x);
                   int ndx = 0;
                   //Object[][] tempData = new Object[bion.getNumRanges()][3];
                   Object[][] tempData = new Object[2][3];
              //     for (Iterator itr = bion.getRanges(); ndx < 2 && itr.hasNext(); ) {
                   for (; ndx < 2 ; ) {
                   // Range range = (Range)itr.next();
                        //tempData[ndx] = new Object[] { new Integer(range.getFrequency()), range.getLowerBound(), range.getUpperBound() };
                        tempData[ndx] = new Object[] { "col 1: " + x, "col 2: " + x, "col 3: " + x };
                        ndx++;
                   data.add(tempData);
        public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException {
            return this;
         public int print(Graphics g, PageFormat format, int pageIndex) throws PrinterException {
              if(pageIndex > 1) {
                   return Printable.NO_SUCH_PAGE;
                                                                              System.err.println("Page: " + pageIndex);
              JFrame frame = null;
              JTable tableView = null;
              Graphics2D g2 = (Graphics2D) g;
              //Object[][] data = new Object[3][3];
              g2.setColor(Color.black);
              g2.translate(format.getImageableX() + 72, format.getImageableY() + 72);
              for(int x=0; x < data.size(); x++) {
                   tableView = new JTable(new PrintTableModel(headers, data.get(x)));
                   frame = new JFrame();
                   JScrollPane scrollpane = new JScrollPane(tableView);
                   scrollpane.setPreferredSize(new Dimension(300, 80));
                   frame.getContentPane().setLayout(new BorderLayout());
                   frame.getContentPane().add(BorderLayout.CENTER,scrollpane);
                   frame.pack();
                   tableView.paint(g2);
                   g2.translate(0, - tableView.getTableHeader().getHeight());
                   tableView.getTableHeader().paint(g2);
                   g2.translate(0, format.getImageableHeight()/3);
              return Printable.PAGE_EXISTS;
         public static void main(String args[]) {
              PrinterJob printerJob = PrinterJob.getPrinterJob();
              try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch (Exception exp) {
                   System.err.println("Failed");
                exp.printStackTrace();
             int INCH = 72;
              double LETTER_WIDTH = 8.5 * INCH;
              double LETTER_HEIGHT = 11 * INCH;
            Paper paper = new Paper();
              int margin = INCH/6; // << set your margins here
              double pageWidth = LETTER_WIDTH - 2 * margin;
              double pageHeigth = LETTER_HEIGHT - 2 * margin;
              paper.setImageableArea(margin, margin, pageWidth, pageHeigth) ;
              PageFormat format = printerJob.defaultPage();
              format.setPaper(paper);
            printTableTest pp = new printTableTest(format);
            pp.setBions(new ArrayList());
              printerJob.setPageable(pp);
              boolean doPrint = printerJob.printDialog();
              if (doPrint) {
                   try {
                        printerJob.print();
                   } catch (PrinterException exception) {
                        System.err.println("Printing error: " + exception);
             System.exit(0);
         private class PrintTableModel extends AbstractTableModel {
              private Object[][] data = null;
              private String[] headers = null;
              public PrintTableModel(String[] headers, Object[][] data) {
                   this.headers = headers;
                   this.data = data;
              public int getColumnCount() { return headers.length; }
              public int getRowCount() { return data.length; }
              public Object getValueAt(int row, int col) { return data[row][col]; }
              public String getColumnName(int column) { return headers[column]; }
              public Class getColumnClass(int col) { return getValueAt(0,col).getClass(); }
              public boolean isCellEditable(int row, int col) { return false; }
              public void setValueAt(Object aValue, int row, int column) { data[row][column] = aValue; }
    }

    I have managed to create an even simpler version which tries to print the same header 3 times. Again, if you remove the setLookAndFeel line, everything works out great.
    import javax.swing.table.*;
    import javax.swing.*;
    import java.awt.print.*;
    import java.awt.*;
    * Created by IntelliJ IDEA.
    * User: arashn
    * Date: Feb 9, 2005
    * Time: 1:26:38 PM
    public class printTableTest implements Printable, Pageable {
         private PageFormat pf;
         public printTableTest(PageFormat format) {
              this.pf = format;
         public int getNumberOfPages() {
            return 1;
        public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException {
            return pf;
        public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException {
            return this;
         public int print(Graphics g, PageFormat format, int pageIndex) throws PrinterException {
              if(pageIndex > 1) {
                   return Printable.NO_SUCH_PAGE;
              System.err.println("Printing Page: " + pageIndex);
              Graphics2D g2 = (Graphics2D) g;
              g2.setColor(Color.black);
              g2.translate(format.getImageableX() + 72, format.getImageableY() + 72);
              DefaultTableColumnModel dtcm = new DefaultTableColumnModel();
              TableColumn tc = new TableColumn();
              tc.setHeaderValue("Heading 1");
              dtcm.addColumn(tc);
              tc.setHeaderValue("Heading 2");
              dtcm.addColumn(tc);
              tc.setHeaderValue("Heading 2");
              dtcm.addColumn(tc);
              JTableHeader tableHeader = new JTableHeader(dtcm);
              JScrollPane scrollpane2 = new JScrollPane(tableHeader);
              scrollpane2.setPreferredSize(new Dimension(300, 80));
              JFrame frame2 = new JFrame();
              frame2.getContentPane().add(BorderLayout.NORTH,scrollpane2);
              frame2.pack();
              for(int x=0; x < 3; x++) {                   
                   tableHeader.paint(g2);
                   g2.translate(0, format.getImageableHeight()/3);
              return Printable.PAGE_EXISTS;
         public static void main(String args[]) {
              PrinterJob printerJob = PrinterJob.getPrinterJob();
              try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch (Exception exp) {
                   System.err.println("Failed");
                exp.printStackTrace();
             int INCH = 72;
              double LETTER_WIDTH = 8.5 * INCH;
              double LETTER_HEIGHT = 11 * INCH;
            Paper paper = new Paper();
              int margin = INCH/6; // << set your margins here
              double pageWidth = LETTER_WIDTH - 2 * margin;
              double pageHeigth = LETTER_HEIGHT - 2 * margin;
              paper.setImageableArea(margin, margin, pageWidth, pageHeigth) ;
              PageFormat format = printerJob.defaultPage();
              format.setPaper(paper);
            printTableTest pp = new printTableTest(format);
              printerJob.setPageable(pp);
              boolean doPrint = printerJob.printDialog();
              if (doPrint) {
                   try {
                        printerJob.print();
                   } catch (PrinterException exception) {
                        System.err.println("Printing error: " + exception);
             System.exit(0);
    }

  • Infinite loop error after using Java Sun Tutorial for Learning Swing

    I have been attempting to create a GUI following Sun's learning swing by example (example two): http://java.sun.com/docs/books/tutorial/uiswing/learn/example2.html
    In particular, the following lines were used almost word-for-word to avoid a non-static method call problem:
    SwingApplication app = new SwingApplication();
    Component contents = app.createComponents();
    frame.getContentPane().add(contents, BorderLayout.CENTER);I believe that I am accidentally creating a new instance of the gui class repeatedly (since it shows new GUI's constantly and then crashes my computer), possibly because I am creating an instance in the main class, but creating another instance in the GUI itself. I am not sure how to avoid this, given that the tutorials I have seen do not deal with having a main class as well as the GUI. I have googled (a nice new verb) this problem and have been through the rest of the swing by example tutorials, although I am sure I am simply missing a website that details this problem. Any pointers on websites to study to avoid this problem would be appreciated.
    Thanks for your time-
    Danielle
    /** GUI for MicroMerger program
    * Created July/06 at IARC
    *@ author Danielle
    package micromerger;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.swing.JFileChooser;
    import java.lang.Object;
    public class MGui
         private static File inputFile1, inputFile2;
         private static File sfile1, sfile2;
         private static String file1Name, file2Name;
         private String currFile1, currFile2;
         private JButton enterFile1, enterFile2;
         private JLabel enterLabel1, enterLabel2;
         private static MGui app;
         public MGui()
              javax.swing.SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        System.out.println("About to run create GUI method");
                        app = new MGui();
                        System.out.println("declared a new MGui....");
                        createAndShowGUI();
         //initialize look and feel of program
         private static void initLookAndFeel() {
            String lookAndFeel = null;
         lookAndFeel = UIManager.getSystemLookAndFeelClassName();
         try
              UIManager.setLookAndFeel(lookAndFeel);
         catch (ClassNotFoundException e) {
                    System.err.println("Couldn't find class for specified look and feel:"
                                       + lookAndFeel);
                    System.err.println("Did you include the L&F library in the class path?");
                    System.err.println("Using the default look and feel.");
                } catch (UnsupportedLookAndFeelException e) {
                    System.err.println("Can't use the specified look and feel ("
                                       + lookAndFeel
                                       + ") on this platform.");
                    System.err.println("Using the default look and feel.");
                } catch (Exception e) {
                    System.err.println("Couldn't get specified look and feel ("
                                       + lookAndFeel
                                       + "), for some reason.");
                    System.err.println("Using the default look and feel.");
                    e.printStackTrace();
         // Make Components--
         private Component createLeftComponents()
              // Make panel-- grid layout
         JPanel pane = new JPanel(new GridLayout(0,1));
            //Add label
            JLabel welcomeLabel = new JLabel("Welcome to MicroMerger.  Please Enter your files.");
            pane.add(welcomeLabel);
         //Add buttons to enter files:
         enterFile1 = new JButton("Please click to enter the first file.");
         enterFile1.addActionListener(new enterFile1Action());
         pane.add(enterFile1);
         enterLabel1 = new JLabel("");
         pane.add(enterLabel1);
         enterFile2 = new JButton("Please click to enter the second file.");
         enterFile2.addActionListener(new enterFile2Action());
         pane.add(enterFile2);
         enterLabel2 = new JLabel("");
         pane.add(enterLabel2);
         return pane;
         /** Make GUI:
         private static void createAndShowGUI()
         System.out.println("Creating a gui...");
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("MicroMerger");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         //Add stuff to the frame
         //MGui app = new MGui();
         Component leftContents = app.createLeftComponents();
         frame.getContentPane().add(leftContents, BorderLayout.WEST);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
    private class enterFile1Action implements ActionListener
         public void actionPerformed(ActionEvent evt)
              JFileChooser chooser = new JFileChooser();
              int rVal = chooser.showOpenDialog(enterFile1);
              if(rVal == JFileChooser.APPROVE_OPTION)
                   inputFile1 = chooser.getSelectedFile();
                   PrintWriter outputStream;
                   file1Name = inputFile1.getName();
                   enterLabel1.setText(file1Name);
    private class enterFile2Action implements ActionListener
         public void actionPerformed(ActionEvent evt)
              JFileChooser chooser = new JFileChooser();
              int rVal = chooser.showOpenDialog(enterFile1);
              if(rVal == JFileChooser.APPROVE_OPTION)
                   inputFile2 = chooser.getSelectedFile();
                   PrintWriter outputStream;
                   file2Name = inputFile2.getName();
                   enterLabel2.setText(file2Name);
    } // end classAnd now the main class:
    * Main.java
    * Created on June 13, 2006, 2:29 PM
    * @author Danielle
    package micromerger;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Main
        /** Creates a new instance of Main */
        public Main()
         * @param args the command line arguments
        public static void main(String[] args)
            MGui mainScreen = new MGui();
            //mainScreen.setVisible(true);
            /**Starting to get file choices and moving them into GPR Handler:
             System.out.println("into main method");
         String file1Name = new String("");
             file1Name = MGui.get1Name();
         System.out.println("good so far- have MGui.get1Name()");
        }// end main(String[] args)
    }// end class Main

    um, yeah, you definitely have a recursion problem, that's going to create an infinite loop. you will eventually end up an out of memory error, if you don't first get the OS telling you you have too many windows. interestingly, because you are deferring execution, you won't get a stack overflow error, which you expect in an infinite recursion.
    lets examine why this is happening:
    in main, you call new MGui().
    new MGui() creates a runnable object which will be run on the event dispatch thread. That method ALSO calls new MGui(), which in turn ALSO creates a new object which will be run on the event dispatch thead. That obejct ALSO calls new MGui(), which ...
    well, hopefully you get the picture.
    you should never unconditionally call a method from within itself. that code that you have put in the constructor for MGui should REALLY be in the main method, and the first time you create the MGui in the main method as it currently exists is unnecessary.
    here's what you do: get rid of the MGui constructor altogether. since it is the implicit constructor anyway, if it doesn't do anything, you don't need to provide it.
    now, your main method should actually look like this:
    public static void main( String [] args ) {
      SwingUtilities.invokeLater( new Runnable() {
        public void run() {
          MGui app = new MGui();
          app.createAndShowGUI();
    }// end mainyou could also declare app and call the constructor before creating the Runnable, as many prefer, because you would have access to it from outside of the Runnable object. The catch there, though, is that app would need to be declared final.
    - Adam

  • Extension Installer in infinite loop

    Hi,
    I'm trying to use an Extension Installer to install some extra files for my application. I've searched the forum for problems with the Extension Installer and I've seen a few posts, even the same problem I'm having. But none of the suggestions have helped.
    When I run the Extension Installer locally on my own machine it works just fine. However when I move the code to access over the internet the extension installer gets stuck in an infinite loop and my application will never start. And yes, my installer ends with eis.installSucceeded(false).
    Based on other messages in the forum, these are some of the things that I've tried, to no avail:
    1. Add System.exit(0) as the very last statement in my installer.
    2. I don't specify a port in my codebase in either the application jnlp or the extension jnlp.
    3. The webserver is running on the default port (80).
    4. Tried adding "javaws.cfg.forceUpdate=false" to my javaws.cfg file.
    I'm using JWS 1.0.1_02. My web server is IBM HTTP Server. The machine that I'm trying to install to is running W2K.
    Anyone have any suggestions?
    Thanks,
    Beth

    The funny thing is that with you it seems to happen
    during
    one JWS launch session.
    So I wonder why JWS will run k instances of your
    Extension
    installer.
    You don't have an <extension> tag in the jnlp file of
    your extension
    installer, creating an infinite recursion?
    Yes, I wonder why I get multiple instances of the Extension Installer. And also that it works fine if everything is running on my local computer. If I just change the codebase and run everything over the internet is when I get it an infinite loop. Any ideas would be greatly appreciated.
    If it will help, here are my .jnlp files:
    Extension:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for SpellChecker Installer -->
    <jnlp     spec="1.0 1.0+"
         codebase="http://apsrv176.ctt.com/bethTest" >
         <information>
              <title>NGS SpellChecker Installer</title>
              <vendor>Vendor</vendor>
              <homepage href="docs/help.html"/>
              <description>SpellChecker Installer</description>
              <description kind="short">Install the SpellChecker files</description>
         </information>
    <security>
    <all-permissions />
    </security>
         <resources>
              <j2se version="1.2"/>
              <property name="ngs.root" value="NGS"/>
              <property name="spellchecker.home" value="SpellChecker"/>
              <jar href="SpellChecker/SpellCheckerInstaller.jar"/>
         </resources>
         <installer-desc main-class="com.ngs.spellcheckerinstaller.SpellCheckerInstaller" />
    </jnlp>
    Main:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for test application -->
    <jnlp     spec="1.0 1.0+"
         codebase="http://apsrv176.ctt.com/bethTest" >
         <information>
              <title>NGS Application</title>
              <vendor>Vendor</vendor>
              <homepage href="docs/help.html"/>
              <description>NGS</description>
              <description kind="short">NGS</description>
              <icon href="images/ngs.jpg"/>
         </information>
         <security>
              <all-permissions/>
         </security>
         <resources>
              <j2se version="1.2" initial-heap-size="64m" max-heap-size="64m"/>
              <property name="ngs.root" value="NGS"/>
              <property name="spellchecker.home" value="SpellChecker"/>
              <jar href="jars/NGSMainForm.jar"/>
    <snip... lots of other jars>
              <nativelib href="jars/bridge2java.jar" />
              <extension href="Third_Party_Jars.jnlp" />
         </resources>
         <resources>
              <extension
                   name="SpellCheckerInstaller"
                   href="SpellCheckerInstaller.jnlp">
              </extension>
         </resources>
         <application-desc main-class="NGSMainForm"/>
    </jnlp>

  • UDP client stuck in infinite loop

    public static void main(String args[]) throws Exception
          BufferedReader inFromUser= new BufferedReader(new   InputStreamReader(System.in));
          DatagramSocket clientSocket= new DatagramSocket();
          InetAddress IPAddress = InetAddress.getLocalHost();
          byte[] sendData = new byte[1024];
          byte[] receiveData = new byte[1024];
          String sentence = "";
          boolean quit = true;
               while(quit == true);
               String initiateConntact = "hi there";
               sendData= initiateConntact.getBytes();
               DatagramPacket sendPacket= new DatagramPacket(sendData, sendData.length, IPAddress, 9876);
               clientSocket.send(sendPacket);
               DatagramPacket receivePacket= new DatagramPacket(receiveData, receiveData.length);
               clientSocket.receive(receivePacket);
               String modifiedSentence= new String(receivePacket.getData());
               InetAddress getIPFromServer = receivePacket.getAddress();
               System.out.println("The server is located at : " + getIPFromServer);
               sentence = inFromUser.readLine();
               System.out.println("From Server:" + modifiedSentence);
                  if(sentence.equals("bye"));
                     quit = false;
                             clientSocket.close();
          }I am just courious why this pice of code gets stuck in an infinite loop.
    (it seems anyway). It doesnt even make it into the while statement. If i replace the while with an if statement, everything works smoothly. Does anyone know what is actually happening here and why?
    Thanks for your time.

    Why didnt the java compiler report the ;? or the
    missing =?Because they're both syntactically valid.
    You might want to code a loop with no body:
    while ((ch = readChar()) != 0);
    (same as)
    while ((ch = readChar()) != 0)
    // do nothing
    And you might want to assign a boolean variable and compare it at the same time:
    while (flag = callSomeMethod())
    (as opposed to)
    while ((flag = callSomeMethod()) == true)
    Although in both cases I'd write them differently rather than making a statement which has 'side-effects' and makes for slightly less-readable code.

  • ABAP-query going in infinite loop

    Hello all,
    I have one on abap-query in which i am displaying data for delivery details that is table LIKP and LIPS.
    In this query i also have some code to get the sale order details from the  the delivery details.
    I have also used one FM module in this query as well as select endselet  stamt.
    When i run my quey it i going in infinite loop.  I am not getting any thing . Each time i have to exit the screen.
    Can anyone please tell me wat is the problem, why it is going in infinite  loop.
    Thanks and regards
    Sachin yadav

    thanks for your help,
    But may i know how to display my internal table data to out put screen.
    As i am new to the query i do not know how to display internal table data to report along with my data coming from ABAp-query.
    for eg i have three field to display suppose A , B and C.
    Field A and B are coming from query and i have to display field C from internal table.
    How to do that
    thanks in advance

  • Paint() method is in infinite loop when focus is set to JTextPane

    Hi All,
    I am creating one JScrollPane, JPanel and JTextPane. JPanel is added to JScrollPane and JTextPane is added to JPanel. If I override paint() method in JPanel, its in infinite loop. I don't know why it is behaving like this. Can anyone solve my problem. Since, I am doing so much drawings in paint() method, its getting to slow.
    Here is the code what I wrote.
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestTextPane1 extends JFrame {
         JPanel panel;
         JScrollPane pane;
         public TestTextPane1() {
              panel = new JPanel(new BorderLayout()) {
                   public void paint(Graphics g) {
                        super.paint(g);
                        System.out.println("inside paint");
              JTextPane textPane = new JTextPane();
              panel.add(textPane);
              pane = new JScrollPane(panel);
              getContentPane().add(pane);
              setSize(300, 200);
              setVisible(true);
         public static void main(String [] args) {
              new TestTextPane1();
    Any help will be useful for me.
    Regards
    Kishore.

    What are you trying to do? You are adding the textPane to the panel and then overriding the paint() method. The textPane will never be painted if you do this.
    In Swing, you should override the paintComponent() method, not the paint() method. See the Swing tutorial on Painting:
    http://java.sun.com/docs/books/tutorial/uiswing/overview/draw.html
    Don't forget to read the "Working With Graphics" link at the bottom.

  • LDAP/Authentication infinite loop

    My authentication provider uses an LDAP call to retrieve a data source via JNDI.
    The LDAP call apparently triggers a security check/login which then calls my
    getLoginModuleConfiguration() which again attempts to retrieve the data source.
    Infinite loop.
    How do I stop this from happening?
    If the code that is executing is part of the security framework and is in an obviously
    thread with access, why is this login occurring and how can we stop it?
    Thank you.
    Frederick N. Brier

    I found this article in spanish ( fortunately I speak and write it), where saids how I can solve this problem.
    [http://oracleradio.blogspot.com/2011/09/solucionando-el-ciclo-infinito-en.html]
    The problem was the :
    <app-role>
    <name>anonymous-role</name>
    <class>oracle.security.jps.internal.core.principals.JpsAnonymousRoleImpl</class> // this Class was the problem<display-name>anonymous-role</display-name>
    </app-role>You need reemplace that Class for : *"oracle.security.jps.service.policystore.ApplicationRole"*
    like this :
    <app-role>
    <name>anonymous-role</name>
    <class>oracle.security.jps.service.policystore.ApplicationRole</class><display-name>anonymous-role</display-name>
    </app-role>And the Anonymous and all the Roles will work Fine !!

  • Help me pls! - Infinite loop!!

    Dear Guys,
    I am totally lost in my codes, pls help, TQ:
    import java.io.*;
    public class opReadLine {
         public opReadLine() {} //class constructor
         public static void main(String args[]) {
              FileReader inFile;
              BufferedReader inData;
              try {
                   inFile = new FileReader("test.cfg");
                   inData = new BufferedReader(inFile);
                   String temp = inData.readLine();
                   do {
                        System.out.println("The UID is: " + temp);
                   } while (temp != "END");
                   inData.close();
              catch (IOException ie) {
              ie.printStackTrace();
    Content of "test.cfg":
    END
    note: there is no blank line above "END"!!
    Rgds,
    Daniel

    Sorry I forgot to state the problem I am facing and the code I actually wanted.
    I want my code to read from a file line by line until it meets the word "END".
    However, I found there is a big syntax problem in:
    do {
    } while (temp != "END");
    The result for the code above is infinite loop of System.out.println("The UID is: " + temp);
    However,
    when I changed the code to:
    do {
    } while (temp == "END");
    it will execute "System.out.println(The UID is: " + temp) once and stops.
    In other words, the code recognizes END, but why when I try to compare with !=, it gives me problem??
    Pls help! TQ

  • Infinite loop at db_open

    Hi!
    There is another problem on multi-process env.
    $ pstack 17778
    #0 0x0057cc62 in memcmp () from /lib/tls/libc.so.6
    #1 0x088652e0 in ?? ()
    #2 0x08291bf6 in __env_setup ()
    #3 0x081ad39e in __db_open ()
    #4 0x082a5639 in __db_open_pp ()
    #5 0x0814dc2c in btreeCreateDataTable ()
    #6 0x0814e21a in sqlite3BtreeCursor ()
    #7 0x08152a56 in btreeLockSchema ()
    #8 0x08152be9 in sqlite3BtreeLockTable ()
    #9 0x0816c0d7 in sqlite3VdbeExec ()
    #10 0x0815fd06 in sqlite3Step ()
    #11 0x0815ff06 in sqlite3_step ()
    #12 0x08189a39 in sqlite3_exec ()
    #13 0x0818db72 in sqlite3InitOne ()
    #14 0x0818dd16 in sqlite3Init ()
    #15 0x0818de26 in sqlite3ReadSchema ()
    #16 0x0817a7fa in sqlite3LocateTable ()
    #17 0x0819442b in selectExpander ()
    #18 0x0816e112 in sqlite3WalkSelect ()
    #19 0x08194b2d in sqlite3SelectExpand ()
    #20 0x08194cd1 in sqlite3SelectPrep ()
    #21 0x081952cd in sqlite3Select ()
    #22 0x081a476a in yy_reduce ()
    #23 0x081a6839 in sqlite3Parser ()
    #24 0x081a74f3 in sqlite3RunParser ()
    #25 0x0818e2be in sqlite3Prepare ()
    #26 0x0818e660 in sqlite3LockAndPrepare ()
    #27 0x0818e84d in sqlite3_prepare ()
    #28 0x081899d2 in sqlite3_exec ()
    #29 0x08196d37 in sqlite3_get_table ()
    #30 0x08063d2c in _db_open_ex ()
    #31 0x080637a8 in _db_open ()
    ...On multi-process env, somecase, env->dblist is crashed.
       馹../src/db/db.c葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺衆
       477 TAILQ_FOREACH(ldbp, &env->dblist, dblistlinks) {
       478 /*
       479 * There are three cases: on-disk database (first c
       480 * named in-memory database (second clause), tempor
       481 * (never matches; no clause).
       482 */
       483 if (!F_ISSET(dbp, DB_AM_INMEM)) {
      >484 if (memcmp(ldbp->fileid, dbp->fileid, DB_FI
       485 == 0 && ldbp->meta_pgno == dbp->meta_pg
       486 break;
       487 } else if (dname != NULL) {
       488 if (F_ISSET(ldbp, DB_AM_INMEM) &&
       489 ldbp->dname != NULL &&
       章葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺葺
    multi-thre process 17778 In: __env_setup Line: 484 PC: 0x8291bf6
        at ../src/db/db.c:484
    (gdb) p env->dblist
    $1 = {tqh_first = 0x888a268, tqh_last = 0x88273ac}
    (gdb) p ldbp->dblistlinks
    $2 = {tqe_next = 0x888a268, tqe_prev = 0x888a344}
    (gdb) p ldbp->dblistlinks .tqe_next->dblistlinks
    $3 = {tqe_next = 0x888a268, tqe_prev = 0x888a344} So, I just add defense codes.
    src/db/db.c
    @@ -475,6 +475,13 @@
            MUTEX_LOCK(env, env->mtx_dblist);
            maxid = 0;
            TAILQ_FOREACH(ldbp, &env->dblist, dblistlinks) {
    +               /* infinite loop fix */
    +               if (ldbp != env->dblist.tqh_last &&
    +                   ldbp == ldbp->dblistlinks.tqe_next) {
    +                       MUTEX_UNLOCK(env, env->mtx_dblist);
    +                       return (-1);
    +               }
    +Is it ok?
    I want to know why env->dblist is crashed.
    Thanks.

    Hello,
    Is it possible to provide a test case which illustrates this scenario?
    Thank you,
    Sandra

  • Enumeration never reaches nextElement(), goes into infinite loop

    String key = "";
    while (request.getSession().getAttributeNames().hasMoreElements()) {
      key = (String) request.getSession().getAttributeNames().nextElement();
      out.println("key = " + key + " and its value = " + (String) request.getSession().getAttribute(key) + "<P>");
    }This results in an infinite loop where key is the same first element while the Enumeration never advances.
    Why would this happen? Any ideas?
    Thanks

    Why would this happen? Any ideas? Your code obtains a fresh enumeration with each loop. Don't. Just use the same enumeration. Example:
    Enumeration e = request.getSession().getAttributeNames();
    while (e.hasMoreElements()) {
      String key = (String) e.nextElement();
      out.println("key = " + key + " and its value = " + (String) request.getSession().getAttribute(key) + "<P>");
    }~

Maybe you are looking for

  • Windows 8.1 not seeing iPad

    I have a new Windows 8.1 computer build. I installed the latest version of iTunes, 11.3.1.2. When I connected my iPad 3 running 7.1.2, the iPad kept asking if I wanted the trust the computer. No matter how many times I clicked trust, it ignored it. O

  • Standard SAP reporting

    I have a requirement to find a report that shows a breakdown of 3rd party costs, I have created in a condition record. I have created a BOM. The BOM at header level is relevant for pricing and billing. The sub-boms are just relevant for statistical p

  • Utilize existing RFQ

    Hi, Can you please help me with the following issue? An RFQ was created based on a purchase requisition. Later on sales people decided to reject the sales order line and thereby delete the purchase requisition. They created a new sales order line in

  • Thread safe - what's that mean?

    Hello, I'm new to Java technology and I constantly read the Java forum as one way to learn from other's experience. What's that mean by "thread safe" as I often saw it in the forum and what's the difference between "thread" and "process"? Thanks in a

  • Creating two or more procedures from ODBC

    Hi. I'm trying to create several standalone procedures in an Oracle 8.1.7 server, using ODBC pass-thru. I'm trying to create these procedures: CREATE OR REPLACE PROCEDURE EMSetContext(compid CHAR) AS BEGIN dbms_session.set_context('EMCTX','compid',RP