Strange recursion

Hi all
I am trying to understand from where V$SESSION_WAIT_CLASS takes its data:
sql> select * from dba_synonyms where synonym_name = upper('v$session_wait_class')
OWNER SYNONYM_NAME
TABLE_OWNER TABLE_NAME
DB_LINK
PUBLIC V$SESSION_WAIT_CLASS
SYS V_$SESSION_WAIT_CLASS
sql> select text from dba_views where view_name = 'V_$SESSION_WAIT_CLASS' and owner = 'SYS';
TEXT
select "SID","SERIAL#","WAIT_CLASS_ID","WAIT_CLASS#","WAIT_CLASS","TOTAL_WAITS", "TIME_WAITED" from v$session_wait_class
it seems like v$session_wait_class is a public synonym for SYS.V_$SESSION_WAIT_CLASS which is a view selecting from v$session_wait_class again.
I don't understand how it can be, any do ?
Thanks,
Avishai

SQL> SELECT view_definition FROM v$fixed_view_definition
  2* WHERE view_name='V$SESSION_WAIT_CLASS'
SQL> /
VIEW_DEFINITION
select sid,serial#,wait_class_id, wait_class#,wait_class,total_waits, time_waite
d from gv$session_wait_class where inst_id = USERENV('Instance')
SQL> SELECT view_definition FROM v$fixed_view_definition
  2* WHERE view_name='GV$SESSION_WAIT_CLASS'
SQL> /
VIEW_DEFINITION
select s.inst_id, s.kslcssid, s.kslcsser, s.kslcsclsid, s.kslcscls,  s.kslcsclsn
ame, s.kslcswts, round(s.kslcstim / 10000) from x$kslcs s  where s.kslcswts != 0
SQL>                                                                        

