Problem with recursive function & Exception in thread "AWT-EventQueue-0"

I hope that title doesn't put everyone off :)
I have a recursive function that takes in a list of words, and a reference to my current best board. I am kludging the escape function +(tryWords.size() == 0 || mTotalBlankBlocks < 200)+ atm, but eventually it will escape based on whether the current bestBoard meets certain requirements. The function makes iterates through a list of words, and finds all the spaces that the word would fit into the puzzle: getValidSpacedPositions(currentWord); - it then iterates through each of these; placing a word, removing that word from the iterator and the relevant arrayLists and then recurses the function and tries to do the same with the next word etc.
private void computeBoards(ArrayList<Word> tryWords, Board bestBoard) {
     if (tryWords.size() == 0 || mTotalBlankBlocks < 200)
          return;
     for(Iterator<Word> iter = tryWords.iterator(); iter.hasNext(); ){
          Word currentWord = new Word();
          currentWord = iter.next();
          ArrayList<Position> positions = new ArrayList<Position>();
          positions = getValidSpacedPositions(currentWord);
          if (positions.size() != 0)
               iter.remove();
          System.out.println();
          int placedWordsIndex = tryWords.indexOf(currentWord);
          System.out.print(placedWordsIndex+". "+currentWord.getString()+" with "+positions.size()+" positions / ");
          for (Position position : positions) {
               System.out.println("Pos:"+(positions.indexOf(position)+1)+" of "+positions.size()+"  "+position.getX()+","+position.getY()+","+position.getZ());
               int blankBlocksLeft = placeWord(currentWord, position);
               if(blankBlocksLeft != 0)
                    mPlacedWords.add(currentWord);
                    // TODO: Kludge! Fix this.
                    mUnplacedWords.remove(placedWordsIndex+1);
                    System.out.println("adding "+currentWord.getString()+" to added words list");
                    Board compareBoard = new Board(blankBlocksLeft, mPlacedWords.size());
                    if (compareBoard.getPercFilled() > bestBoard.getPercFilled())
                         bestBoard = new Board(blankBlocksLeft, mPlacedWords.size());
                    //**RECURSE**//
                    computeBoards(tryWords, bestBoard);
                    mUnplacedWords.add(currentWord);
                    removeWord(currentWord);
                    System.out.println("removing "+currentWord.getString()+" from added words list");
               else
                    System.out.println("strange error, spaces are there but word cannot place");
          System.out.println("**FINISHED ITERATING POSITIONS");
     System.out.println("**FINISHED ITERATING TRYWORDS");
}This all seems to work fine, but I add it in for completeness because I am not sure if I have done this right. The Exception occurs in the placeWord function which is called from the recursive loop, on the line bolded. For some reason the Arraylist Words seems to initialise with size 1 even though it is a null's when I look at it, (hence all the redundant code here) and I can't seem to test for null either, it seems to works fine for a while until the recursive funciton above has to back up a few iterations, then it crashes with the exception below.
     private int placeWord(Word word, Position originPosition) {
          ArrayList<Word> words = new ArrayList<Word>();
          switch (originPosition.getAxis().getCurrInChar()) {
          case 'x':
               // TODO: This is returning ONE!!!s
               words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
               int tempword1 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
               for (int i = 0; i < word.getLength(); i++) {
                    *if (words.get(0) == null)*
                         mBlockCube[originPosition.getX() + i][originPosition.getY()][originPosition.getZ()] = new Block(word, word.getChar(i));
                    else
                         mBlockCube[originPosition.getX() + i][originPosition.getY()][originPosition.getZ()].addWord(word);
               break;
          case 'y':
               words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
               int tempword2 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
               for (int i = 0; i < word.getLength(); i++) {
                    *if (words.get(0) == null)*
                         mBlockCube[originPosition.getX()][originPosition.getY() + i][originPosition.getZ()] = new Block(word, word.getChar(i));
                    else
                         mBlockCube[originPosition.getX()][originPosition.getY() + i][originPosition.getZ()].addWord(word);
               break;
          case 'z':
               words = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords();
               int tempword3 = mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ()].getWords().size();
               for (int i = 0; i < word.getLength(); i++) {
                    *if (words.get(0) == null)*
                         mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ() + i] = new Block(word, word.getChar(i));
                    else
                         mBlockCube[originPosition.getX()][originPosition.getY()][originPosition.getZ() + i].addWord(word);
               break;
          mTotalBlankBlocks -= word.getLength();
          word.place(originPosition);
          String wordStr = new String(word.getWord());
          System.out.println("Word Placed: " + wordStr + " on Axis: " + originPosition.getAxis().getCurrInChar() + " at pos: "
                    + originPosition.getX() + "," + originPosition.getY() + "," + originPosition.getZ());
          return mTotalBlankBlocks;
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
     at java.util.ArrayList.RangeCheck(Unknown Source)
     at java.util.ArrayList.get(Unknown Source)
     at com.edzillion.crossword.GameCube.placeWord(GameCube.java:189)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:740)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.computeBoards(GameCube.java:763)
     at com.edzillion.crossword.GameCube.generateGameCube2(GameCube.java:667)
     at com.edzillion.crossword.GameCube.<init>(GameCube.java:42)
     at com.edzillion.crossword.Crossword.actionPerformed(Crossword.java:205)
     at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
Any ideas? I've looked up this exception which didn't shed any light...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

ArrayList<Word> words = new ArrayList<Word>();See the API Javadoc for ArrayList: this creates an empty ArrayList.
if (words.get(0) == null)This tries to read the first element of the (still empty) array list -> throws IndexOutOFBoundsException
If you want to stick to that logic (I am too lazy to proof-read your whole algorithm, but that should at least unblock you), you should first check whether the list actually contains at least one element:
if (!words.isEmpty()) {...}

Similar Messages

  • Why Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException?

    Hello,
    In my netbeans generated swing code I get the following stacktrace:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at javax.swing.text.PlainView.updateMetrics(PlainView.java:188)
         at javax.swing.text.PlainView.lineToRect(PlainView.java:589)
         at javax.swing.text.PlainView.modelToView(PlainView.java:327)
         at javax.swing.text.FieldView.modelToView(FieldView.java:248)
         at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(BasicTextUI.java:1498)
         at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1036)
         at javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1291)
         at javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1270)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)The code is @ http://code.google.com/p/memorizeasy/source/browse/trunk/MemorizEasy/src/com/mysimpatico/memorizeasy/engine/executables/Input.java

    So the problem is given by these two lines, of the Swing-X library:
    AutoCompleteDecorator.decorate(expField, exps, false);
    AutoCompleteDecorator.decorate(defField, exps, false);
    However, the functionality intended from them is given. The problem now seems to do with expField.setText() and expField.selectAll(). I've inline initialized expField, and now it works.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * Input1.java
    * Created on Feb 21, 2010, 11:56:00 AM
    import java.util.ArrayList;
    import javax.swing.*;
    import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
    public class Input1 extends javax.swing.JFrame {
         private static final long serialVersionUID = 2819528413930929081L;
         private static final ArrayList<String> exps = new ArrayList<String>();//Database.getAllExps();
         private static final Input1 instance  = new Input1();
         /* private void defFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_defFieldFocusGained
                 defField.selectAll();
         }//GEN-LAST:event_defFieldFocusGained
             private void expFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_expFieldActionPerformed
                final String exp = expField.getText();
               /* if (defField.isVisible() && exp != null && exps.contains(exp)){
                    status.setText("to change the spelling select Spelling from the Edit Menu.");
                else if (!defField.isVisible()){ //in spelling mode
                    Database.editExpression(exSpell, exp);
                    status.setText("spelling for " + exSpell + " changed to " + exp);
                    defField.setVisible(true);
                    spellingMenuItem.setEnabled(false);
             }//GEN-LAST:event_expFieldActionPerformed
         private void initComponents() {
              contentPanel = new javax.swing.JPanel();
              expField = new javax.swing.JTextField();
               expField.setText("expression");
                    /*  expField.addActionListener(new java.awt.event.ActionListener() {
                          public void actionPerformed(java.awt.event.ActionEvent evt) {
                              expFieldActionPerformed(evt);
                      expField.addFocusListener(new java.awt.event.FocusAdapter() {
                          public void focusGained(java.awt.event.FocusEvent evt) {
                              expFieldFocusGained(evt);
                      defField.setText("definition");
                      defField.addActionListener(new java.awt.event.ActionListener() {
                          public void actionPerformed(java.awt.event.ActionEvent evt) {
                              defFieldActionPerformed(evt);
                      defField.addFocusListener(new java.awt.event.FocusAdapter() {
                          public void focusGained(java.awt.event.FocusEvent evt) {
                              defFieldFocusGained(evt);
              setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
              contentPanel.add(expField);
              expField.setVisible(true);
              this.setContentPane(contentPanel);
              pack();
         }// </editor-fold>
         /** Creates new form Input1 */
         private Input1() {
              initComponents();
              AutoCompleteDecorator.decorate(expField, exps, false);
         private void expFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_expFieldFocusGained
                 expField.selectAll();
          * @param args the command line arguments
         public static void main(String args[]) {
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        instance.setVisible(true);
         // Variables declaration - do not modify
         private javax.swing.JPanel contentPanel;
         private javax.swing.JTextField expField;
         // End of variables declaration
    }Edited by: simpatico_gabriele on Mar 11, 2010 8:09 PM

  • Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

    Hello everyone ... sorry for my English but I am an Italian boy with a problem that is not answered.
    I had to create a web application-service (created in Java with NetBeans 6.7) which is connected to a database postgresql (8.3.5) and for connection to the server using tomcat (3.2.4) through SOAP messages (2_2).
    OPERATING SYSTEM: WINXP
    I have created classes ... I created the database ... completed the project in NetBeans without any errors ... implemented the necessary libraries in the project (also ).... 8.3.604.jar jdbc tomcat configured and soap ... .. and set the environment variables (soap, mail, send in xerces )...... run the application on the NetBeans appears the login screen of my web service .....
    enter username and password (exactly!) and the NetBeans gives me an Exception:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at Intro.loginActionPerformed(Intro.java:522)
            at Intro.access$100(Intro.java:21)
            at Intro$2.actionPerformed(Intro.java:111)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6263)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
            at java.awt.Component.processEvent(Component.java:6028)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
            at java.awt.Container.dispatchEventImpl(Container.java:2085)
            at java.awt.Window.dispatchEventImpl(Window.java:2475)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 31 seconds)  The line 522 Intro class is as follows:
    private void loginActionPerformed(java.awt.event.ActionEvent evt) {                                     
            try {
                URL address= new URL("http://"+ip+":8080/soap/servlet/rpcrouter");
                //Costruzione della chiamata
                Call chiamata = new Call();
                chiamata.setTargetObjectURI("urn:server");
                chiamata.setMethodName("controllaAgenzia");
                chiamata.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
                //creazione parametri che dovro' passare al soap
                Vector<Parameter> params = new Vector<Parameter>();
                String u = user.getText();
                String p = String.valueOf(password.getPassword());
                params.addElement(new Parameter("user", String.class, u, null));
                params.addElement(new Parameter("password", String.class, p, null));
                chiamata.setParams(params);//parametri passati al soap
                try {
                    //Invocazione RPC
                    Response respons = chiamata.invoke(address, "");
                    //qui ho la risposta inviata dal server
                    *Parameter par = respons.getReturnValue();*
                    Object value = par.getValue();
                    String REP = String.valueOf(value);
                    System.out.println(REP);
                    if (REP.equals("ACK_agenzia")) {
                        new MainAgenzia(ip);
                        this.dispose();
                    } else if (REP.equals("NACK_agenzia")) {
                        JOptionPane.showMessageDialog(null, "I dati inseriti non sono corretti", "Errore", JOptionPane.ERROR_MESSAGE);
                        password.setText("");
                        user.setText("");
                    } The strange thing is that this web service was running just finished the project.
    After 4-5 days of its operation has stopped, creandomi this problem.
    I think the answer is, the server that is not the case.
    I thought all I thought was jdbc, but I can connect to the database, so I do not know what to do and how to proceed.
    thanks to all, and thanks to my translator. :P

    Parameter par = respons.getReturnValue();There is only one possible reason, "respons" is null.

  • Exception in thread "AWT-EventQueue-0

    I am receiving the [Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException] from my code.
    a button press triggers this exception, the thing is, the press of the button executes some xqueries and does not have any potential null variables. the variables used on the xquery are taken from a combox and are not null.
    the error message iam getting is
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at wizard.Wizard1.jButton2ActionPerformed(Wizard1.java:2915)
            at wizard.Wizard1.access$3400(Wizard1.java:54)
            at wizard.Wizard1$35.actionPerformed(Wizard1.java:2663)
            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
            at java.awt.Component.processMouseEvent(Component.java:6041)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
            at java.awt.Component.processEvent(Component.java:5806)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4413)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4243)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2440)
            at java.awt.Component.dispatchEvent(Component.java:4243)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)my code on the button is
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            try {
                String minorfunctionality;
                String majorfunctionality;
                String roomstyle;
                String floortype;
                String driver = "org.exist.xmldb.DatabaseImpl";
                Class cl = Class.forName(driver);
                Database database = (Database) cl.newInstance();
                DatabaseManager.registerDatabase(database);
                Collection col = DatabaseManager.getCollection("xmldb:exist://localhost:8080/exist/xmlrpc/db/XMLroom","admin","");          
                XPathQueryService service = (XPathQueryService) col.getService("XPathQueryService", "1.0");
                service.setProperty("indent", "yes");
                    XMLResource document = (XMLResource)col.createResource("Example 1", "XMLResource"); 
                    String path2= "C:\\Configuration\\XML_29_4_09.xml";
                    File f2 = new File(path2);
                    if(!f2.canRead()) { 
                   System.out.println("cannot read file " + path2 ); 
                   return; 
                  document.setContent(f2); 
                 System.out.print("storing document " + document.getId() + "..."); 
                   col.storeResource(document); 
                majorfunctionality = jComboBox1.getSelectedItem().toString();
                minorfunctionality = jComboBox2.getSelectedItem().toString();
                floortype = jComboBox15.getSelectedItem().toString();
                roomstyle = jComboBox3.getSelectedItem().toString();
                ResourceSet result = service.query(" update replace doc('XML_29_4_09.xml')//functionality/MajorFunctionality with <MajorFunctionality>" + majorfunctionality + "</MajorFunctionality>");
                ResourceSet result2 = service.query(" update replace doc('XML_29_4_09.xml')//functionality/MinorFunctionality with <MinorFunctionality>" + minorfunctionality + "</MinorFunctionality>");
                ResourceSet result3 = service.query(" update replace doc('XML_29_4_09.xml')//room/style with <style>" + roomstyle + "</style>");
                ResourceSet result4 = service.query(" update replace doc('XML_29_4_09.xml')//floor/material/texture with <texture>" + floortype + "</texture>");
                ResourceIterator i = result.getIterator();
                while (i.hasMoreResources()) {
                Resource r = i.nextResource();
                System.out.println((String) r.getContent());
            } catch (XMLDBException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Wizard1.class.getName()).log(Level.SEVERE, null, ex);
        }any ideas why im getting this? thank you in advance.

    ok , in line 2915
    XPathQueryService service = (XPathQueryService) col.getService("XPathQueryService", "1.0");this declaration is standard when writing an xquery.
    and col has been declared before this line
    Collection col = DatabaseManager.getCollection("xmldb:exist://localhost:8080/exist/xmlrpc/db/XMLroom","admin","");

  • Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException

    Hi gurus,
    I am using mouse event in oracle forms 10g.I am getting following error in java console when loading java applet.I am using java plugin 1.6.0_29-b02.Oracle forms version is 10.1.2.0.Kindly give me solution to overcome this.
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    Loaded image: jar:http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/frmall.jar!/oracle/forms/icons/oracle_logo.gif
    Loaded image: http://trl1th6m8k34j.trafford.ford.com:8889/forms/yes
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.0
    Loaded image: jar:http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/frmall.jar!/oracle/forms/icons/frame.gif
    Trace level set to 5: all ... completed.
    network: Cache entry not found [url: http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.class, version: null]
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.class with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/ with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.class with cookie "AFRSOComplete2011=1; WSL-credential=TZGxuU2SPlkBAPIABHVzZXJpZD1tdmlub2QAaXBhZGRyPTE5LjE1MS4xNTQuODQAYWNpZ3JvdXA9Tk9OT1ZWTQBkZXB0PTUwMDFGODlENTQAb3JnY29kZT0/AGVtcGNvZGU9RgBtcnJvbGU9TgBvcmc9QVBBAGNvbXBhbnk9Rk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAGRpdmFiYnI9QVBBAHNpdGVjb2RlPTc1MjQAY2l0eT1DSEVOTkFJAHN0YXRlPT8AY291bnRyeT1JTkQAc3ViamVjdGlkPW12aW5vZEBmb3JkLmNvbQAAAENOPXdzbHY0LWludGVybmFsAKgKrgQwd9XHGJmWswb3374C3ITXa8zKKOrGTmAp81O3ud1qjAsiquyL112PSA7FPHknAfBpgpkpCWa5AA3+3Gy906j/qh6cna01esWGot27Tf6TXQEJvxKiY81H/Hhx8xGzApYE6iEFR1g6eUjvRP1QZJhgaJw6dPfFlrxJmF6q; Ford-WSL-MIG=TZGxuU2SPllwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAG12aW5vZAAxOS4xNTEuMTU0Ljg0AE5PTk9WVk0ANTAwMUY4OUQ1NAA/AEYATgBBUEEARk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAEFQQQA3NTI0AENIRU5OQUkAPwBJTkQATlVMTC5jZW50b2tzAACvVWxUpXzzdrT6KgM5tvDc1l3mGobUxj+eOvcIt2JL3LQOyr0rnYQV1oFVkPFd7GOBoUzqgqr0Zd4Ta7KXVLIj"
    network: Cache entry not found [url: http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.properties, version: null]
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.properties with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/java/oracle/ewt/alert/resource/AlertBundle_en_GB.properties with cookie "AFRSOComplete2011=1; WSL-credential=TZGxuU2SPlkBAPIABHVzZXJpZD1tdmlub2QAaXBhZGRyPTE5LjE1MS4xNTQuODQAYWNpZ3JvdXA9Tk9OT1ZWTQBkZXB0PTUwMDFGODlENTQAb3JnY29kZT0/AGVtcGNvZGU9RgBtcnJvbGU9TgBvcmc9QVBBAGNvbXBhbnk9Rk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAGRpdmFiYnI9QVBBAHNpdGVjb2RlPTc1MjQAY2l0eT1DSEVOTkFJAHN0YXRlPT8AY291bnRyeT1JTkQAc3ViamVjdGlkPW12aW5vZEBmb3JkLmNvbQAAAENOPXdzbHY0LWludGVybmFsAKgKrgQwd9XHGJmWswb3374C3ITXa8zKKOrGTmAp81O3ud1qjAsiquyL112PSA7FPHknAfBpgpkpCWa5AA3+3Gy906j/qh6cna01esWGot27Tf6TXQEJvxKiY81H/Hhx8xGzApYE6iEFR1g6eUjvRP1QZJhgaJw6dPfFlrxJmF6q; Ford-WSL-MIG=TZGxuU2SPllwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAG12aW5vZAAxOS4xNTEuMTU0Ljg0AE5PTk9WVk0ANTAwMUY4OUQ1NAA/AEYATgBBUEEARk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAEFQQQA3NTI0AENIRU5OQUkAPwBJTkQATlVMTC5jZW50b2tzAACvVWxUpXzzdrT6KgM5tvDc1l3mGobUxj+eOvcIt2JL3LQOyr0rnYQV1oFVkPFd7GOBoUzqgqr0Zd4Ta7KXVLIj"
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/lservlet;jsessionid=13979a5422b982f5c03763394a95824eb74a032e698e with proxy=DIRECT
    network: Connecting http://trl1th6m8k34j.trafford.ford.com:8889/forms/lservlet;jsessionid=13979a5422b982f5c03763394a95824eb74a032e698e with cookie "AFRSOComplete2011=1; WSL-credential=TZGxuU2SPlkBAPIABHVzZXJpZD1tdmlub2QAaXBhZGRyPTE5LjE1MS4xNTQuODQAYWNpZ3JvdXA9Tk9OT1ZWTQBkZXB0PTUwMDFGODlENTQAb3JnY29kZT0/AGVtcGNvZGU9RgBtcnJvbGU9TgBvcmc9QVBBAGNvbXBhbnk9Rk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAGRpdmFiYnI9QVBBAHNpdGVjb2RlPTc1MjQAY2l0eT1DSEVOTkFJAHN0YXRlPT8AY291bnRyeT1JTkQAc3ViamVjdGlkPW12aW5vZEBmb3JkLmNvbQAAAENOPXdzbHY0LWludGVybmFsAKgKrgQwd9XHGJmWswb3374C3ITXa8zKKOrGTmAp81O3ud1qjAsiquyL112PSA7FPHknAfBpgpkpCWa5AA3+3Gy906j/qh6cna01esWGot27Tf6TXQEJvxKiY81H/Hhx8xGzApYE6iEFR1g6eUjvRP1QZJhgaJw6dPfFlrxJmF6q; Ford-WSL-MIG=TZGxuU2SPllwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAG12aW5vZAAxOS4xNTEuMTU0Ljg0AE5PTk9WVk0ANTAwMUY4OUQ1NAA/AEYATgBBUEEARk9SRC5CVVNJTkVTUy5TRVJWSUNFUy4tLklORElBAEFQQQA3NTI0AENIRU5OQUkAPwBJTkQATlVMTC5jZW50b2tzAACvVWxUpXzzdrT6KgM5tvDc1l3mGobUxj+eOvcIt2JL3LQOyr0rnYQV1oFVkPFd7GOBoUzqgqr0Zd4Ta7KXVLIj"
    basic: Applet started
    basic: Told clients applet is started
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at oracle.forms.fd.HandleMouseEvent2.handleComponent(HandleMouseEvent2.java:312)
         at oracle.forms.fd.HandleMouseEvent2.access$6000171(HandleMouseEvent2.java:39)
         at oracle.forms.fd.HandleMouseEvent2$2.mouseEntered(HandleMouseEvent2.java:139)
         at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseEntered(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider.processMouseGrabs(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp.mouseEntered(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Proxy.processEventImpl(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
         at oracle.forms.fd.HandleMouseEvent2.handleComponent(HandleMouseEvent2.java:312)
         at oracle.forms.fd.HandleMouseEvent2.access$6000171(HandleMouseEvent2.java:39)
         at oracle.forms.fd.HandleMouseEvent2$2.mouseExited(HandleMouseEvent2.java:135)
         at java.awt.AWTEventMulticaster.mouseExited(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseExited(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider.processMouseGrabs(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._checkTarget(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp.mouseExited(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)
         at oracle.ewt.event.tracking.GlassMouseGrabProvider$Proxy.processEventImpl(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    You need to initialize your array:
    double [][] expLevels = new double[10][10]; // whatever size.For an array of 'double', all values will be initialized to 0.
    It appears that the size of your array can't be known until runtime. You could maybe use an ArrayList of ArrayList of Double objects. Or, if you do know the size (if array_string will have a fixed format), you could use that size.

  • Exception in thread "AWT-EventQueue-0"  Invalid threat accces

    Hey,
    For my application I have created a menu in the system tray. When you click left you get some dynamic data and when you click right on my menu you get a screen to add a new dynamic menuitem to my system tray menu. but when I try to add something to that menu I get this error:
    Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid thread access
    this is my code:
    import java.awt.Frame;
    import java.awt.Dimension;
    import javax.swing.JButton;
    import java.awt.BorderLayout;
    import javax.swing.SwingConstants;
    import java.awt.event.KeyEvent;
    import java.awt.Rectangle;
    import javax.swing.JTextField;
    import javax.swing.JLabel;
    import org.eclipse.swt.*;
    import org.eclipse.swt.graphics.*;
    import org.eclipse.swt.widgets.*;
    public class Test3 extends Frame {
         private static final long serialVersionUID = 1L;
         private JButton jButton = null;
         private JTextField txtInput = null;
         private JLabel lblInput = null;
         private JLabel lblResult2 = null;
         static Display display = new Display ();
         static Shell shell = new Shell (display);  //  @jve:decl-index=0:
         static MenuItem testMi = null;
          * This method initializes jButton     
          * @return javax.swing.JButton     
         private JButton getJButton() {
              if (jButton == null) {
                   jButton = new JButton();
                   jButton.setHorizontalTextPosition(SwingConstants.CENTER);
                   jButton.setMnemonic(KeyEvent.VK_UNDEFINED);
                   jButton.setBounds(new Rectangle(504, 246, 97, 29));
                   jButton.setText("Click");
                   //jButton.setSize(0,80);
                   //jButton.addActionListener(new java.awt.event.ActionListener());
                   jButton.addMouseListener(new java.awt.event.MouseAdapter() {
                        public void mouseClicked(java.awt.event.MouseEvent e) {
                             //System.out.println("mouseClicked()"); // TODO Auto-generated Event stub mouseClicked()
                             lblResult2.setText(txtInput.getText());
                             testMi.setText("Dynamic");
                   //jButton.setRolloverEnabled(false);
                   //jButton.setPreferredSize(new Dimension(50, 10));
              return jButton;
          * This method initializes txtInput     
          * @return javax.swing.JTextField     
         private JTextField getTxtInput() {
              if (txtInput == null) {
                   txtInput = new JTextField();
                   txtInput.setBounds(new Rectangle(187, 73, 416, 22));
              return txtInput;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              Test3 application = new Test3();
              application.initialize();
              application.setVisible(true);
              Image image = new Image (display, 16, 16);
              final Tray tray = display.getSystemTray ();
              if (tray == null) {
                   System.out.println ("The system tray is not available");
              else {
                   final TrayItem item = new TrayItem (tray, SWT.NONE);
                   item.setToolTipText("SWT TrayItem");
                   item.addListener (SWT.Show, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("show");
                   item.addListener (SWT.Hide, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("hide");
                   final Menu mainMenu = new Menu (shell, SWT.POP_UP);
                   for (int i =0; i <= 3; i++){
                        MenuItem mi = new MenuItem(mainMenu, SWT.PUSH);
                        mi.setText("Main Menu Item " + i);
                        mi.setEnabled(false);
                        if (i == 3 ){
                             mi.setEnabled(true);
                             mi.setText("Exit program");
                             mi.addListener(SWT.Selection, new Listener (){
                                  public void handleEvent (Event event){
                                       System.exit(0);
                   testMi = new MenuItem(mainMenu, SWT.PUSH);
                   testMi.setText("Static text");
                   item.addListener (SWT.Selection, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("selection");
                             mainMenu.setVisible(true);
                   item.addListener (SWT.DefaultSelection, new Listener () {
                        public void handleEvent (Event event) {
                             System.out.println("default selection");
                   final Menu menu = new Menu (shell, SWT.POP_UP);
                   for (int i = 0; i < 8; i++) {
                        MenuItem mi = new MenuItem (menu, SWT.PUSH);
                        mi.setText ("Item" + i);
                        mi.addListener (SWT.Selection, new Listener () {
                             public void handleEvent (Event event) {
                                  System.out.println("selection " + event.widget);
                        if (i == 0) menu.setDefaultItem(mi);
                   item.addListener (SWT.MenuDetect, new Listener () {
                        public void handleEvent (Event event) {
                             menu.setVisible (true);
                   item.setImage (image);
              shell.setBounds(50, 50, 300, 200);
              shell.open ();
              while (!shell.isDisposed ()) {
                   if (!display.readAndDispatch ()) display.sleep ();
              image.dispose ();
              display.dispose ();
          * This is the default constructor
         public Test3() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              lblResult2 = new JLabel();
              lblResult2.setBounds(new Rectangle(16, 117, 586, 30));
              lblResult2.setText("");
              lblInput = new JLabel();
              lblInput.setBounds(new Rectangle(13, 70, 168, 26));
              lblInput.setText(" Voer een lappie text in:");
              this.setLayout(null);
              this.setSize(627, 302);
              this.setTitle("Frame");
              this.setVisible(true);
              this.add(getJButton(), null);
              this.add(getTxtInput(), null);
              this.add(lblInput, null);
              this.add(lblResult2, null);
              this.addWindowListener(new java.awt.event.WindowAdapter() {
                   public void windowClosing(java.awt.event.WindowEvent e) {
                        //lblResult2.setText("So you wanna close this window.. ;-) ");
                        System.exit(0);
    }  //  @jve:decl-index=0:visual-constraint="10,10"When you run this, you see a nice menu in the system tray..
    add some text in the screen that popup and click on save.. now you see the error.. (In this example ill try to change the static menu into a dynamic one)

    This is what I need for my application:
    - system tray menu
    - and some screens to infuence the system tray menu.. (add items to it, change setEnabled properties, etc)
    This is what I found on the Internet..
    Can you profide me (either an example or link to a page) where both is done?

  • Exception JComboox :Exception in thread "AWT-EventQueue-0" java.lang.NullPo

    Hi, I mapped a vector object to the JComboBox. I'm using the observer pattern to update the ComboBox box whenever there is an message receives.If an update is received I just add the data to the vector and to refresh the ComboBox bu calling the UpdateUI() method. When more updates received same time i'm getting the following exception.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue(BasicComboBoxUI.java:1059)
         at javax.swing.plaf.basic.BasicComboBoxUI.paint(BasicComboBoxUI.java:850)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
         at javax.swing.JComponent.paintComponent(JComponent.java:740)
         at javax.swing.JComponent.paint(JComponent.java:1003)
         at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4930)
         at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4883)
         at javax.swing.JComponent._paintImmediately(JComponent.java:4826)
         at javax.swing.JComponent.paintImmediately(JComponent.java:4633)
         at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Please assist me in fixing this issue if anyone came across this issue.
    Thanks.

    I just add the data to the vector and to refresh the ComboBox bu calling the UpdateUI() methodYou should NOT be updating the vector.
    That is NOT what the updateUI() method is used for.
    The proper way to update a component is to udate the MODEL The model will then notify the VIEW so it can repaint itself. Also, make sure the code is executed on the EDT. Read the section from the Swing tutorial on Concurrency.

  • Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError:

    hi,
    i have to build similar sql query analizer. i am using jdbc and swing.
    my frame contains jtable and jtree. jtree contains schemas and tables.
    Jtables show mysql table data, when user choose table in Jtree.
    its run first click and second.... But after a few click its doesnt run and i get this Exception:
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    at com.mysql.jdbc.Buffer.getBytes(Buffer.java:198)
    at com.mysql.jdbc.Buffer.readLenByteArray(Buffer.java:318)
    at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1345)
    at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2330)
    at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:427)
    at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2035)
    at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1421)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1772)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2430)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2359)
    at com.mysql.jdbc.Statement.executeQuery(Statement.java:1227)
    at Database.getQueryRs(Database.java:50)
    at Database.getColumnNames(Database.java:30)
    at NewJFrame.tableDegis(NewJFrame.java:221)
    at NewJFrame.jTree1ValueChanged(NewJFrame.java:196)
    at NewJFrame.access$000(NewJFrame.java:21)
    at NewJFrame$1.valueChanged(NewJFrame.java:93)
    at javax.swing.JTree.fireValueChanged(JTree.java:2825)
    at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3196)
    at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629)
    at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078)
    at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287)
    at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170)
    at javax.swing.JTree.setSelectionPath(JTree.java:1600)
    at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2410)
    at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3619)
    at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3558)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
    at java.awt.Component.processMouseEvent(Component.java:6035)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
    at java.awt.Component.processEvent(Component.java:5803)
    at java.awt.Container.processEvent(Container.java:2058)
    private void jTree1ValueChanged(javax.swing.event.TreeSelectionEvent evt) {                                   
            try{
                DefaultMutableTreeNode node = (DefaultMutableTreeNode)
                                jTree1.getLastSelectedPathComponent();
                if (node == null) return;
                if (node.isLeaf()) {
                    if(node.getLevel() > 1){
                        System.out.println(node.getParent());
                        tableDegis(node.getParent().toString(),node.toString());
                } else {
            }catch(Exception e){
    private void tableDegis(String schema,String table){
             DefaultTableModel tablemodel = new DefaultTableModel();
             tablemodel.setDataVector(db.getData(schema,table),db.getColumnNames(schema,table));
             jTable1.setModel(tablemodel);
             System.out.println(db.getColumnNames(schema,table));
             System.gc();
    public Vector getColumnNames(String schemaName,String tableName){
              Vector<String> columnNames = new Vector<String>();
              try{
                   ResultSet rs = getQueryRs(schemaName,tableName);
                 ResultSetMetaData md = rs.getMetaData();
                   int columns = md.getColumnCount();
                 for (int i = 1; i <= columns; i++)             {
                     columnNames.addElement( md.getColumnName(i) );
              }catch(Exception e){}
              System.gc();
              return columnNames;
    public ResultSet getQueryRs(String schemaName,String tableName){
              ResultSet rs = null;
              try{
                   String sql = "Select * from "+tableName;
                            connection.setCatalog(schemaName);
                            Statement stmt3 = connection.createStatement();
                            rs = stmt3.executeQuery( sql );
              }catch(Exception e){
              System.gc();
              return rs;
    public Vector getData(String schemaName,String tableName){
            Vector<Vector<Object>> data = new Vector<Vector<Object>>();
              try{   
                        ResultSet rs = getQueryRs(schemaName,tableName);
                        ResultSetMetaData md = rs.getMetaData();
                        int columns = md.getColumnCount();
                        while (rs.next()){
                      Vector<Object> row = new Vector<Object>(columns);
                            for (int i = 1; i <= columns; i++){
                                row.addElement( rs.getObject(i) );
                            data.addElement( row );
              }catch(Exception e){}
              System.gc();
              return data;
         }

    lokesh_Kumar_Singh
    Welcome to the forum. Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this thread now. It's more than 1½ years old.
    db

  • Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:

    Could anyone please explain me what is this error about
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Integer
    at timetablegen.MainFrame.jButton17ActionPerformed(MainFrame.java:1816)
    at timetablegen.MainFrame.access$2100(MainFrame.java:16)
    at timetablegen.MainFrame$23.actionPerformed(MainFrame.java:1136)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    I am taking an object from jComboBox as a String and then converting it to integer & adding to the database.
    It is not getting added in database to & throwing above exception.

    Hello,
    First parse the string taken from combo box using Integer.parseInt(str), not directly cast it to Integer.
    Regards

  • ASDM Error : Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: ...

    I am receiving an exception error when launching ASDM. I have see on the web (and have experienced an issue similar to this before) where a reload resolves the issue. However, I did issue a reload and the error continues. Strange thing is, when I look at the uptime in SH TECH-SUPPORT it shows over a year . Now this firewall is on an active/passive cluster, so my question is, did the reload work on just one and the other took over and so a reload actually did not occur?
    We have an issue going on right now where it would be extremely helpful to have this console working.
    Thanks In Advance.
    JT                 
    Using JRE version 1.4.2 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\User
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    m:   print memory usage
    q:   hide console
    s:   dump system properties
    ASDM Application Logging Started at Tue Apr 09 09:45:02 PDT 2013
    Local DM Launcher Version = 1.5.22
    Local DM Launcher Version Display = 1.5(22)
    OK button clicked
    Cache location = C:/Documents and Settings/User/.asdm/cache
    Checking the DM Launcher Version; url = https://10.1.1.1/admin/
    Server DM Version = 6.0(2)
    Server DM Launcher Version = 1.5.22, size = 318464 bytes
    DM Launcher version checking is successful.
    invoking SGZ Loader..
    java.lang.NumberFormatException: For input string: "1 year 16"
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at com.cisco.pdm.Check.h(DashoA10*..:1339)
    at com.cisco.pdm.Check.c(DashoA10*..:842)
    at com.cisco.pdm.Check.a(DashoA10*..:442)
    at com.cisco.pdm.Check.<init>(DashoA10*..:221)
    at com.cisco.pdm.PDMApplet.start(DashoA10*..:124)
    at com.cisco.nm.dice.loader.r.run(DashoA19*..:410)

    Hello Jason,
    It could actually be that you reloaded the primary ASA and you are now looking at the secondary(now active) ASA.
    do a "show version" and  "fail exec mate sho ver" to see the up time for both active and standby ASAs.
    You can also try switching to the primary (now standby ASA) using the command "no failover active" and try to access the ASDM again.
    Regards,
    Felipe

  • Is there any significance to the thread "AWT-EventQueue-0"

    I just got an exception "java.lang.ArrayIndexOutOfBoundsException: 3" but It didn't give me any lines of code that it said the error was thrown. Its a long program, and I have no Idea where it is so I'll just post the exception:
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3
         at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
         at javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
         at javax.swing.JComponent.getPreferredSize(Unknown Source)
         at java.awt.FlowLayout.layoutContainer(Unknown Source)
         at java.awt.Container.layout(Unknown Source)
         at java.awt.Container.doLayout(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validateTree(Unknown Source)
         at java.awt.Container.validate(Unknown Source)
         at javax.swing.RepaintManager.validateInvalidComponents(Unknown Source)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    It seems you have added an swing object to your gui but you have not instantiated it before adding it.
    Make sure you use something like JButton jBtn = new JButton("click"); I mean using the keyword new before adding to the gui.
    There is also a chance that you use array of object and you missed to instantiate some of them before use
    JButton jBtnArray[] = new JButton[10];
    for (int i=0; i<10; i++){
        jBtnArray[i] = new JButton(String.valueOf(i));
    }You can also check if your actionlistener is added correctly.

  • Error thread java : problem with the function "resume 0x***"  (forum sun)

    One problem with the function of jdb occured when I tried to use it to
    pilot the processor with differents threads. In fact, I use a simple example with 2 threads.
    I stop the two threads with two breakpoint, and I want to resume one or the other (with the function "resume 0x****"), the one wich I resumed stop again on the breackpoint and I decide again to resume one or the other. All of that to obtain a tree of execution.
    I give you the code of the class and the code of jdb.
    CLASS: (it's just a object Room with a variable degre that I increment and decrement with two threads increase and decrease)
    public class Test{
         public static void main(String[] args){
              Room r = new Room();
              decrease de = new decrease(r);
              increase in = new increase(r);
              de.start();
              in.start();
    class Room {
         private volatile int degre=20;
         public void more(){
         degre += 4;
         public void less(){      
         degre -= 3;
    class decrease extends Thread{
    private Room room;
    public decrease(Room r){
              room =r;
    public void run(){
    try{ 
         while (!interrupted()){ 
              room.less();
    catch(InterruptedException e) {}
    class increase extends Thread{
    private Room room;
    public increase(Room r){
         room =r;
    public void run(){ 
         try{ 
              while (!interrupted()){
                   room.more();
    catch(InterruptedException e) {}
    JDB:
    Initializing jdb ...
    stop at Test:7Deferring breakpoint Test:7.
    It will be set after the class is loaded.
    runrun Test
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Test:7
    Breakpoint hit: "thread=main", Test.main(), line=7 bci=30
    7 in.start();
    main[1] stop at room:16
    Set breakpoint room:16
    main[1] stop at room:20
    Set breakpoint room:20
    main[1] resume
    All threads resumed.
    >
    Breakpoint hit: "thread=Thread-0", room.less(), line=20 bci=0
    20 degre -= 3;
    Thread-0[1] threads
    Group system:
    (java.lang.ref.Reference$ReferenceHandler)0x10d Reference Handler cond. waiting
    (java.lang.ref.Finalizer$FinalizerThread)0x10c Finalizer cond. waiting
    (java.lang.Thread)0x10b Signal Dispatcher running
    Group main:
    (decrease)0x146 Thread-0 running (at breakpoint)
    (increase)0x147 Thread-1 running (at breakpoint)
    (java.lang.Thread)0x148 DestroyJavaVM running
    Thread-0[1] resume 0x147
    Thread-0[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] print degre
    degre = 24
    Thread-1[1] resume 0x146 //It's here the problem, thread 0x146 have to stop on the //next breakpoint of decrease but nothing happen
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] clear
    Breakpoints set:
    breakpoint Test:7
    breakpoint room:16
    breakpoint room:20
    PS: I tried many other examples with other class and other kind of breakpoints, but, in any cases, on thread doesn't manage to resume. When I try with general resume (no specification of the thread), It works but it isn't interresting for me because I want to decide wich thread continue his execution.

    Hi,
    I have read the FAQ of the JMF.
    The problem was the jar files of the JMF were not in the JRE\BIN\EXT
    folder of the Java runtime!
    now it works!
    thanks
    Reg

  • Problem with 'GetType' Function calling in MSVC++

    Hello
    I have problem with the function in TestStand API .
    When I call the function " GetType " with the following statements in
    a DLL called from TestStand (NI) implemented in MS VC ++
    , it does not work and this exception is caught by the ONLY ' try catch ' block
    to catch exceptions in TestStand API giving the error message
    " Unexpected operating system error".
    VARIANT_BOOL ok;
    VARIANT_BOOL hi;
    BSTR Name;
    PropertyObject *property = (*step_)->AsPropertyObject();
    ( *step_ is a STEP Object of type Step* *step_ )
    property = property->GetPropertyObject( "TS.SData", 0);
    enum TS:ropertyValueTypes i = property->GetType( "" , 0 , &hi , &ok
    , &Name);//Problem
    Please solve my problem.
    You can email me at [email protected]
    Thankyou very much.
    Best regards
    Fahad Ejaz

    Hello,
    The problem is that the Name is not initialized (the BSTR is defined as OLECHAR*). Thus, replace the
    BSTR Name;
    declaration with the following lines:
    char buf[1024];
    BSTR Name = _bstr_t(buf);
    This should solve the problem.
    Best Regards,
    Silvius
    Silvius Iancu

  • Problem with BAPI_SALESORDER_CHANGE function module

    I know lot of posts have been done about problems with this function module. However I was not able to find the answer to my problem. Hence posting a new thread
    I have the following code which changes the reason rejection (if required to 'ZF') and also updates the sales order quantity.
    The code works absolutely fine as long as the PGI date of the order item is either today or in the future. However if the PGI date of the order item is in the past. I get an error in the t_return table with error type 'E' saying 'PGI date is in the past hence could not update the item'.
    If I try to update the same order quantity in VA02 for the item with PGI date in the past it does so without any problem.
    Can someone please suggest what the problem might be. Or if there is some other way I can update the quantity. (I dont want to use BDC)
    FORM change_sales_order_item USING value(r_rtb_posnrs) TYPE zpsd_ztsdrtb_ro_track
                                 CHANGING r_return TYPE type_t_bapiret2.
      DATA: v_order_header_in TYPE bapisdh1,
      v_order_header_inx TYPE bapisdh1x,
      t_schedule_lines TYPE bapischdl OCCURS 0 WITH HEADER LINE,
      t_schedule_linesx TYPE bapischdlx OCCURS 0 WITH HEADER LINE,
      v_temp_rtb_vbeln TYPE vbeln,
      v_temp_rtb_posnr TYPE posnr,
      wa_old_rtb_posnrs TYPE ztsdrtb_ro_track,
      t_item_in TYPE bapisditm OCCURS 0 WITH HEADER LINE,
      t_item_inx TYPE bapisditmx OCCURS 0 WITH HEADER LINE,
      v_rtb_old_vbeln TYPE zrtbvbeln,
      v_rtb_old_posnr TYPE zrtbposnr,
      v_ro_old_vbeln TYPE zrovbeln,
      v_ro_old_posnr TYPE zroposnr,
      v_rtb_count TYPE i,
      v_next_row_index TYPE i,
      v_update_order_flg TYPE char1, "Update the sales order flag
      v_rtb_record_counter TYPE i,
      v_original_vbeln TYPE vbeln,
      t_bapiret TYPE STANDARD TABLE OF bapiret2.
      FIELD-SYMBOLS: <wa_r_rtb_posnrs> TYPE ztsdrtb_ro_track,
                     <wa_r_rtb_posnr_next> TYPE ztsdrtb_ro_track.
      CONSTANTS: c_updateflag TYPE bapisditmx-updateflag VALUE 'U'.
      v_order_header_inx-updateflag = 'U'.
    Get rid of the duplicate records for the same RTB order. Just use
    the last record quantity in the internal table
      LOOP AT r_rtb_posnrs ASSIGNING <wa_r_rtb_posnrs>.
        v_rtb_record_counter = v_rtb_record_counter + 1.
        <wa_r_rtb_posnrs>-seqnr = v_rtb_record_counter.
      ENDLOOP.
      SORT r_rtb_posnrs DESCENDING BY zrtbvbeln zrtbposnr seqnr zrtbconsumedflg.
      DELETE ADJACENT DUPLICATES FROM r_rtb_posnrs COMPARING zrtbvbeln zrtbposnr.
      DESCRIBE TABLE r_rtb_posnrs LINES v_rtb_count.
      v_rtb_record_counter = 0.
      v_update_order_flg = space.
      LOOP AT r_rtb_posnrs ASSIGNING <wa_r_rtb_posnrs>.
        v_rtb_record_counter = v_rtb_record_counter + 1.
        v_update_order_flg = space.
    Popluate the item quantity update flags for schedule lines
        t_schedule_linesx-itm_number = <wa_r_rtb_posnrs>-zrtbposnr.
        t_schedule_linesx-sched_line = '0001'.
        t_schedule_linesx-updateflag = c_updateflag.
        t_schedule_linesx-req_qty = 'X'.
        APPEND t_schedule_linesx.
        CLEAR t_schedule_linesx.
    *Item (Order QQuantity Field to be changed "KWMENG")
        t_schedule_lines-itm_number = <wa_r_rtb_posnrs>-zrtbposnr.
        t_schedule_lines-sched_line = '0001'.
        t_schedule_lines-req_qty = <wa_r_rtb_posnrs>-zrtbchgqty.
        APPEND t_schedule_lines.
        CLEAR t_schedule_lines.
    If fully consumed then set the rejection flag
        IF <wa_r_rtb_posnrs>-zrtbconsumedflg = 'X'.
          t_item_inx-itm_number = <wa_r_rtb_posnrs>-zrtbposnr.
          t_item_inx-updateflag = 'X'.
          t_item_inx-reason_rej = 'X'.
          APPEND t_item_inx.
          CLEAR t_item_inx.
          t_item_in-itm_number = <wa_r_rtb_posnrs>-zrtbposnr.
          t_item_in-reason_rej = 'ZF'.
          APPEND t_item_in.
          CLEAR t_item_in.
        ELSE.
          t_item_inx-itm_number = <wa_r_rtb_posnrs>-zrtbposnr.
          t_item_inx-updateflag = 'X'.
          t_item_inx-reason_rej = 'X'.
          APPEND t_item_inx.
          CLEAR t_item_inx.
          t_item_in-itm_number = <wa_r_rtb_posnrs>-zrtbposnr.
          t_item_in-reason_rej = ' '.
          APPEND t_item_in.
          CLEAR t_item_in.
        ENDIF.
    If you have reached the last line of the RTB intern table update the sales order
    *Index pointing to the next row
        v_next_row_index = v_rtb_record_counter + 1.
        IF v_rtb_record_counter = v_rtb_count.
          v_update_order_flg = 'X'.
        ELSEIF v_rtb_record_counter < v_rtb_count.
    Get the next row data
          READ TABLE r_rtb_posnrs INDEX v_next_row_index ASSIGNING <wa_r_rtb_posnr_next>.
          IF sy-subrc = 0.
            IF <wa_r_rtb_posnrs>-zrtbvbeln <> <wa_r_rtb_posnr_next>-zrtbvbeln.
              v_update_order_flg = 'X'.
            ENDIF.
          ENDIF.
        ELSE.
          v_update_order_flg = space.
        ENDIF.
    update the rtb orders with quantities and the rejection flag (if required)
        IF v_update_order_flg = 'X'.
          CALL FUNCTION 'BAPI_SALESORDER_CHANGE' STARTING NEW TASK 'SOUPDATE'
            PERFORMING callbk_bapi_salesorder_change ON END OF TASK
            EXPORTING
              salesdocument    = <wa_r_rtb_posnrs>-zrtbvbeln
              order_header_in  = v_order_header_in
              order_header_inx = v_order_header_inx
            TABLES
              return           = t_return
              schedule_lines   = t_schedule_lines
              schedule_linesx  = t_schedule_linesx
              order_item_in    = t_item_in
              order_item_inx   = t_item_inx.
          WAIT UNTIL t_return[] IS NOT INITIAL.
          READ TABLE t_return INTO wa_return WITH KEY type = 'E'.
          IF sy-subrc <> 0.
          ELSE.
            r_return[] = t_return[].
            MESSAGE ID 'ZSD' TYPE 'E' NUMBER 613.
           RAISE errorinorderupdate.
          ENDIF.
          REFRESH t_schedule_linesx.
          REFRESH t_schedule_lines.
          REFRESH t_item_in.
          REFRESH t_item_inx.
          REFRESH t_return.
        ENDIF.
      ENDLOOP.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       IMPORTING
         return = t_bapiret.
    ENDFORM.                    "Change_Sales_Order

    see the following example and try to do this:
    i_hdrx-updateflag = 'U'.
    *" Fill required SCHEDULE_LINES data.
    i_sched-itm_number = p_posnr.
    i_sched-sched_line = p_etenr.
    i_sched-req_qty = p_reqqty.
    i_schedx-updateflag = 'U'.
    i_schedx-itm_number = p_posnr.
    i_schedx-sched_line = p_etenr.
    i_schedx-req_qty = 'X'.
    APPEND i_sched.
    APPEND i_schedx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = p_vbeln
    order_header_in = i_hdr
    order_header_inx = i_hdrx
    TABLES
    return = i_ret
    schedule_lines = i_sched
    schedule_linesx = i_schedx.

  • Problem with CONTAINS function

    Hi all!!
    i got a problem with contains function. i'm running oracle 11g.
    if i execute this query:
    SELECT x.lid as id,  x.sztitular as titular, e.szname as proName, x.szresumen  as resumen, b.sztitle  as catName,
    f.szname  as secName, d.szname  as cliName, x.datecreation as datecreation
    FROM CPR_PRACTICAL_CASE x,ctg_category b, CPR_CLIENT d, pro_product e, CAT_SECTOR f, CPR_PCASE_PRODUCT g, CPR_PCASE_SECTOR h,
    PRO_PRODUCTCATEGORY i WHERE  x.lid = g.lpcaseid and e.lid = g.lproductid and x.lid = h.lpcaseid
    and f.lid = h.lsectorid and x.lclientid = d.lid and i.lproductid = e.lid and  b.lid = i.lcategoryid
    AND x.szlocale = 'es-ES' AND  x.bavailable = '1'i get 1 row as result with the column sztitular = "rodillos de medidas"
    if i only add one more sentece to that query:
    AND CONTAINS( x.sztitular, 'rodillos',1) >0the query returns an empty set.. i really don't understand why because the term "rodillos" is present in the row's column called "sztitular"...
    i've put an index on that column:
    create index ITXT_TITULAR on CPR_PRACTICAL_CASE(sztitular) INDEXTYPE IS CTXSYS.CONTEXT;any help?
    many thanks!!!!
    Edited by: ElMazzaX on May 21, 2012 5:51 PM
    Edited by: ElMazzaX on May 21, 2012 5:53 PM

    How are you synchronising the index?
    http://docs.oracle.com/cd/E11882_01/text.112/e24435/ind.htm#i1008452
    Also see the Oracle Text forum:
    Text

Maybe you are looking for

  • File Open Dialog Box  on Button Click

    Hi I am devloping some webpages using JSF and RichFaces.. I would like to appear File open Dialog box to choose single file and multiple files and another Folder chooser dialog box to choose the folder content.. Both the operation should be performed

  • Mapping with only Outputs, no Target table?

    Is it technically possible in OWB to have a Mapping whose output is stremed to the OUTPUT PARAMETER object instead of a Table? I would love to have something like that so that I could convert function into Mappings with Input and Output parameters an

  • Order of photos in slideshow

    Hi From a slideshow in iPhoto with a theme and music from iTunes, I have successfully published it into iWeb. But. The order of the photos is different from the source file that I can view from the iWeb menu and from finder. I wish for the first phot

  • Vendor info change (XK02/MK02) investigation

    Hi! Security Experts, We have an issue where vendor information was changed by multiple user-ids, and the corresponding actual users are saying they have not changed. The user-ids used to change the info don't have access to MK02/XK02 at S_TCODE leve

  • Cannot place eps file "no filter found for requested operation"

    I have two compuers running CS3. One computer can place .eps files into an InDesign document with no problem. The other computer tries to place an .eps file into InDesign and they get "no filter found for requested operation." It is able to place .jp