Zend model file "class not found" when not in the default application path

Posted on 2011-04-25
Last Modified: 2013-11-10
I have moved the model files and they are getting a: Class "Authacl_Model_UserService" not found (Zend Studio Alerts me to this fact) but the error message at the bottom also indicates this.  The controller files work fine, but the model and form directories do not work.

The program dies in the session.php.  I'll add the error message following all the text description.

I thought the following application.ini entry is all I should have to do:
;; RESOURCE MODULES and it's Path
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""

class name
from:  Application_Model_UserService  
to:   Authacl_Model_UserService

file name
from:  UserService.php  
to:   UserService.php

dir structure:
from:  application/models
to:     application/modules/authacl/models

Fatal error: 
Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - 
C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Loader.php(Line:146): 

Error #2 include_once() [<a href='function.include'>function.include</a>]: 
Failed opening [b]'Authacl\Model\CurrentUser.php[/b]' for inclusion 
C:\Program Files (x86)\ZendServer\share\ZendFramework\library') 
Array' in C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Session.php:493 

Stack trace: 
#0 C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Session\Namespace.php(143): 
#1 C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Auth\Storage\Session.php(87): 
#2 C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Auth.php(91): 
#3 C:\Program Files (x86)\ZendServer\share\ZendFramework\libr in 
  C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Session.php on line 493

Open in new window

Question by:MTTDev

    Expert Comment

    make sure you have included all files or include path in initialization or application file

    Author Comment

    If the controller files in my module are being picked up shouldn't the model files be picked up?  They are both subdirs of the same module

    Accepted Solution

    I added this to my bootstrap of the default module:  Seems to have solved the path issues problems.

    protected function _initResourceLoader ()
    		$resourceLoader = new Zend_Loader_Autoloader_Resource(
    			array('basePath'      => APPLICATION_PATH . 'modules/',
    			    'namespace'     => 'Authacl',
    				    'resourceTypes' => array(
    						'controller' => array(
    				            'path'      => 'controllers/',
    				            'namespace' => '',
    				    	'form' => array(
    				            'path'      => 'forms/',
    				            'namespace' => 'Form',
    				        'model' => array(
    				            'path'      => 'models/',
    				            'namespace' => 'Model',

    Open in new window


    Author Closing Comment

    Comments from the expert were correct in that during boot strapping something needed to to happen.  More direction and/or followup questions were required to be helpful in solving the problem.

    The code above was the answer to the problem.  No points were awarded.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now