Recursive function definition results in stack overflow

I am writing a library script to handle some basic calculations with complex numbers which includes a function, powerN(), that raises (or is supposed to raise) a complex number to the Nth power. The function compiles but gives a stack overflow error when called. The language guide has an example (p. 286 in PDF version- recursive subroutines section) of a recursive definition of a function which gives the factorial of a number, and my powerN function seems to be analogous. Can anyone shed some light on whatever the problem is? Relevant code examples are below. Thanks for any insights.
-----Apple recursive subroutine for factorials------
on factorial(x)
if x > 0 then
return x * (factorial(x - 1))
else
return 1
end if
end factorial
-----End Apple recursive subroutine for factorials------
-----My script with problematic powerN() function------
--Complex numbers a+b(i), x+y(i) represented by {a,b}, {x,y}
on multiply({a, b}, {x, y})
return {(a * x + b * y), (b * x + a * y)}
end multiply
--above multiply function works
on powerN({a, b}, N)
return multiply({a, b}, powerN({a, b}, N - 1))
end powerN
--above powerN function gives stack overflow error
-----End my script with problematic powerN() function------

the problem is that your recursion has no end case, thus causing a stack overflow
you should add a test as follows :
on powerN({a, b}, N)
if N>0 then
return multiply({a, b}, powerN({a, b}, N - 1))
else
return 1
end if
end powerN
by the way, shouldn't your complex multiplication look like :
on multiply({a, b}, {x, y})
return {(a * x - b * y), (b * x + a * y)}
end multiply

