Issues

ZF-11446: Class "xxx" does not exist: Plugin by name 'yyy' was not found in the registry; used paths:

Description

I am facing a problem regarding the usage of the flex libraries on a server on which the zend framework is not installed. I simply place the zend libraries inside a folder and reference them as php includes. I supposed this system to work on he flex project I am developing. This project works on my local machine and on some servers in which the flex framework is installed.

I have a service endpoint file which is called serviceEP.php where all the classes are set with $server->setClass. $server->handle() generates the following error:

Here is the fault string:

Class "servicesEP" does not exist: Plugin by name 'ServicesEP' was not found in the registry; used paths:

Please note that ServiceEP is named with the first letter in capitals while in no place my project has this name in capitals. Renaming all references in project to ServiceEP (with "S") instead of "s" does not solve the issue.

Here are the fault details:

0 /web/htdocs/mythirdlevel.mydomain.it/home/myServicesFolder/Zend/Amf/Server.php(554): Zend_Amf_Server->_dispatch('login', Array, 'servicesEP')

1 /web/htdocs/mythirdlevel.mydomain.it/home/myServicesFolder/Zend/Amf/Server.php(630): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))

2 /web/htdocs/mythirdlevel.mydomain.it/home/myServicesFolder/servicesEP.php(81): Zend_Amf_Server->handle()

3 {main}

I have searched a lot on the web and found many occurrences of the issue (also on in this bug tracker) but did not find a solution to this problem.

Comments

The warning you're getting is that it's trying to use a class named "servicesEP", and it can't find it.

In order to diagnose this any further, I'd need to see how you're calling setClass(), and some knowledge of how your classes are being loaded (are you providing a path to services to Zend_Amf_Server? what files are in that path? what classes are in those files? do you have any autoloaders in play? etc.)

Please provide this information so we can better diagnose whether or not an actual issue is present, or if this is simply a configuration problem.

Thanks for your answer Mattew,

This code usually works on other severs and on my local machine. The only difference is that in this server zend framework is not shown in phpinfo but I included the libraries.

Here is how i link the libraries:(this is the servicesEP.php file)

//zend framework inclusion require_once 'Zend/Amf/Server.php'; require_once 'Zend/Auth.php'; require_once 'Zend/Auth/Adapter/DbTable.php';

Here is how I include the file contaning the servi

//web services files inclusions require_once 'services/AMFAuth.php';// AMF services instance $server = new Zend_Amf_Server(); $server->setProduction(false);

//adding classes to zend amf server $server->setClass("AMFAuth");

//sending the handle echo($server->handle());

This other is my auth class included in services/AMFAuth:

<?php /** * Authentication management services * @abstract Authentication management services * @access public * @author paolo anghileri @ antesitum */ if (0 > version_compare(PHP_VERSION, '5')) { die('This file was generated for PHP 5'); }

class AMFAuth { /** * Login management *@abstract Login management * @name login * @method login * @param string $user * @param string $password */ public function login($user,$password) {

    $db = Zend_Db::factory('MySqli',array(
        'host'     => DB_IP,  
        'username' => DB_USER,  
        'password' => DB_PWD,  
        'dbname'   => DB_NAME  
        )
    );

    $authAdapter  = new Zend_Auth_Adapter_DbTable($db);  
    $authAdapter->setTableName('operators');  
    $authAdapter->setIdentityColumn('loginName');  
    $authAdapter->setCredentialColumn('loginPwd');  
    $authAdapter->setIdentity($user);  
    $authAdapter->setCredential(md5($password));  
    $auth = Zend_Auth::getInstance();  

    $result = $auth->authenticate($authAdapter);

    if ($result->isValid()) {
        $data = $authAdapter->getResultRowObject(null, 'password'); 
        $auth->getStorage()->write($data);
        return $data;
    }
    else {
        throw new Exception('Autenticazione fallita');
    }
}

}

One other problem I noticesd on this server is that if I call servicesEP from the browser, the browser asks to save the file instead of displaying its content. If I save the file and open it in an editor the content is "

Zend AMF services

", so it seems correct and no inclusion errors or ther kind of errors are displayed.

Thanks a lot for your help Mattew.

Paolo

I am having the exact same problem. When I migrated my Flex/PHP project from my local Apache/PHP (running on Windows 7) to a hosted linux system, I get the same error: Class "clsPeople" does not exist: Plugin by name 'ClsPeople' was not found in the registry; used paths: /user/www/MyAppName/

I do not have a file or class named "ClsPeople" (upper case C). Every instance of my names are the same - lowercase cls plus 'capitalized' object name, i.e., clsPeople. I have seen this bug reported in other places on the web. Is there anything we can do here?

Plugin class and file names must both start with a capital letter