9 Replies Latest reply on May 19, 2011 12:28 PM by Flex harUI

    Error #1023: Stack overflow occurred. null

    Michelle5002

      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">

        • 1. Re: Error #1023: Stack overflow occurred. null
          Michelle5002 Level 1

          Added a try catch and still the same message.  No Stack trace btw

           

                              try
                              {
                                  setNonAvailResult.token = personnelBean.setNonAvail(nonAvailDto);
                              }
                              catch(error:StackOverflowError)
                              {
                                  Alert.show(error.message);
                                  Alert.show(error.getStackTrace());
                              }

          • 2. Re: Error #1023: Stack overflow occurred. null
            Flex harUI Adobe Employee

            I don't think you can catch a stackoverflow.  Why do you think it is in that

            method?  Is there callstack info in the error?

            • 3. Re: Error #1023: Stack overflow occurred. null
              Michelle5002 Level 1

              Because I didnt get the error until I added the post to the web service for NonAvails

              • 4. Re: Error #1023: Stack overflow occurred. null
                Flex harUI Adobe Employee

                Then I would debug that code and see why it blows up the stack.  Maybe it is

                recursive?

                • 5. Re: Error #1023: Stack overflow occurred. null
                  Michelle5002 Level 1

                  Debug what.  That code was generated by Flash Builder 4

                  • 6. Re: Error #1023: Stack overflow occurred. null
                    Flex harUI Adobe Employee

                    PersonnelBean should still have some debuggable code in it.

                    • 7. Re: Error #1023: Stack overflow occurred. null
                      Michelle5002 Level 1

                      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;
                          }

                      • 8. Re: Error #1023: Stack overflow occurred. null
                        Michelle5002 Level 1

                        Okay so here is the answer

                         

                        I was using a DataGrid which displayed a list of Users  UserDto which is referenced by bindable reference userDto.

                         

                        When I select a User, it populates a second DataGrid with that users NonAvails.  NonAvailDto which is referenced by a bindable reference nonAvailDto.

                         

                        Inside NonAvailDto, it references User in case you want to look at only NonAvails and see who the user is.

                         

                        So, when I was building the new NonAvail, I was assigning userDto, the bindable version to the nonAvailDto.user.  Well that is what caused the stack overflow

                         

                        The fix was that I created a new variable of type UserDto(not bound) and assigned the values of that variable the values of userDto(Bindable) and then assigned the variable to nonAvailDto.user and walla, everything worked.  I am guessing the problem was that the userDto was bound.  Bound to the first Datagrid and Flex didnt like that.

                        • 9. Re: Error #1023: Stack overflow occurred. null
                          Flex harUI Adobe Employee

                          There could in fact be a bug in the generated code.  The code you posted

                          shows calls to WebService and Operation, which should be debuggable.

                           

                          If you want to just wrap up your entire project and submit as a bug that's

                          fine, but your project probably connects to a specific server so we won't be

                          able to reproduce your test case.

                           

                          I am merely suggesting that you debug into what is going on to try to find

                          why it blows up the stack.  It might show that there is a problem in the

                          configuration that you can modify in order to make progress towards a

                          successfully running app.