Similar Messages

  • Small recursive function, strange bash result...

    Today I was speaking with a friend about bash scripts and while speaking I wrote this:
    #!/bin/bash
    function div {
    diff=$(($2 - $1))
    if test $diff -le 5 ;then
    echo $1 $2
    else
    half=$(( ($1 + $2) / 2))
    div $1 $half
    div $half $2
    fi
    div 1 30
    Just to show that recursion works. Unfortunately, the output proved me wrong:
    1 4
    4 8
    4 9
    9 12
    12 15
    12 16
    16 21
    16 19
    19 23
    19 24
    24 27
    27 30
    Confused I wrote this C program:
    void div(int b, int e) {
    if ((e-b) <= 5) {
    printf("%d %d\n", b, e);
    else {
    int half = (b + e) / 2;
    div(b, half);
    div(half, e);
    int main() {
    div(1,30);
    and the output was the expected:
    1 4
    4 8
    8 11
    11 15
    15 18
    18 22
    22 26
    26 30
    Obviously I ignore something about bash... can anyone help me understand the outputs difference?

    Xyne wrote:
    ezzetabi wrote:Thanks a lot! New lesson today: use ( ) in recursive calls in bash!
    tomorrow's lesson: don't use recursive calls in bash
    the day after tomorrow's lesson: don't use bash
    +1.  Using a subshell will generally actually create a new process, which is about the least efficient stack implementation I can think of.

  • ORA-00604: error occurred at recursive SQL when calling proc via db_link

    Hi,
    I'm on 9.2.0.8 and got strange issue with simple test case
    on source db:
    CREATE OR REPLACE PROCEDURE ADMIN.gg_ref(out_tokens OUT SYS_REFCURSOR) is
      BEGIN
      OPEN out_tokens for select dummy from dual;
    END ;
    Now testing code localy:
    SQL> var r refcursor
    SQL> declare
      2   output sys_refcursor;
      3  begin
      4   adminx.gg_ref(output);
      5  :r:=output;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> print r
    D
    X
    So its working.
    I've got db_link to that db , and now call that proc via dblink from other 9.2.0.8 DB:
    var r refcursor
      1  declare
      2   output sys_refcursor;
      3  begin
      4   admin.gg_ref@LINK_NAME(output);
      5  :r:=output;
      6* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00900: invalid SQL statementWhats wrong with my code ?
    Are there any restriction I'm not aware of ?
    Regards
    GregG

    GregG wrote:
    What should my code look like now ?
    Should I rewrite this as function returning index by collection or something ?You can use DBMS_SQL - but use the remote package and not the local one. This is a little bit more complex ito call interface than using a ref cursor, but is the very same thing on the server side. DBMS_SQL also provides a more comprehensive set of features than using the ref cursor interface.
    The main issue though is additional coding - as DBMS_SQL is a lower level interface (a lot closer to the real Oracle Call Interface/OCI):
    --// on remote database the procedure returns a DBMS_SQL cursor instead of a ref cursor
    SQL> create or replace procedure FooProc( cur in out number, deptID number ) is
      2          rc      number;
      3  begin
      4          cur := DBMS_SQL.open_cursor;
      5 
      6          DBMS_SQL.parse(
      7                  cur,
      8                  'select ename from emp where deptno = :deptID',
      9                  DBMS_SQL.native
    10          );
    11 
    12          DBMS_SQL.Bind_Variable( cur, 'deptID', deptID );
    13 
    14          rc := DBMS_SQL.Execute( cur );
    15  end;
    16  /
    Procedure created.
    --// from the local database side we call this remote proc
    SQL> declare
      2          c               number;  --// instead of using sys_refcursor
      3          empName         varchar2(10); --// buffer to fetch column into
      4  begin
      5          FooProc@testdb( c, 10 );  --/ call the proc that creates the cursor
      6 
      7          --// we need to define our fetch buffer for the 1st column in the
      8          --// SQL projection of that cursor (10 byte fetch buffer for 1st column)
      9          DBMS_SQL.define_column@testdb( c, 1, empName, 10 );
    10 
    11          --// we now fetch from this cursor, but via the DBMS_SQL
    12          --// interface
    13          loop
    14                  --// fetch the row (exit when 0 rows are fetched)
    15                  exit when DBMS_SQL.Fetch_Rows@testdb( c ) = 0;
    16 
    17                  --// copy value of 1st column in row into the local PL/SQL buffer
    18                  DBMS_SQL.column_value@testdb( c, 1, empName );
    19 
    20                  --// record value it via dbms output
    21                  DBMS_OUTPUT.put_line( 'name='||empName||' deptID=10' );
    22          end loop;
    23 
    24          --// close it explicitly as you would a ref cursor
    25          DBMS_SQL.Close_Cursor@testdb( c );
    26  end;
    27  /
    name=CLARK deptID=10
    name=KING deptID=10
    name=MILLER deptID=10
    PL/SQL procedure successfully completed.
    SQL>

  • A strange file in home directory

    Hi
    Something is creating a strange file in my home direcotry:
    http://s2.postimg.org/drgqt0c3t/shot.png
    Can anyone tell me that? how can I track that which app is creating that file?
    And, how can I prevent creation of this file in the future?
    Regards
    Last edited by zetrotrack000 (2013-09-02 15:42:11)

    kaszak696 wrote:Does that file have any contents that would help identify it? Also, could you provide more info about your setup? What processes and services you have running etc. If you can, upload the entire output of lsof +d $HOME or lsof +D $HOME , don't remember which one is non-recursive.
    Here is the output of 'lsof +d $HOME':
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    startkde 308 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    startkde 308 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    startkde 308 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kdeinit4 366 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kdeinit4 366 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kdeinit4 366 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    klauncher 367 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    klauncher 367 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    klauncher 367 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kded4 369 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kded4 369 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kded4 369 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kglobalac 380 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kglobalac 380 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kglobalac 380 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kactivity 385 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kactivity 385 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kactivity 385 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kwrapper4 394 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kwrapper4 394 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kwrapper4 394 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    ksmserver 396 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    ksmserver 396 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    ksmserver 396 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kwin 461 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kwin 461 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kwin 461 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    knotify4 463 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    knotify4 463 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    knotify4 463 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    plasma-de 468 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    plasma-de 468 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    plasma-de 468 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    ksysguard 498 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kio_deskt 503 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kio_deskt 503 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kio_deskt 503 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kio_trash 504 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kio_trash 504 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kio_trash 504 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kio_file 507 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kio_file 507 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kio_file 507 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    krunner 515 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    krunner 515 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    krunner 515 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukse 517 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    nepomukse 517 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukse 517 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukst 520 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    nepomukst 520 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukst 520 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    thunderbi 525 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    thunderbi 525 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    thunderbi 525 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    CopyAgent 528 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    CopyAgent 528 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    CopyAgent 528 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    polkit-kd 537 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    polkit-kd 537 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    polkit-kd 537 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kmix 539 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kmix 539 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kmix 539 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    konsole 541 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    konsole 541 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    konsole 541 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    bash 558 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kio_trash 613 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    kio_trash 613 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    kio_trash 613 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukfi 616 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    nepomukfi 616 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukfi 616 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukfi 617 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    nepomukfi 617 zetro 1w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    nepomukfi 617 zetro 2w REG 8,6 13974 14942277 /home/zetro/.xsession-errors
    lsof 627 zetro cwd DIR 8,6 4096 14942209 /home/zetro
    lsof 627 zetro 1w REG 8,6 0 14950316 /home/zetro/lsof_output
    lsof 628 zetro cwd DIR 8,6 4096 14942209 /home/zetro

  • 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()) {...}

  • FABridge - Error: You are trying to call recursively into the Flash Player [...]

    I'm using FABridge to communicate between JS (and GWT) and a flex component I've written, but I've run into a strange error:
    You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.
    I know what the error means, but what I don't understand is why I'm only receiving this error when I run the application locally (127.0.0.1) in this one webapp.
    Once I upload the app to the remote testing server, the error goes away and the app functions as it should.  I've tried to use setTimeout without any luck.
    I thought this might be a crossdomain problem so I set Security.allowDomain("*") in flex and the same on the testing server via a crossdomain.xml file but this did nothing.
    The function that is being called takes a parameter (image or an image wrapped in swf file) via the querystring and adds it to the stage.  The files all exist on the remote server.
    Another strange part is that when I run the flex app via Flash Builder it behaves fine. Also, I've run the component as part of a separate project locally without issue.
    The problem only exists when I run the component as part of the this project, when I'm working on it locally.  I even have another local app using the same component that works fine.
    I'm at a loss.  Any ideas?

    Ok, I was excited when I noticed I didn't change allowscriptaccess, but that didn't work. 
    Just to recap:
    -I have Security.allowDomain("*") as the first line in the init() (creationComplete) function
    -I have a crossdomain.xml file located on the remote server that allows="*" and ports="*" (because gwt debugs through :8888)
    -allowscriptaccess is set to always
    -I am using FABridge to communicate between JS and the swf.  Calling the function directly from Firebug causes the same error. 
    Even trying to call a function that is completely unrelated to the remote domain produces the same error.  For example, getAppHeight().  So at second glance, this doesn't seem to be a security issue?
    The only post (Google Cache) about the error suggests I use FABridge.MethodsToCallLater which doesn't seem to exist anymore in the version of FABridge that I downloaded.  The copy of FABridge I have doesn't have any version information in the file, but I believe I pulled it from the Flex 3 SDK. 
    Can anyone tell me if that feature has been removed/added in recent versions?  Or any other insights into my current situation?  Thanks for looking!

  • Strange CBO choice

    Hi guys,
    I'm runing some tests to check weather processed_flag should have NULL for already processed values or not. I thought that having a smaller index on the processed_flag column should be better.
    Check the following example:
    CREATE TABLE processed_flag_not_null AS
    SELECT LEVEL id,
           lpad('A', 10, 'A') VALUE,
           CASE
             WHEN MOD(LEVEL, 100) = 0 THEN
              0
             ELSE
              1
           END processed_flag
      FROM dual
    CONNECT BY LEVEL <= 1000000;
    CREATE INDEX IDX_PROCESSED_FLAG_NOT_NULL ON PROCESSED_FLAG_NOT_NULL (PROCESSED_FLAG);
    CREATE TABLE processed_flag_null AS
    SELECT LEVEL id,
           lpad('A', 10, 'A') VALUE,
           CASE
             WHEN MOD(LEVEL, 100) = 0 THEN
              0
           END processed_flag
      FROM dual
    CONNECT BY LEVEL <= 1000000;
    CREATE INDEX IDX_PROCESSED_FLAG_NULL ON PROCESSED_FLAG_NULL (PROCESSED_FLAG);
    BEGIN
      dbms_stats.gather_table_stats(USER, 'PROCESSED_FLAG_NOT_NULL', cascade => TRUE);
      dbms_stats.gather_table_stats(USER, 'PROCESSED_FLAG_NULL', cascade => TRUE);
    END;The first strange thing I've found was in all_tab_histograms:
    SELECT *
      FROM all_tab_histograms
    WHERE table_name IN ('PROCESSED_FLAG_NOT_NULL', 'PROCESSED_FLAG_NULL')
       AND column_name = 'PROCESSED_FLAG'
    ORDER BY 2,4;
    TABLE_NAME     COLUMN_NAME     ENDPOINT_NUMBER     ENDPOINT_VALUE
    PROCESSED_FLAG_NOT_NULL     PROCESSED_FLAG     0     0
    PROCESSED_FLAG_NOT_NULL     PROCESSED_FLAG     1     1
    PROCESSED_FLAG_NULL     PROCESSED_FLAG     0     0
    PROCESSED_FLAG_NULL     PROCESSED_FLAG     1     0Only after running queries against both tables with ("where processed_flag = 0") and gathering table stats again I get the following histograms:
    TABLE_NAME                     COLUMN_NAME     ENDPOINT_NUMBER     ENDPOINT_VALUE
    PROCESSED_FLAG_NOT_NULL     PROCESSED_FLAG     59                     0
    PROCESSED_FLAG_NOT_NULL     PROCESSED_FLAG     5598                     1
    PROCESSED_FLAG_NULL     PROCESSED_FLAG     10000                     0Can someone explain to me this behaviour?
    Now for the main question, I don't understand why the CBO chooses an Index Range Scan for the PROCESSED_FLAG_NOT_NULL table, and a Full Table Scan for the PROCESSED_FLAG_NULL:
    SQL> set timing on
    SQL> set autotrace traceonly
    SQL> SELECT *
      2    FROM processed_flag_not_null
      3   WHERE processed_flag = 0;
    10000 rows selected.
    Elapsed: 00:00:00.20
    Execution Plan
    Plan hash value: 3652560023
    | Id  | Operation                   | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                             | 10539 |   195K|    93   (0)| 00:00:02 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| PROCESSED_FLAG_NOT_NULL     | 10539 |   195K|    93   (0)| 00:00:02 |
    |*  2 |   INDEX RANGE SCAN          | IDX_PROCESSED_FLAG_NOT_NULL | 10539 |  |    23   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("PROCESSED_FLAG"=0)
    Statistics
              1  recursive calls
              0  db block gets
           4444  consistent gets
              0  physical reads
              0  redo size
         306954  bytes sent via SQL*Net to client
           7745  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          10000  rows processed
    SQL> SELECT *
      2    FROM processed_flag_null
      3   WHERE processed_flag = 0;
    10000 rows selected.
    Elapsed: 00:00:00.22
    Execution Plan
    Plan hash value: 1150676937
    | Id  | Operation         | Name                | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |                     | 10000 |   166K|   802   (2)| 00:00:10 |
    |*  1 |  TABLE ACCESS FULL| PROCESSED_FLAG_NULL | 10000 |   166K|   802   (2)| 00:00:10 |
    Predicate Information (identified by operation id):
       1 - filter("PROCESSED_FLAG"=0)
    Statistics
              1  recursive calls
              0  db block gets
           3571  consistent gets
              0  physical reads
              0  redo size
         174974  bytes sent via SQL*Net to client
           7745  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          10000  rows processedIf I compare both aproaches using Runstats:
    BEGIN
      runstats_pkg.rs_start;
      BEGIN
        FOR i IN 1 .. 1000
        LOOP
          FOR x IN (SELECT *
                      FROM processed_flag_not_null
                     WHERE processed_flag = 0)
          LOOP
            NULL;
          END LOOP;
        END LOOP;
      END;
      runstats_pkg.rs_middle;
      BEGIN
        FOR i IN 1 .. 1000
        LOOP
          FOR x IN (SELECT *
                      FROM processed_flag_null
                     WHERE processed_flag = 0)
          LOOP
            NULL;
          END LOOP;
        END LOOP;
      END;
      runstats_pkg.rs_stop;
    END;
    -- Output
    Run1 ran in 4295 hsecs
    Run2 ran in 5123 hsecs
    run 1 ran in 83.84% of the timeIf I compare the processed_flag_null without hints versus processed_flag_null with index hint this are the results:
    BEGIN
      runstats_pkg.rs_start;
      BEGIN
        FOR i IN 1 .. 1000
        LOOP
          FOR x IN (SELECT *
                      FROM processed_flag_null
                     WHERE processed_flag = 0)
          LOOP
            NULL;
          END LOOP;
        END LOOP;
      END;
      runstats_pkg.rs_middle;
      BEGIN
        FOR i IN 1 .. 1000
        LOOP
          FOR x IN (SELECT /*+ index(processed_flag_null IDX_PROCESSED_FLAG_NULL) */
                      FROM processed_flag_null
                     WHERE processed_flag = 0)
          LOOP
            NULL;
          END LOOP;
        END LOOP;
      END;
      runstats_pkg.rs_stop;
    END;
    -- Output
    Run1 ran in 5017 hsecs
    Run2 ran in 2212 hsecs
    run 1 ran in 226.81% of the timeAs I expected using the hint is more than twices fast of not using the index, why doesn't the CBO choose the index aproach? Can I tune the stats to give the CBO more information?
    Thanks in advance,
    Manuel Vidigal
    EDIT:
    Forgot to mention the tests were done using my laptop with Oracle 11.2.0.1.0.
    Edited by: Manuel Vidigal on 16/Set/2010 11:53

    I don't have runstats installed on my 11.2 instance so i can't reproduce your findings there, however with a simple SET TIMING ON and observing the results i get no noticeable difference between the INDEX hinted query and the not hinted query (i have an isolated sandbox where i am on the only user on the server so this is a reasonably safe method in my opinion).
    TUBBY_TUBBZ?
    BEGIN
    FOR i IN 1 .. 1000
    LOOP
       FOR x IN (SELECT *
                   FROM processed_flag_null
                  WHERE processed_flag = 0)
       LOOP
         NULL;
       END LOOP;
    END LOOP;
    END;
    12  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:51.26
    BEGIN
    FOR i IN 1 .. 1000
    LOOP
       FOR x IN (SELECT /*+ index(processed_flag_null IDX_PROCESSED_FLAG_NULL) */
                   FROM processed_flag_null
                  WHERE processed_flag = 0)
       LOOP
         NULL;
       END LOOP;
    END LOOP;
    END;
    13  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:50.53The results you are seeing are a consequence of the tiny nature of your table. The way you have set it up you should be seeing roughly 300 rows fitting on to a single data block (i observed 325 on my instance running on ASM) and you are only interested in returning every 100th row (again the way you set up your data) but to get every 100th row means you will have to visit EVERY block in the table.
    select
       blocks
    from dba_segments
    where segment_name = 'PROCESSED_FLAG_NULL';
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:04.51
    TUBBY_TUBBZ?
                BLOCKS
                  3072
    1 row selected.
    Elapsed: 00:00:00.13Since you haven't ordered your data it's going to be inserted as the rows are generated from DUAL (so ordered by LEVEL asc). That means that you will need to get every block from the table (getting roughly 3 results per block).
    In order to visit every block in the table via an index access you cannot utilize multi-block IO, so that would be the reason the optimizer took the FULL table scan as it's choice.
    So in terms of 'fixing' this you have a couple of options.
    1) change the order of the data so it's not so evenly distributed across the blocks in the table (or possibly create this table as an index organized one so the values are sorted upon insertion and kept physically close to each other)
    2) change the size of a row such that less rows will fit on a single data block meaning that you will not actually have to return every data block for this table via your query
    lpad('A', 1000, 'A') VALUE,Would be a sufficient change to shift things in favor of index access in your example.

  • Recursive custom tag: different behaviour in WinXP and Linux

    Hi all,
    I've a strange behaviour on a web application for which I developed a custom tag to render a tree structure.
    This tag take in input an object representing the tree with all its nodes, and render every node, calling hitself recursively for every child of every node.
    This tag is used inside a jsp.
    I deployed my webapp on JBoss in a WinXP Pro environment, and everything is ok. Then I deployed the same webapp on JBoss in a Linux Env, and the call to the custom tag... doesn't write anything (with the same input).
    Used jdk are 1.6.0_10 on WinXP and 1.6.0_7 on Linux (an OpenSuse professional distribution). JBoss is 4.2 (I did tests with JBoss 4.2.2 and 4.2.3).
    Here is a sample code of my tag (file outree.tag):
    <%@ tag language="java" pageEncoding="UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
    *<%@ taglib prefix="ousel" tagdir="/WEB-INF/tags/ouselector" %>*
    <%@ attribute name="subtree"
              required="true"
              type="my.webapp.TreeObject" %>
    <%@ attribute name="subroot_index" required="true" type="java.lang.Integer"%>
    <log:debug category="my.webapp.ousearch.taglib" message="Tag library called, starting operations..." />
    <c:if test="${not empty subtree.children}">
         <c:set var="next_subtree_index" value="${subroot_index + 1}"/>
         <ul class="subtree" id="subtree-${subroot_index}">
         <log:debug category="${logcategory}" message="We have children, calling recursively tag library on them (next subtree index: ${next_subtree_index})..." />
         <c:forEach var="currentOUChild" items="${subtree.children}">
              *<ousel:outree subtree="${currentOUChild}" subroot_index="${next_subtree_index}"/>*
              <c:set var="next_subtree_index" value="${next_subtree_index + 1}"/>
         </c:forEach>
         </ul>
    </c:if>
    </li>The TreeObject contains a list of children that can contain other children and so on. On every child, I call recursively my custom tag to render with a set of nested <ul> elements the entire tree structure.
    Here the call from the jsp:
    <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
    *<%@ taglib prefix="ousel" tagdir="/WEB-INF/tags/ouselector" %>*
    <log:debug category="${logcategory}" message="Building subtree ${ouSubtree} HTML structure..." />
    *<ousel:outree subtree="${ouSubtree}" subroot_index="1"/>*
    <log:debug category="${logcategory}" message="Subtree ${ouSubtree} HTML structure built" />
    ...Jakarta log taglibs is used to log the value of the parameter passed to the custom tag. In the Linux env I see that the passed object is not empty (it couldn't be null because the tag enforce it as a mandatory value).
    Any idea?

    I have found a workaround.
    Simply substitute the recursive invocation, with an import of a jsp that will call the custom tag.
    Note: You have to set your needed variable in request to make it visible to the jsp
    <%@ tag language="java" pageEncoding="UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
    <%@ attribute name="subtree"
              required="true"
              type="my.webapp.TreeObject" %>
    <%@ attribute name="subroot_index" required="true" type="java.lang.Integer"%>
    <log:debug category="my.webapp.ousearch.taglib" message="Tag library called, starting operations..." />
    <c:if test="${not empty subtree.children}">
         <c:set var="next_subtree_index" value="${subroot_index + 1}"/>
         <ul class="subtree" id="subtree-${subroot_index}">
         <log:debug category="${logcategory}" message="We have children, calling recursively tag library on them (next subtree index: ${next_subtree_index})..." />
         <c:forEach var="currentOUChild" items="${subtree.children}">
                    *<c:set var="_currentOUChild" value="${currentOUChild}" scope="request"/>*
                    *<c:set var="_next_subtree_index" value="${next_subtree_index}" scope="request"/>*
              *<c:import url="/WEB-INF/tags/outtree.jsp"/>*
              <c:set var="next_subtree_index" value="${next_subtree_index + 1}"/>
         </c:forEach>
         </ul>
    </c:if>
    </li>Here is the imported jsp (outtree.jsp):
    <%@ taglib prefix="ousel" tagdir="/WEB-INF/tags/ouselector" %>
    <ousel:outree subtree="${_currentOUChild}" subroot_index="${_next_subtree_index}"/>

  • [SOLVED] Strange memory leak

    After updating to systemd (maybe after it) strange things with memory:
    In one moment count of free memory precipitously start decrease, in 10 seconds in decrease to 0, after it same happen
    to swap.
    http://i.imgur.com/ANqbn.png
    In that screenshot you can see, that top-memory process (luakit) owns only 10% (200mb). I can't say who owns all memory, but this is not one process. Next time I try to get ps all -A output, but its a bit difficult - system hung-up very fast.
    Journal log:
    https://www.dropbox.com/sh/oq5yk03tzyfj … _crash.log
    Watch from start to --Reboot-- line.
    My systemd services:
    cronie, dhcpcd@eth0, netcfg, remote-fs, wicd.
    Packages status:
    http://pastebin.com/RRsy0tDw
    Used apps:
    In one time: luakit, vim, mocp, weechat
    Another one: mplayer
    Last edited by ShadowPrince (2012-12-15 04:49:07)

    Ahahahahahahahahah.
    I finnaly got ps -Af output and found there many copies of one script, who runs itself recursively.
    That script was binded to cron.hourly, and after hour of work start to multiply.
    Yeah, script was mine, I think in one update (when I practice in VIM) I put here that code accidentally.
    Anyway, that was fun. Linux rule.

  • Browsing files and directories recursively! H

    Hi!
    I'd like to visit all files and dictonaries recursively! I know that it is few lines of code but I cannot figure it out rigth now!!!
    I've got some pice of code which is supposed to do my request but it doesn't. Can You have a look at it? :
    void visiting(File file){
    if(file.isDirectory()){
    String[] children = file.list();
    for (int i=0;i<children.length;i++){
    visiting(new File(file,children));
    So have You got any suggestions???
    Greatly appreciate any help!!!

    Hi!
    I'd like to visit all files and dictonaries
    recursively! I know that it is few lines of code but I
    cannot figure it out rigth now!!!
    I've got some pice of code which is supposed to do my
    request but it doesn't. Can You have a look at it? :
    void visiting(File file){
    if(file.isDirectory()){
    String[] children = file.list();
    for (int i=0;i<children.length;i++){
    visiting(new File(file,children));
    So have You got any suggestions???
    Greatly appreciate any help!!!Strangely just wrote this and it looks at all the directories and calculates size.
    import java.io.*;
    public class FileSystemAdministratorMain {
      long fulltotal = 0;
      public FileSystemAdministratorMain() {
        File startDir = new File("C:/Backups");
        analyseDirectory(startDir);
        System.out.println("Full Amount (bytes): " + fulltotal);
        System.out.println("Full Amount (K): " + fulltotal /1024);
        System.out.println("Full Amount (M): " + fulltotal /1048576);
      public void analyseDirectory(File dirToAnalyse) {
        File[] info = dirToAnalyse.listFiles();
        long total = 0;
        for (int i=0; i < info.length; i++) {
          if (info.isDirectory() == true) {
    analyseDirectory(info[i]);
    else {
    total += info[i].length();
    fulltotal += total;
    System.out.println((total / 1024) + " = " + dirToAnalyse.getAbsolutePath());
    public static void main(String[] args) {
    FileSystemAdministratorMain fileSystemAdministratorMain1 = new FileSystemAdministratorMain();

  • Recursive plunge inside sun CORBA code?

    I'm seeing a stack overflow from a recursive plunge inside
    com.sun.corba.se.impl.protocol.CorbaServerRequestDispatchImpl.dispatch()
    with both JDK 1.5 and JDK 1.6.
    Sure enough, at line 214 in the source is a recursive call, preceded by
    a comment that seems to indicate it shouldn't be a problem:
            // Destroyed POAs can be recreated by normal adapter activation.
            // So just restart the dispatch.
            dispatch(request);However, request is the same as the original argument to dispatch, so a recursive
    plunge isn't unexpected! Is that code really correct?
    Being a CORBA novice, I'm sure I'm doing something odd that results in
    this particular path being taken in dispatch(), but because of the stack overflow,
    I haven't been able to trace down exactly what in my code is resulting in reaching
    line 214, but it appears related to breaking a CORBA connection. (The application
    is multi-threaded application that is connecting/unconnecting to/from multiple
    applications.)

    Hi Mike,
    Thanks for your suggestion. Making the interface local was the first thing I tried. (In fact, I started out with a local interface.) The strange thing is that the servlet cannot resolve the interface when it's local. That's why I made the interface remote. But now I know this only makes things worse.
    So the real problem is probably my JSF servlet that doesn't resolve the local interface in the EJB JAR. In fact, it seems all EJB annotations are ignored in the servlet. Even the remote interface could only be resolved "manually" (via an JNDI lookup, using a InitalContext, etc.) Is there any known issue with EJB annotations in JSF servlets?
    (By the way: it was hard to find information on the CORBA MARSHAL error. Perhaps this error can be clarified somehow in a newer version of TopLink (Essentials). At least a warning about this happening in the TopLink documentation should be nice.)
    Anyway, thanks for your prompt reply. I hope you (or someone else) has some suggestions on how to getting things working the proper way (with a local interface). Do you think it will help to deploy both modules in a single EAR file instead of deploying them as separate JAR and WAR?

  • Make can't recursively call Make when run from Runtime.exec (for some user)

    This one is a little complicated. The afflicted platform is Mac OS X. It works fine on Linux, it seems, and even then, it does work for some Mac OS X users...
    First, the setup. I have a Java program that has to call GNU Make. Then, GNU Make will recursively call Make in some subdirectories. This results in the following Java code:
    String make = "make"; //on windows, I have this swapped with "mingw32-make"
    String workDir = ...; //this is programmatically detected to be the same folder that the parent Makefile is in
    Runtime.getRuntime().exec(make,null,workDir);This calls make on a Makefile which has the following line early on to be executed (this is only a snippet from the makefile):
    cd subdirectory && $(MAKE)When I fetch the output from the make command, I usually get what I expect: It cd's to the directory and it recursively calls make and everything goes smoothly.
    However, for one particular user, using Mac OS X, he has reported the following output:
    cd subdirectory && make
    /bin/sh: make: command not found
    make: *** [PROJNAME] Error 127Which is like, kinda hurts my head... make can't find make, apparently.
    I've gotten some suggestions that it might be due to the "cd" command acting wonky. I've gotten other suggestions that it may be some strange setup with the env variables (My Mac developer is implementing a fix/workaround for 'environ', which is apparently posix standard, but Mac (Mr. Posix Compliance...) doesn't implement it. When he finishes that, I'll know whether it worked or not, but I get the feeling it won't fix this problem, since it's intended for another area of code entirely...
    Also worth mentioning, when the user calls "make" from the terminal in said directory, it recurses fine, getting past that particular line. (Later on down the road he hits errors with environ, which is what my aforementioned Mac dev is working on). Although calling "make" by hand is not an ideal solution here.
    Anyways, I'm looking for someone who's fairly knowledgeable with Runtime.exec() to suggest some way to work around this, or at least to find out that perhaps one of the User's settings are wonked up and they can just fix it and have this working... that'd be great too.
    -IsmAvatar

    YoungWinston
    YoungWinston wrote:
    IsmAvatar wrote:
    However, for one particular user, using Mac OS X, he has reported the following output:One particular user, or all users on Mac OS?In this case, I have two mac users. One is reporting that all works fine. The other is reporting this problem.
    cd subdirectory && make
    /bin/sh: make: command not found
    make: *** [PROJNAME] Error 127Which is like, kinda hurts my head... make can't find make, apparently.If that is being reported on the command line, then I'd say that make wasn't being found at all.If make isn't being found, then who's interpreting the Makefile?
    It's also just possible that the make script on Mac isn't correctly exporting its PATH variable, though it seems unlikely, since this would surely have been reported as a bug long ago.
    I've gotten some suggestions that it might be due to the "cd" command acting wonky...Also seems unlikely. 'cd' has been around since shortly after the K-T extinction event.
    WinstonBy "acting wonky", I mean being given a bad work directory or some such, such that it's not changing to the intended directory.
    Andrew Thompson
    Andrew Thompson wrote:
    (shudder) Read and implement all the recommendations of "When Runtime.exec() won't" (http://www.javaworld.com/jw-12-2000/jw-1229-traps.html).
    Already read it. I already know the dreadful wonders of Runtime.exec. But in this case, it's been working fine for us up until one Mac user reported that make can't find make.
    Also, why are you still coding for Java 1.4? If you are not, use a ProcessBuilder, which takes a small part of the pain out of dealing with processes.Usually I do use a ProcessBuilder. I noticed that it usually delegates to Runtime.exec() anyways, and seeing as I didn't need any of the additional functionality, I decided to just use Runtime.exec() in this particular case.
    jschell
    jschell wrote:
    So print thos env vars, in your app and when the user does it.I'll look into that. It's a good start.
    -IsmAvatar

  • Strange running and compiling errors on some apps.

    Hey,
    I recently installed Archlinux 08.2012 (20 days ago aprox.), everything was going perfectly since yesterday.
    I guess that the problem started during the AUR installation of Cinnamon which showed me a strange and undocumented error, during the "make" process. I believe that the error is undocumented because I do not found any post or information about it. Here you have the error which is the same of AUR:
    [albert@(none) linuxmint-muffin]$ make
    make all-recursive
    make[1]: Entering directory `/home/albert/Baixades/linuxmint-muffin'
    Making all in src
    make[2]: Entering directory `/home/albert/Baixades/linuxmint-muffin/src'
    make all-recursive
    make[3]: Entering directory `/home/albert/Baixades/linuxmint-muffin/src'
    Making all in wm-tester
    make[4]: Entering directory `/home/albert/Baixades/linuxmint-muffin/src/wm-tester'
    make[4]: Nothing to be done for `all'.
    make[4]: Leaving directory `/home/albert/Baixades/linuxmint-muffin/src/wm-tester'
    Making all in tools
    make[4]: Entering directory `/home/albert/Baixades/linuxmint-muffin/src/tools'
    make[4]: Nothing to be done for `all'.
    make[4]: Leaving directory `/home/albert/Baixades/linuxmint-muffin/src/tools'
    Making all in compositor/plugins
    make[4]: Entering directory `/home/albert/Baixades/linuxmint-muffin/src/compositor/plugins'
    make[4]: Nothing to be done for `all'.
    make[4]: Leaving directory `/home/albert/Baixades/linuxmint-muffin/src/compositor/plugins'
    make[4]: Entering directory `/home/albert/Baixades/linuxmint-muffin/src'
    GISCAN Meta-3.0.gir
    /usr/bin/g-ir-scanner: line 26: __builtin__.__dict__[DATADIR]: command not found
    /usr/bin/g-ir-scanner: line 29: syntax error near unexpected token `('
    /usr/bin/g-ir-scanner: line 29: ` def on_exception(exctype, value, tb):'
    make[4]: *** [Meta-3.0.gir] Error 2
    make[4]: Leaving directory `/home/albert/Baixades/linuxmint-muffin/src'
    make[3]: *** [all-recursive] Error 1
    make[3]: Leaving directory `/home/albert/Baixades/linuxmint-muffin/src'
    make[2]: *** [all] Error 2
    make[2]: Leaving directory `/home/albert/Baixades/linuxmint-muffin/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/albert/Baixades/linuxmint-muffin'
    make: *** [all] Error 2
    When the error appears my default mouse pointer disappears and is replaced by a cross. If I do not make 3 mouse clicks the compilation progress does not go and never shows the error. It remains waiting for my 3 clicks showing me on the prompt
    GISCAN Meta-3.0.gir
    As I saw that the error was related to g-ir-scanner I tried to run it:
    [albert@(none) ~]$ g-ir-scanner
    import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9047.
    /usr/bin/g-ir-scanner: line 26: __builtin__.__dict__[DATADIR]: command not found
    /usr/bin/g-ir-scanner: line 29: syntax error near unexpected token `('
    /usr/bin/g-ir-scanner: line 29: ` def on_exception(exctype, value, tb):'
    [albert@(none) ~]$
    And then the mouse pointer's strange cross appeared again with the same symptomes than the last issue.
    But the problem does not finish here. This evening I installed the Openshot software and when I tried to run it, the strange cross appeared again.
    And the prompt log out is:
    [albert@(none) ~]$ openshot
    /usr/bin/openshot: line 24: syntax error near unexpected token `('
    /usr/bin/openshot: line 24: `realfile = os.path.realpath(__file__)'
    [albert@(none) ~]$
    I really don't know what kind of problem I have, but It always repeat
    /usr/bin/X: line XX: syntax error near unexpected token `('
    I hope that someone will know how to help me.
    Thank you for your time.
    Wamest regars.
    Last edited by acasnaovas (2012-08-28 21:47:40)

    Waoo, I reinstalled the packages (pacman -Sf python python2 gobject-introspection) and the openshot works and pitivi to, there is no more strange cross and errors, well just one always after Pacman finishes :
    ldconfig: el fitxer «/lib/libakonadi-filestore.so» is empty, no es comprova
    ldconfig: el fitxer «/lib/libprison.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkdepim-copy.so.4.9.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkresources.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadiprotocolinternals.so.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kcal.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkxmlrpcclient.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kmime.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqrencode.so.3» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqgpgme.so.1.0.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++-pthread.so.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-calendar.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++-pth.so.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkldap.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kcal.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libsyndication.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimutils.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libprison.so.0.0.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkdepim-copy.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkimap.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmaildir.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kmime.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmindexreader.so.4.9.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libsensors.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kde.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkblog.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimutils.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-contact.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++-pth.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmbox.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkholidays.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkontactinterface.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmime.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqalculate.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-contact.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++.so.2.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kabc.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-calendar.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqjson.so.0.7.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqgpgme.so.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libdmtx.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libdmtx.so.0.0.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcal.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libGLESv2.so.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libGLESv1_CM.so.1.1.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadiprotocolinternals.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkdepim-copy.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmbox.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkdepim-runtime-dms-copy.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmindexreader.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmaildir.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libcln.so.6» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkgapi.so.0.4.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkalarmcal.so.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqscintilla2.so.8» és buit, no es comprova
    ldconfig: el fitxer «/lib/libsyndication.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkalarmcal.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmailtransport.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqscintilla2.so.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kde.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kmime.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkblog.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmicroblog.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kcal.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqrencode.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcalcore.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkabc_file_core.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kabc.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmicroblog.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmindexreader.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++-pth.so.2.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libktnef.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimidentities.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkabc_file_core.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmbox.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libGLESv2.so.2.0.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcal.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqimageblitz.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimtextedit.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkalarmcal.so.2.7.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-xml.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqscintilla2.so.8.0.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcalcore.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqimageblitz.so.4.0.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqjson.so.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-xml.so.4.9.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-notes.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkholidays.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmailtransport.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkldap.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkontactinterface.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libdmtx.so.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++-pthread.so.2.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkblog.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libsyndication.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkxmlrpcclient.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkholidays.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++.so.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqrencode.so.3.3.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqjson.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kde.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libGLESv1_CM.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libktnef.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkimap.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-kabc.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libsensors.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimutils.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcal.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimtextedit.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-filestore.so.4.9.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libcln.so.6.0.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimtextedit.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkxmlrpcclient.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmicroblog.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmailtransport.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcalcore.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadiprotocolinternals.so.1.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libgpgme++-pthread.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkabc.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimidentities.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-filestore.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkldap.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-notes.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcalutils.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmime.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-contact.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libprison.so.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcalutils.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkontactinterface.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libsensors.so.4.3.2» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkpimidentities.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libktnef.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqalculate.so.5» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkabc.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libmaildir.so.4.9.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-xml.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkcalutils.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkabc_file_core.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkabc.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqimageblitz.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkresources.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqgpgme.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkmime.so.4.8.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libGLESv1_CM.so.1» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqalculate.so.5.0.0» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkresources.so.4» és buit, no es comprova
    ldconfig: el fitxer «/lib/libqscintilla2.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-calendar.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libGLESv2.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libcln.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libakonadi-notes.so» és buit, no es comprova
    ldconfig: el fitxer «/lib/libkimap.so.4.8.0» és buit, no es comprova
    How I have to make the Chroot tmpfs? I will compile cinnamon into the chroot.
    Thank you for everything.
    WorMzy wrote:
    I don't know what it is, and how I have it installed.
    Nevermind, pkgfile tells me that it's part of gobject-introspection. Try reinstalling that package. You might want to reinstall python2, it shouldn't be complaining about parenthesis there.
    I will try to build everything in a clean chroot. I have 8Gb of ram, so enough.
    You need disk space for the chroot. Approximately 1GB per (clean) chroot (e.g. /var/lib/archbuild/extra-86_64/root), potentially up to several GB for a "dirty" chroot. RAM is only necessary if you decide to make the "dirty" chroot (/var/lib/archbuild/extra-86_64/$username) into a tmpfs.

  • Help: A Strange Thing in my Servlet!

    I wrote a simple servlet to get user feed back, and call an object to send feedback to a given address via Java Mail. For some strange reason, the data validation part never works - it is a simple IF/ELSE!
    Below is a simplised version of the code. Anyone could give some ideas? Thanks a lot!
    // a java servlet to handle user feed back at a site
    // it gets form data
    // it checks if required data are all there
    // if they are, it calls other object to send these data via Java Mail, and display thank-you msg
    // if not, it displays the form with data filled, if any, and asks user to resubmit
    package feedback;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import feedback.FeedBack;
    public class UserFeedBack extends HttpServlet {
         // give mail server host name, mail receiver address, class var
    static final String host="mail.myserver.com";
         static final String receiver="[email protected]";
         // method to get form data, validate data, and decide to send off or ask for resubmitting
         public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              ServletOutputStream out = response.getOutputStream();
         response.setContentType("text/html");
              out.println("<HTML>");
              out.println("<HEAD><TITLE>User FeedBack</TITLE></HEAD>");
              out.println("<BODY>");
              // get data from HTML form
              String name=request.getParameter("name");
              String email=request.getParameter("email");
              String content=request.getParameter("content");
              String subject=("User Feedback from " + name);
              System.out.println("Go to validation!");
              // data validation
              if(name==""||name==null||email==""||email==null||content==""||content==null) {
                   System.out.println("Go reSubmit!");
              reSubmit(out, name, email, content);
              } else {
                   // all data are there, try to send mail via FeedBack
                   System.out.println("Go to Java Mail!");
                   try {
                   // call FeedBack object, which handle mail via Java Mail
                   FeedBack feedBack=new FeedBack(host, receiver, name, email, subject, content);
                        // thank sender
                   showConfirmation(request, out, name);
              } catch (Exception e_) {
                        // when sending mail fails
                        System.out.println("Got an exception when calling FeedBack: " + e_.toString());
              out.println("</BODY>");
              out.println("</HTML>");
              out.close();
         // method to ask user to re-submit data
         private void reSubmit (ServletOutputStream out, String name, String email, String content) throws ServletException, IOException {
              // show submitted data in filed
              // recursively call this page for resubmitting
              String fb_name=name;
              String fb_email=email;
              String fb_content=content;
         try {
              out.println("<table><tr><form name=\"Feed_Back\" method=\"POST\" action=\"/servlet/feedback.UserFeedBack\">");
              out.println("<td colspan=2>Please submit all data required as indicated by *</td></tr>");
              out.println("<tr><td>Name*</td><td><input type=text name=\"name\" value=");
              out.println(fb_name + "></td></tr>");
              out.println("<tr><td>Email*</td><td><input type=text name=\"email\" value=");
              out.println(fb_email + "></td></tr>");
              out.println("<tr><td>Content*</td><td><input type=text name=\"content\" value=");
              out.println(fb_content + "></td></tr>");
              out.println("<tr><td><input type=\"submit\" value=\"Submit\"></td>");
              out.println("<td><input type=\"reset\" value=\"Reset\"></td></tr>");
              out.println("</form></table>");
         } catch (Exception e_) {
         System.out.println("Got an exception when making re-submit form: " + e_.toString() );
              // thanks msg to this trouble maker
         private void showConfirmation (HttpServletRequest request, ServletOutputStream out, String name) throws ServletException, IOException {
              String user_name=name;
              try {
              out.println("Thank you, " + user_name);
              out.println(", for writing something to keep us busy!" + "\n");
              } catch (Exception e_) {
              System.out.println("Got an exception when showing thanks note: " + e_.toString() );
         // a standard way to assure both form methods can be safely used
         public void doGet(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
              doPost(request, response);
    }

    One problem I found in your code...
    For checking equality of two strings you need to use String.equals(String otherString) and not the operator ==

  • Recursive jsp tags

    Hi
    I have run into interesting issue which i would like to share. I created simple tag file which code shown below:
    <%@ tag isELIgnored="false" %>
    <jsp:useBean type="view.LeftMenuItem"
    id="currentLeftMenuItem" scope="request"></jsp:useBean>
    <%@ taglib tagdir="/WEB-INF/tags" prefix="fd" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ attribute name="cssClass" required="false"%>
    <%@ attribute name="prefix" %>
    <%@ attribute name="oneClass"%>
    <c:set var="falseVar" value="false" scope="page"/>
    <c:if test="${oneClass eq falseVar}">
    <c:if test="${currentLeftMenuItem.expanded}">
    <c:set var="finalStyle" scope="page" value="${cssClass}_level${currentLeftMenuItem.level}_collapsed"/>
    </c:if>
    <c:if test="${!currentLeftMenuItem.expanded}">
    <c:set var="finalStyle" scope="page" value="${cssClass}_level${currentLeftMenuItem.level}_expanded"/>
    </c:if>
    </c:if>
    <c:if test="${!(oneClass eq falseVar)}">
    <c:set var="finalStyle" scope="page" value="${cssClass}"/>
    </c:if>
    <div>
    ${prefix}
    <fd:linkSubmit action="${currentLeftMenuItem.action}"
    cssClass="${finalStyle}" text="${currentLeftMenuItem.name}">
    </fd:linkSubmit>
    <c:if test="${(currentLeftMenuItem.numberOfSubItems > 0) && (currentLeftMenuItem.expanded )}">
    <div id="${currentLeftMenuItem.hash}">
    <c:forEach items="${currentLeftMenuItem.subItems}"
    var="item">
    <c:set var="item1" scope="request" value="${item}"/>
    <%request.setAttribute("currentLeftMenuItem", request.getAttribute("item1")); %>
    <fd:leftMenuItem cssClass="${cssClass}" prefix="${prefix} " oneClass="${oneClass}"/>
    </c:forEach>
    </div>
    </c:if>
    </div>
    Only last part of this code may be interesting to you. What's strange is that it gives stack overflow exception on compiling. But on another refresh in the browser it works fine. What you can see in bold it's recursive call to the tag itself. From it working I assume, that what I do is allowed (i mean recursive tags), but why does it give stack overflow exc...? Any ideas?

    That's not adequate. JSP re-evaluation is what we're looking for. Consider a simple example where I have a JSP tag that reads a JSP file and outputs it. I want the JSP in the file to be reinterpreted. I want <%=3+3 %> to be spat out as 6, not the string <%=3+3 %>.
    I'd also like:
    <pre>
    <% for(int x=0; x<5 x++){%>
    hello world
    <%}%>
    </pre>
    To print hello world 5 times, etc.
    [email protected] suggested that the ability to "call" other custom tags can be easily be achieved by simply calling their implementation in the same way the JSP container does.
    <pre>
    public int doStartTag() throws JspException{
    try {
    JspWriter out = pageContext.getOut();
    Action1Tag action1 = new Action1Tag();
    action1.setPageContext( pageContext);
    action1.setParent( this);
    action1.setAttribute1(...); // if any attributes..
    action1.doStartTag();
    action1.doEndTag();
    action1.release();
    // follow with action2 & action 3...
    } catch(IOException e) {
    throw new JspException(e.getMessage());
    } return SKIP_BODY;}
    </pre>
    Couldn't we somehow subclass the caller for this functionality and make it re-interpret the page somehow instead of spitting the HTML back to the page directly?
    The web container does it somehow, so obviously it can be done some way.

Maybe you are looking for

  • Images folder in Robohelp 7 project only lists a small fraction of the images actually there

    I added an image to a topic. The image had an identical name to an existing image in the project. The image appeared in my main project folder, which is where all images initially show up in my project. I then move them to an images folder. I moved t

  • Com sdk issue: order of stop and play events

    Hopefully someone can answer a question regarding the Windows COM SDK. I've written a few applications in VB using this interface to monitor my play history. The documentation says that when the track changes, an OnPlayerStopEvent is given followed b

  • Jsf tags appear in ie 7 but not ie 8

    jsf components not appearing in ie 8, but have no problem in ie 7 has anyone else seen this problem or know of a workaround?

  • Non-ANSI characters in Java

    class test {      public static void main (String[] args) {           System.out.print("새"); }Is it possible to print non-ANSI characters like the above? Since obviously saving this code in ANSI will remove the non-ANSI characters.

  • After approval AR is not released

    Hi Friends, We have developed a workflow for approval of AR's. I am creating  appropriation request thro' IMA11 , and then I am sending it for approval now status FAPP for approval in progress now it came in my workflow inbox now I am approving the A