Similar Messages

  • Trying to rename files results in "stack overflow"

    I'm trying to make a script to change the names of many files at once. In particular, I have many .tif files that I want to use as frames in an animation. The files are named "frame0001.tif", "frame0002.tif", etc. The problem is that I have seperate folders of frames, and the "0001" etc. count restarts in each folder. I have written the following script to try to add a set number to the count of the files in a particular directory. However, the script results in a stack overflow error. What do I have to do to change the name of a file correctly? Thanks,
    Adrian
    tell application "Finder"
    set the source_folder to (choose folder) as alias
    set file_list to (every file of source_folder whose name starts with "frame")
    set file_count to (count file_list)
    if file_count is 0 then return
    if file_count is 1 then
    set file_list to (file_list as alias) as list
    else
    set file_list to file_list as alias list
    end if
    end tell
    display dialog "Enter number to add to frame count:" default answer "" buttons {"Cancel", "OK"} default button 2
    set the count_add to the text returned of the result
    repeat with i from 1 to the number of items in the file_list
    set this_item to item i of the file_list
    set this_item to this_item as alias
    set this_info to the info for this_item
    set the current_name to the name of this_info
    set AppleScript's text item delimiters to "frame"
    set the current_name to the second text item of the current_name
    set AppleScript's text item delimiters to ".tif"
    set the current_name to the first text item of the current_name
    set AppleScript's text item delimiters to ""
    set the current_num to the current_name as integer
    set the count_num to the count_add as integer
    set the current_num to the (current_num + count_num)
    set the current_name to the current_num as string
    set the string_length to the length of the current_name
    set the zero_count to (4 - the string_length)
    repeat with j from 1 to the zero_count
    set the current_name to "0" & the current_name
    end repeat
    set the current_name to "frame" & current_name & ".tif"
    set the name of this_item to the current_name
    end repeat
    PowerBook G4   Mac OS X (10.4.1)  

    Your code - re-written, and with Cyclosaurus'es noted 'tell app "Finder" ...' suggestion:
    tell application "Finder" to set file_list to (every file of (choose folder) whose name starts with "frame")
    set file_count to (count file_list)
    if (file_count is 0) then
    return
    else if (file_count is 1) then
    set file_list to (file_list as alias) as list
    else if (file_count > 1) then
    tell application "Finder" to set file_list to file_list as alias list
    end if
    tell me to activate
    set count_add to (text returned of (display dialog "Enter number to add to frame count:" default answer "" buttons {"Cancel", "OK"} default button 2)) as integer
    repeat with i in file_list
    tell application "Finder" to set current_name to (displayed name of i)
    set {oAStId, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "frame"}
    set current_name to second text item of current_name
    set AppleScript's text item delimiters to ".tif"
    set current_name to (first text item of current_name)
    set AppleScript's text item delimiters to oAStId
    set current_name to (((current_name as integer) + (count_add)) as string)
    if ((count current_name) = 1) then
    set current_name to "000" & current_name
    else if ((count current_name) = 2) then
    set current_name to "00" & current_name
    else if ((count current_name) = 3) then
    set current_name to "0" & current_name
    end if
    try
    tell application "Finder" to set (name of i) to ("frame" & current_name & ".tif")
    end try
    end repeat
      Mac OS X (10.4.4)  

  • Infinite recursion - base case ignored and stack overflowed

    Hi, I've been having this logic error for 2 days, and I cannot fix it. Right now, I can barely see anything because I was looking at computer screen for 10 hours. The code I'm writing is a program that allows the user to play a list of MP3 files in a folder. Among commands we have to make, we have to sort the list according to authors, dates, and titles as desired by the user. This specific problem I'm having is from the sorting method. We have to use quick sort, and through the help of textbook and online, I was able to write the code as follows. The problem is, I'm having an infinite recursion. The base case I wrote and if else statement are completely ignored and the method keeps calling itself. Perhaps, return statement is not how you are supposed to end a recurssive method? I have no idea. Any help will be appreciated. Thank you in advance.
    public void sort (Comparator<MP3File> comp) {
              System.out.println("first: " + first  + "last: " + last);
              quickSort(first, last, comp);
              System.out.println("done");
              return;
         public void quickSort (int left, int right, Comparator<MP3File> comp) {
              int leftBound= left;
              int rightBound= right;
              System.out.println("before sorting: left - " + left + " right - " + right);
              if (left>=right) {
                   return;
               if ( ( left < 0 ) || ( left >= listOfMP3.length ) ||
                         ( right < 0 ) || ( right >= listOfMP3.length ) ) {
                       throw new IndexOutOfBoundsException();
               if (right-left>=1) {
                    System.out.println("difference between right and left: " + (right-left));
                    MP3File pivot = listOfMP3[left];
                    while (rightBound>leftBound)
                         while (comp.compare(listOfMP3[leftBound], pivot)<= 0 && leftBound<=right &&rightBound>leftBound) {
                              leftBound++;
                              System.out.println("leftBound " + leftBound);
                         while (comp.compare(listOfMP3[rightBound], pivot)>0 && rightBound>=left &&rightBound>=leftBound) {
                              rightBound--;
                              System.out.println("rightBound " + rightBound);
                         if (rightBound>leftBound) {
                              swap (leftBound,rightBound);
                        swap(left, rightBound);
                        System.out.println("swapped");
                        System.out.println("calling left sorting");
                        quickSort(left, rightBound-1, comp);
                        System.out.println("calling right sorting");
                        quickSort(rightBound+1, right, comp);
               else {
                    System.out.println("wtf");
                    return;
               System.out.println("error");
               return;
         public void swap(int index1, int index2) {
              MP3File temp = listOfMP3[index1];
              listOfMP3[index1] = listOfMP3[index2];
              listOfMP3[index2] = temp;
         }

    naranja wrote:
    Enlighten me further please? How do you use sort method using collections?[http://www.google.com/search?q=java+sort+tutorial]

  • Stack overflow at line: 1792 or 1788 when using the search function

    Hello everyone,
    My name is Thibault. I am a technical communications specialist. I've been using Robohelp html for a couple of years.
    I am working on the user guide of the software application developed where I work.
    This is a HUGE project, more than 6500 pages.
    We're two technical writers on this project. (This is an inportant detail since my colleague doesn't get the problem).
    I need your help because I have been having an annoying issue over the last couple of days.
    After the project is generated, I open it in the software, clicking F1.
    When I want to use the search function I have this error message displayed:
    "Stack overflow at line: 1792" or "Stack overflow at line: 1788"
    Do you know where this could come from?
    Furthermore, I noticed that this stack overflow only occurs on some words.
    I mean, it occurs for the most used words in this project.
    We have customers all over the world and over the last week, we've been getting a lot of feedbacks about this error message.
    I hope someone will be able to help me on this one!
    Thanks in advance!

    First of all, thanks for your answer RoboColum(n).
    Is the problem only when you search for a topic that contains Flash output?
    All my topics contain Flash outputs. I generate my output files on a folder that is embedded into the software.When in the software, I click F1 and the Flash User Guide opens.The search function works (or not) depending on the software version (32/64-bit).
    At what point exactly does the stack overview occur?
    We have two versions of the software a 32-bit version and a 64-bit version.
    The search function works fine with the 32-bit version.
    The problem occurs when I use the 64-bit version. When I type in a word, for example "unit", the stack overflow message appears. See below:
    As you can see, it looks like the search function freezes while the stack overflow message appears.
    And I never get this error message with the 32-bit version of our software.
    I also wonder whether you can search on a project that contains no Flash output. Perhaps you could try for us?
    What do you mean by that?
    As I told you previously, my Flash Player version is a 32-bit one.
    Do you think that the issue might come from there?

  • Recursive selection sort stack overflow

    hi, first time posting here.
    i have to write a java method that implements a selection sort. This method must be recursive. ok not a problem. i have come up with this so far
        public int findMin(int index) {
            int min = index - 1;
            if (index < num.length - 1) min = findMin(index + 1);
            if (num[index] < num[min]) min = index;
            return min;
        public void selectionSort(int left) {
            if (left < num.length - 1) {
                swap(left, findMin(left));
                selectionSort(left + 1);
        public void swap(int index1, int index2) {
            int temp = num[index1];
            num[index1] = num[index2];
            num[index2] = temp;
        }which works fine until i toss in a lot of values into the array. this creates a stack overflow, and ive been told that i need to use the divide and conquer method of resolving this issue. I guess this means to split the array up and sort each half seperatly, again and agin, or so im told.
    My question is how do i go about doing this, i am at a loss. Any help at all would be great.
    thank you
    lance

    i get this when i push the array passed about 5500 in sizeI got no problem. Post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and http://www.yoda.arachsys.com/java/newsgroups.html
    It is silly to implement selection sort with recursion, double-silly if you use double-recursion as your current code.
    /* silly but no OOME when used against 5500 element array */
    import java.util.*;
    public class RecursiveSelectionSort{
      static int[] num;
      public static int findMin(int index) {
        int min = index; // your code had a bug here
        if (index < num.length - 1){
          min = findMin(index + 1);
        if (num[index] < num[min]){
          min = index;
        return min;
      public static void selectionSort(int left) {
        if (left < num.length - 1) {
          swap(left, findMin(left));
          selectionSort(left + 1);
      public static void swap(int index1, int index2) {
        int temp = num[index1];
        num[index1] = num[index2];
        num[index2] = temp;
      public static void main(String[] args){
        Random rand = new Random();
        int n = 10;
        if (args.length > 0){
          n = Integer.parseInt(args[0]);
        num = new int[n];
        for (int i = 0; i < num.length; ++i){
          num[i] = rand.nextInt(10000);
        selectionSort(0);
        for (int in : num){
          System.out.print(in + " ");
        System.out.println();
    }

  • The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.

    The below function is giving me the hours difference what I wanted, but today it is giving us the below error: 
    Msg 535, Level 16, State 0, Line 1
    The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.
    Please Help..
    ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
    returns decimal(12,3)
    as
    begin
        if datepart(weekday,@StartDate) = 1
            set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
        if datepart(weekday,@StartDate) = 7
            set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
        -- if @EndDate happens on the weekend, set to previous Saturday 12AM
        -- to count all of Friday's hours
        if datepart(weekday,@EndDate) = 1
            set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
        if datepart(weekday,@EndDate) = 7
            set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
        declare @return decimal(12,3)
        set @return = ((datediff(second,@StartDate,@EndDate)/60.0/60.0) - (datediff(week,@StartDate,@EndDate)*48))
        return @return
    end
    ReportingServices

    You'll get this error if the difference between the start and end date is greater that about 68 years due to the "second" DATEDIFF specification.  Perhaps the dates are greater than the expected range due to a data quality issue. 
    Taking the advice from the error message, you could use minutes instead of seconds like the example below the version below.  This could still result in the error of the difference is greater than a couple of hundred years, though.  You might consider
    validating the dates and returning NULL if outside expected limits.
    ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
    returns decimal(12,3)
    as
    begin
    if datepart(weekday,@StartDate) = 1
    set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
    if datepart(weekday,@StartDate) = 7
    set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
    -- if @EndDate happens on the weekend, set to previous Saturday 12AM
    -- to count all of Friday's hours
    if datepart(weekday,@EndDate) = 1
    set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
    if datepart(weekday,@EndDate) = 7
    set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
    declare @return decimal(12,3)
    set @return = ((datediff(minute,@StartDate,@EndDate)/60.0) - (datediff(week,@StartDate,@EndDate)*48))
    return @return
    end
    GO
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Stack overflow error

    Hi..
    I have problem with this code.
       class test
           test tt=new test();   //1
           String name1;
        test() {}
        test(String i)
              name1=i;
             //tt=new test();    //2
       public static  void main(String arg[]){
                  test t1=new test("kj"); //3
    }  When I use line 2 (nstead of line 1 ) for initializing the ref variable iam not having any problem.
    But if i use as in line 1 iam getting stack overflow error..
    I thought tht calling a constructor recursivley results in a stack overflow error..
    But iam instantiating t1 with a one arg constructor (line 3) for which tt (line 1)is intialized,then where is the recursion happening..
    can any one pls clear..
    Thnx.
    mysha..

    please use [code][/code] tags around your code - makes it much easier to read.
    I think you have it - consider this code:public class StackOverflower {
        private StackOverflower so = new StackOverflower();
        public static void main(String[] args) {
            StackOverflower mySO = new StackOverflower();
    }Running this will overflow the stack since creation of an instance of StackOverflower requires creation of an instance of StackOverflower. This code though:public class NonStackOverflower {
        private NonStackOverflower nso = null;
        public NonStackOverflower() {
        public NonStackOverflower(String s) {
            this.nso = new NonStackOverflower();
        public static void main(String[] args) {
            NonStackOverflower myNSO = new NonStackOverflower();
    }Won't, since the creation of a new NonStackOverflower is not required to create a new NonStackOverflower instance.
    Did that make sense? I may have gotten confused and failed to illustrate your situation with my code...
    Good Luck
    Lee

  • CIN stack overflow error

    Im using an recursiv c++ function in my VI.
    After severall calls the VI crashes, printing an
    stack overflow error.
    I already increased in Visual Studio 6.0 the Link
    setting: allocate stack. But nothing changed.
    I need help fix this problem!!
    My prg. looks like this:
    recursiv (....) {
    int array[..][..][..];
    recursiv (..);
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    > Im using an recursiv c++ function in my VI.
    > After severall calls the VI crashes, printing an
    > stack overflow error.
    > I already increased in Visual Studio 6.0 the Link
    > setting: allocate stack. But nothing changed.
    > I need help fix this problem!!
    >
    > My prg. looks like this:
    >
    > recursiv (....) {
    > int array[..][..][..];
    > ....
    > recursiv (..);
    > }
    If you are truly allocating a three D array of ints
    on the stack, then it makes sense that you will run
    out of stack space sooner or later. I can't help
    you with increasing the stack size, but if you move
    your array into a memory block and store the pointer
    on the stack, then you will use less stack space and
    avoid the problem.
    In otherwords:
    recursive() {
    int *array;
    array= DSNewPtr()
    array[][][]= ...
    recursive();
    DSDisposePtr();
    Greg McKaskle

  • Stack overflow (0xC00000FD) at EIP=0x01B13469

    Hello, 
    I am working on a large project and sometimes the LabView shuts down with the error message:  Stack overflow (0xC00000FD) at EIP=0x01B13469 (that is tha last one I got). I am not able to identify the generator of this error. ( Maybe someone can do it from the error message above).  It is possible to catch this error ???? 

    charlie87 wrote:
    Hello, 
    I am working on a large project and sometimes the LabView shuts down with the error message:  Stack overflow (0xC00000FD) at EIP=0x01B13469 (that is tha last one I got). I am not able to identify the generator of this error. ( Maybe someone can do it from the error message above).  It is possible to catch this error ???? 
    This is a fatal error. As to catching it, Windows does it already for you, that is why you see the dialog. Trying to catch it yourself by some means wouldn't add anything as it is ABSOLUTELY unsafe to continue the process after this error. It could eat your breakfast, or the harddisk or something else!!
    Something in your application is using huge stack space. This could be in LabVIEW itself, if you use some form of very strange VI settings, but since the LabVIEW VI execution itself is not stack based it is unlikely that the large project in itself would be the cause of it. Most likely you make use of some external code library somewhere, that has huge stack space requirements, either by allocating huge buffers on the stack (a very bad thing to do) or by calling functions recursively without a safe upper bound (just as a bad thing to do).
    Also you should qunatify what a large project means. I have done projects in LabVIEW with about 1000 VIs and more already 15 years ago.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • C++ stack overflow on desctruction of Set::View

    Hi,
    I've encountered a problem when querying large sets of data from coherence.
    Gven the following code;
              // load cache with a large data set
              char buff[128] = {0};
              for( int i = 0; i < 100000; ++i )
                   sprintf_s(buff,128,"key%05d",i);
                   // random binary data
                   int len = 128 + rand() % 512;
                   Array<octet_t>::Handle hab = Array<octet_t>::create(len);
                   hCache->put(String::create(buff),hab);
            // query the cache, and print the results
              struct tmpIt
                   Filter::View          vAll;
                   Set::View               vSetResult;
              tmpIt *t = new tmpIt;
              t->vAll = AlwaysFilter::create();
                    t->vSetResult = hCache->entrySet(t->vAll);
              // iterate over the results
              int ncount = 0;
            for (Iterator::Handle hIter = t->vSetResult->iterator(); hIter->hasNext(); )
                Map::Entry::View vEntry = cast<Map::Entry::View>(hIter->next());
                   String::View     vKey   = cast<String::View>(vEntry->getKey());
                Object::View     vValue = vEntry->getValue();
                   Array<octet_t>::Handle dt = cast<Array<octet_t>::Handle>(vEntry->getValue());
                   ncount++;
                   if( (ncount % 2000) == 0 )
                        std::cout << ncount << std::endl;
              // delete the struct, thus forcing the destruction of vSetResult
              delete t;On deleting the struct 't' causes a stack overflow deep within coherence. I'm guessing there's some kind of recursive delete that works on smaller data sets.
    Can you please advise me on what to do in this situation, as this has put a halt to my coherence integrartion :)
    Cheers
    Rich
    Edited by: user9929344 on 22-Oct-2008 01:57

    Hi Rich,
    I've tried your test out in a few environments using both debug and release builds and have not been able to reproduce the issue. My guess is that it may have something to do with your build settings. Can you try building it using the build.cmd script which we ship with the product. This can be done by creating a new subdirectory under examples for your test, for instance "overflow", place you source code in that directory and then from the examples directory run "build overflow". You can then run the test by executing "run overflow". This is how I've tested an all seems to be ok. Assuming this resolves the issues on your side, you can have a look at the compiler/linker settings used in the build.cmd script and try applying them to your build process. If this does not resolve the issue, it would be useful if you could send us a fully buildable example (and build script) which reproduces it. Also if you could include the OS and compiler versions that would help.
    In testing your source code I ran into a few small things I thought I should point out to you.
    - while loading if you batch your puts into a local HashMap and then do periodic hCache->putAll() operations loading will be faster:
         // load cache with a large data set
            char buff[128] = {0}; 
            Map::Handle hMapBatch = HashMap::create();
              for( int i = 0, c = atoi(argv[2]); i < c; ++i )
                   sprintf(buff,"key%05d",i);
                   // random binary data
                   int len = 128 + rand() % 512;
                   Array<octet_t>::Handle hab = Array<octet_t>::create(len);
                   hMapBatch->put(String::create(buff),hab);
                   if ((i % 2000) == 0)
                        hCache->putAll(hMapBatch);
                        hMapBatch->clear();
                        std::cout << "loaded " << i << std::endl;
            hCache->putAll(hMapBatch);
            hMapBatch->clear(); - During iteration you should not cast the values back to Handles, but rather only to Views. It is not guaranteed that the cache will return non-const references to the data.
    I did validate that the test did not fail prior to making the above modifications.
    thanks,
    mark

  • Error #1023: Stack overflow occurred. null

    I am entering data inside a datagrid and I have an update button which sends data to a web service.  But when I click the update button, I get this error: Error #1023: Stack overflow occurred. null.  I filled in the info using SOAPUI and sent it to the web service and it works fine.  So this error is inside flex.  Would you help me understand what I am doing wrong.
    Here is my code:
                protected function updateBtn_clickHandler(event:MouseEvent):void
                    if (currentState == "EmployeeNonAvails")
                        setNonAvailResult.token = personnelBean.setNonAvail(nonAvailDto);
                    else if (currentState == "EmployeeDetail")
                        userDto.firstName = firstNameTextInput.text;
                        userDto.lastName = lastNameTextInput.text;
                        userDto.loginName = loginNameTextInput.text;
                        userDto.password = passwordTextInput.text;
                        setUserResult.token = personnelBean.setUser(userDto);
        <fx:Declarations>
            <personnelbean:PersonnelBean id="personnelBean" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
            <valueObjects:UserDto id="userDto"/>
            <valueObjects:NonAvailDto id="nonAvailDto"/>
            <valueObjects:ReasonDto id="reasonDto"/>
            <s:CallResponder id="setNonAvailResult"/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:Button id="updateBtn" includeIn="EmployeeNonAvails,EmployeeDetail" x="80" y="192" label="Update" click="updateBtn_clickHandler(event)"/>
        <mx:DataGrid id="nonAvailDg" width="875" height="248" editable="true" x="0" y="244"
                     dataProvider="{userDto.nonAvails}" includeIn="EmployeeNonAvails">

    PersonnelBean is a reference generated by Flash Builder to a web Service.  As stated in my original message.  I have already tested the web service and it is working fine.  I used SOAPUI to send the data via XML and it worked perfectly fine.  Besides, when I watch the server log, nothing happens and so Flex is not even sending out the message.  Flex is talking to the server because it connects and loads data fine.  It seems to fail when I want to send data to the server.  But it is failing before it actually sends the data.  And it fails during generated code.  This tells me there is a bug in Flash Builder.  If you look at the generated code for Personnel Bean this is what you see.
    [ExcludeClass]
    internal class _Super_PersonnelBean extends com.adobe.fiber.services.wrapper.WebServiceWrapper
        // Constructor
        public function _Super_PersonnelBean()
            // initialize service control
            _serviceControl = new mx.rpc.soap.mxml.WebService();
            var operations:Object = new Object();
            var operation:mx.rpc.soap.mxml.Operation;
            operation = new mx.rpc.soap.mxml.Operation(null, "setNonAvail");
             operation.resultType = valueObjects.NonAvailDto;
            operations["setNonAvail"] = operation;
            _serviceControl.operations = operations;
            try
                _serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
            catch (e: Error)
            { /* Flex 3.4 and eralier does not support the convertResultHandler functionality. */ }
            _serviceControl.service = "PersonnelBeanService";
            _serviceControl.port = "PersonnelBeanPort";
            wsdl = "http://localhost:8080/PersonnelBeanService/PersonnelBean?wsdl";
            model_internal::loadWSDLIfNecessary();
            model_internal::initialize();
          * This method is a generated wrapper used to call the 'setNonAvail' operation. It returns an mx.rpc.AsyncToken whose
          * result property will be populated with the result of the operation when the server response is received.
          * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value.
          * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
          * @see mx.rpc.AsyncToken
          * @see mx.rpc.CallResponder
          * @return an mx.rpc.AsyncToken whose result property will be populated with the result of the operation when the server response is received.
        public function setNonAvail(arg0:valueObjects.NonAvailDto) : mx.rpc.AsyncToken
            model_internal::loadWSDLIfNecessary();
            var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("setNonAvail");
            var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(arg0) ;
            return _internal_token;

  • Unrecoverable Stack Overflow

    Hi there,
    I have a thread that does various things including hibernate transactions. After everything is done it calls the run method again so its a endless loop. Inside the run function there are a couple of loops. After running this thread for a day I get this error, what does it mean?
    Unrecoverable Stack Overflow: addr=403d3a26, ee=8401b80, er=430fdb00
    JVMDG217: Dump Handler is Processing a Signal - Please Wait.
    JVMDG303: JVM Requesting Java core file
    kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
    kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]

    I have a thread that does various things including
    hibernate transactions. After everything is done it
    calls the run method again so its a endless loop.Are you seriously saying that the run() method calls itself, like in public run() {
        run();
    }This would not be an endless loop, but an infinite recursion and the stack overflow is not at all surprising. If this is your only bug then rewrite topublic run() {
      while( true ) {
    }and everything will be just fine.
    Harald.

  • Bypassing cache = stack overflow

    Hi,
    I have the same problem as the guy who posted 2 days ago. I need to effectively bypass the cache due to updates from 'outside'. We already tried the option with 'Always Refresh' and 'Disable Cache Hits'. Unfortunately this results in a stack overflow exception. This is what probably happens:
    We have two classes User and UserRole. UserRole references User, User has a collection of UserRole instances, i.e. circular referencing. Both classes are configured to bypass the indentity cache. (A separate tool is used to manage users and user roles.) When trying to find one special User instance TopLink recurses back and forth between User and UserRole desperately trying to resolve all references ending up in a stack overflow exception.
    Any means to stop that behaviour?
    Regards

    Yeah, you shouldn't use both Always Refresh and Disable Cache Hits on both directions of a circular relationship. If you turn off the disable cache hits for the source class of the 1-M, it should be Ok.
    Disable Cache Hits tells TopLink to even go to the database for PK based queries, where normally it would just hit the cache, and this is getting called when setting up the back reference from the targets of the 1-M.
    My advice to customers is usually to ignore this Refreshing Cache Options feature in the Mapping Workbench, and explicitly do refreshing on a per-query as needed basis in code when you create your ReadObject/ReadAll query... That way you have a finer grained control over when to do refreshes. But, it's always, then no problems doing it in the MW...
    - Don

  • What causes a stack overflow with this code?

    VerifyError: Error #1023: Stack overflow occurred.
    //======================================================================================== =================================================
    //     stop audio or video function
    //======================================================================================== =================================================
    function stopAV(nextButton:String):void {
    if(currentPageMC == page_1){
      var introClip:MovieClip = MovieClip(root).page_1.introMC;
      introClip.clearStage(introClip);
    else if(currentPageMC == page_2){
      var secIClip:MovieClip = MovieClip(root).page_2.sectionIMC;
      secIClip.clearStage(secIClip);
    else if(currentPageMC == page_3){
      var gameClip:MovieClip = MovieClip(root).page_3.gameMC;
      gameClip.clearStage(gameClip);
    else if(currentPageMC == page_4){
      var secIIClip:MovieClip = MovieClip(root).page_4.sectionIIMC;
      secIIClip.clearStage(secIIClip);
    else if(currentPageMC == page_5){
      var closeClip:MovieClip = MovieClip(root).page_5.closeMC;
      closeClip.clearStage(closeClip);
    else{
      trace("confused at stop av function");
    //showChildren(stage, 0);
    trace(nextButton);
    setupNextPage(nextButton);

    It appears that one of the clearStage functions which exists in a loaded swf had an error. I was able to track it down and now it works.
    Thanks

  • "Stack overflow" & "out of memory"

    Hello,
    I have an issue with javascript code : with my own navigation, which includes additional javascript, I have either a "out of memory" error on the declaration of "var strUrl = http://..." in the CommonOpener_CreateExtObject method, or a "stack overflow" error on the onload="document.PCC.RaiseWindowEvent(event);" event handling in the <body> tag.
    When I save the page as HTML and remove the onload event, no error happens anymore.
    I think I could remove the onload event generation by modifying the C# code, but it would certainly disable some other feature (I think this event is managing PEI calls or something else).
    Any idea on how to fix this ?
    P.S : I'm on a .NET platform, I'm going to try to recompile my nav on a java platform to see if it works...

    Sebastien,
    - Are you using 5.0.1 or 5.0.2?
    - Are you by any chance trying to extend the Isomorphic navigation (under 5.0.2, it's called "legacy")?
    I would carefully review the pluggable nav you're using and double-check you're including all the necessary javascript in the JavaScriptIncludes() method to make sure you're basically adding everything properly.
    The isomorphic nav was particularly hard to extend because it required you add a special DHTML element to close off the menus being inserted. If you base your work off of our new jsportalmenus nav, it's much easier to work with and more reliable: it injects javascript into a named DOM element, which in our case is just a <TD id='name'></TD>; the menu gets inserted in the table cell.
    At a minimum, try debugging your javascript bug using Microsoft's script debugger (downloadable from microsoft.com). You should be able to determine precisely why there is a failure; comapre your code to the original nav you started from and carefully pick out what could be different.
    The onload events and the PCC are critical to normal function of the portal. Sgutting that off isn't an option, in my mind. If you wanted to, you'd need to do some pretty major surgery on the portal, and thaqt wouldn't upgrade, either.
    David Phipps
    Plumtree Software

Maybe you are looking for

  • Help with multiple users in iTunes

    Dear all I seem to have made a right mess of iTunes. It all started with my 80gb Classic ipod and iTunes on my Toshiba Windows 8 laptop. All was fine then my daughter got an iPod touch and I think here was where I made my first mistake. I setup a new

  • How to get wide report

    hi, i m working on oracle reports 10g , i m making a reports which has many columns when i run report i see that columns r coming down , so how can i set my report to get all column on same line , like A B C D E F G H I J K i want like this A B C D E

  • Problem with Optimizing PDFs

    I have a client who wants us to make sure PDF files are compatible with Adobe 6.0 and later (I just got them to change that from 4.0!). When I generate the PDF file, I get a file that is compatible with 6.0 and later but when I save the file PDF file

  • Global Address List Question

    Where does the GAL get the e-mail address from? I'm a little confused with a problem we have. Scenario: User has an AD account that is mail enabled with a mailbox attached to it. Our Identity Management system is updating the AD account's mail attrib

  • Jpeg stuck on desktop!!

    I just used Internet Explorer to download a Jpeg off the internet. I used the same method I use every time, by dragging the image from the browser window onto the desktop. I could tell it didn't download completely, but now when I try to double click