1 Reply Latest reply on Nov 21, 2010 11:17 AM by corey.smart

    Channel Disconnected; Argument 1 passed to ___ must be an instance of...

    corey.smart

      I'm working thru the samples / tutorials from the Flex Developer Center and cannot seem to get things working for me.  Specifcally, trying to implement the example from this page: http://www.adobe.com/devnet/flex/articles/crud_flex_php_zend.html.  (PHP files I'm using are all linked from that page.)

       

      When I run the program, I can retrieve the data from my server, but I get a "Channel Disconnected" error message whenever I try to write something back to the server.

      20-11-2010 1-09-22 PM.png

      The error message I find in the log files is:

      PHP Catchable fatal error:  Argument 1 passed to ForestService::updateForest() must be an instance of NationalForest, instance of stdClass given in /var/www/myCRUD-debug/ForestService.php on line 71, referer: http://vs1/myCRUD-debug/anotherCRUD.swf/[[DYNAMIC]]/5

       

      This is consistent with the result I get when attempting to test the updateForest() function in Flash Builder.  Screenshots of the test are per below:

      21-11-2010 9-14-13 AM.pngleads to:21-11-2010 9-13-22 AM.png

      I've tried various different syntaxes for the established: field (date(), current_date, "19990101", all UPPER, all lower, etc.) as I wasn't positive I could rule that out.  (That said, I've noted that there is an error message at the bottom the input pane if things don't match what it believes the input to be.)

       

      I've looked at the php files and can find no obvious syntax errors, no "echo" and no "print" statements.  Also saw another post somewhere that suggested that it could be the port number I'm using, so have changed the ForestService.php file to point at localhost:3306.  All this is leading me to think that there must be something fundamentally wrong with my setup, but not sure what that is.  I can successfully pull data from the mySQL server, so I know the connection works.  (Data loads to the datagrid.)

       

      Issue occurs regardless of whether I use the canned example project (after updating the connection info in ForestService.php) or whether I build a new application from scratch.

       

      Development environment is:

      • Flash Builder 4 Premium (trial version) running on Windows 7
      • Apache 2.2, mySQL 5.1.49 and  PHP 5.3.3 all running on Ubuntu 10.1 as a VirtualBox guest on the Windows 7 machine.
      • libzend-framework-php was installed using apt-get, rather than letting Flash Builder automatically install things... I won't rule this out as an issue, as I was having trouble when Flash Builder did things automagically for me.  (Couldn't see the "Zend Amf Endpoint" statement as outlined in the tutorial.)
      • All of the .php and application files are held in /var/www/myCRUD-debug; I have the same results if the three .php files are in /var/www.

       

      I'm at a total loss...  Does anyone have a suggestion?  Thanks in advance!

       

      Corey

        • 1. Re: Channel Disconnected; Argument 1 passed to ___ must be an instance of...
          corey.smart Level 1

          Finally some success...  Went and had a coffee, got my mind off things and then tried again.

           

          I started from scratch one more time using the canned examples.  Seems the issue was related to the services-config.xml file.  I'd updated this to point to the index.php file on the server, but for some reason, the updated value was not being passed to the application when it compiles. Figured it out when I got an error message in the fresh start that pointed at the wrong location.

           

          Closed Flash Builder and restarted after verifying that the location was set correctly in services-config.xml.  This time when I ran the update script, it worked.  Validated that the changes were passed to the DB via an independent query and all is good!

           

          Now I just have to figure out how to make that work consistently and things should be good...

           

          Cheers,

          Corey