开发者

Help with Error 1061 - Call to a possibly undefined method

开发者 https://www.devze.com 2023-03-24 22:44 出处:网络
First off, here\'s the exact error I\'m getting: Error 1061: Call to a possibly undefined method _initRemoteClassAlias through a reference with a static type Class

First off, here's the exact error I'm getting:

Error 1061: Call to a possibly undefined method _initRemoteClassAlias through a reference with a static type Class

So, that being said, here's what I think I know about that. It is tying to call a method named _initRemoteClassAlias but cannot find it. So here's my guess where my confusion/problem comes in. The method it is trying to call was created automatically by FlashBuilder in the _Super Class of a PHP script I have written. (in this case the error is stemming from : services.cascobackend._Super_CASCOBackend.as) - Here's the first little bit of code from the _Super Class in question:

package services.cascobackend
{
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
import com.adobe.serializers.utility.TypeUtility;
import mx.rpc.AbstractOperation;
import mx.rpc.AsyncToken;
import mx.rpc.remoting.Operation;
import mx.rpc.remoting.RemoteObject;
import valueObjects.Ticket;

import mx.collections.ItemResponder;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

[ExcludeClass]
internal class _Super_CASCOBackend extends com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper
{

// Constructor
public function _Super_CASCOBackend()
{
    // initialize service control
    _serviceControl = new mx.rpc.remoting.RemoteObject();

    // initialize RemoteClass alias for all entities returned by functions of this service
    valueObjects.Ticket._initRemoteClassAlias();

    var operations:Object = new Object();
    var operation:mx.rpc.remoting.Operation;

    operation = new mx.rpc.remoting.Operation(null, "throwExceptionOnError");
     operation.resultType = Object;
    operations["throwExceptionOnError"] = operation;
    operation = new mx.rpc.remoting.Operation(null, "getTicketsByUser");
     operation.resultElementType = valueObjects.Ticket;
    operations["getTicketsByUser"] = operation;

    _serviceControl.operations = operations;
    _serviceControl.convertResultHandler = com.adobe.serializers.utility.TypeUtility.convertResultHandler;
    _serviceControl.source = "CASCOBackend";
    _serviceControl.endpoint = "http://localhost/CMphp/public/gateway.php";


     preInitializeService();
     model_internal::initialize();
}

And the specific line the error is happening at is:

valueObjects.Ticket._initRemoteClassAlias();

In the application I have made (obviously) a value object named Ticket that beings like this:

package valueObjects
{
[Bindable]
[RemoteClass(alias="Ticket")]

public class Ticket
{
        public var ticketid:int;
        public var ticketNumber:String;
etc...
etc...

The PHP function that it is referencing simply grabs all items with certain parameters and returns a Ticket[] array with the results as individual Ticket items like this:

...
        mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();

    $rows = array();
    $row = new Ticket();

    mysqli_bind_result($stmt, $row->ticketid, etc...

Also - when I run the test of this function in FlashBuilder it returns the items just as I expect, even WITH the error about the _initRemoteClassAlias showing. And if I simply comment out that line in question the code just doesn't return anything when ran (it still returns values when tested in FB though)

So - I've messed with this for HOURS and looked around for answers, but I am out of ideas. Hopefully you have some!

Thanks in advance for your help! -CS

EDIT:::EDIT:::

Okay - here's the ENTIRE _Super code that Flex created:

    /**
 * This is a generated class and is not intended for modification.  To customize  behavior
 * of this service wrapper you may modify the generated sub-class of this class - CASCOBackend.as.
 */
 package services.cascobackend
 {
 import com.adobe.fiber.core.model_internal;
 import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
 import com.adobe.serializers.utility.TypeUtility;
 import mx.rpc.AbstractOperation;
 import mx.rpc.AsyncToken;
 import mx.rpc.remoting.Operation;
 import mx.rpc.remoting.RemoteObject;
 import valueObjects.Ticket;

 import mx.collections.ItemResponder;
 import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

 [ExcludeClass]
 internal class _Super_CASCOBackend extends                com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper
 {

     // Constructor
     public function _Super_CASCOBackend()
     {
    // initialize service control
    _serviceControl = new mx.rpc.remoting.RemoteObject();

    // initialize RemoteClass alias for all entities returned by functions of this service
    valueObjects.Ticket._initRemoteClassAlias();

    var operations:Object = new Object();
    var operation:mx.rpc.remoting.Operation;

    operation = new mx.rpc.remoting.Operation(null, "throwExceptionOnError");
     operation.resultType = Object;
    operations["throwExceptionOnError"] = operation;
    operation = new mx.rpc.remoting.Operation(null, "getTicketsByUser");
     operation.resultElementType = valueObjects.Ticket;
    operations["getTicketsByUser"] = operation;

    _serviceControl.operations = operations;
    _serviceControl.convertResultHandler = com.adobe.serialize开发者_如何学运维rs.utility.TypeUtility.convertResultHandler;
    _serviceControl.source = "CASCOBackend";
    _serviceControl.endpoint = "http://localhost/CMphp/public/gateway.php";


     preInitializeService();
     model_internal::initialize();
}

//init initialization routine here, child class to override
protected function preInitializeService():void
{
    destination = "CASCOBackend";

}


/**
  * This method is a generated wrapper used to call the 'throwExceptionOnError' 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 throwExceptionOnError(link:Object) : mx.rpc.AsyncToken
{
    var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("throwExceptionOnError");
    var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(link) ;
    return _internal_token;
}

/**
  * This method is a generated wrapper used to call the 'getTicketsByUser' 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 getTicketsByUser(userid:Object) : mx.rpc.AsyncToken
{
    var _internal_operation:mx.rpc.AbstractOperation = _serviceControl.getOperation("getTicketsByUser");
    var _internal_token:mx.rpc.AsyncToken = _internal_operation.send(userid) ;
    return _internal_token;
    }

}

}


Simple enough, _initRemoteClassAlias() is not part of Ticket, or that it's not static public.

I don't know who made the code, but it's not following any standards that I can see.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号