Zend_Auth and Zend_Namespace Session Error - zend-framework

I'm developing an application, everything works fine but sometimes i get the following error:
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()' in /usr/share/php/libzend-framework-php/Zend/Session.php:462 Stack trace: #0 /usr/share/php/libzend-framework-php/Zend/Session/Namespace.php(143): Zend_Session::start(true) #1 /var/vhosts/rmanager.vsnetwork.net/application/views/helpers/GetProjetoNome.php(7): Zend_Session_Namespace->__construct('rmanager') #2 [internal function]: Zend_View_Helper_GetProjetoNome->GetProjetoNome() #3 /usr/share/php/libzend-framework-php/Zend/View/Abstract.php(342): call_user_func_array(Array, Array) #4 /var/vhosts/rmanager.vsnetwork.net/application/layouts/scripts/layout.phtml(73): Zend_View_Abstract->__call('GetProjetoNome', Array) #5 /var/vhosts/rmanager.vsnetwork.net/application/layouts/scripts/layout.phtml(73): Zend_View->GetProjetoNome() #6 /usr/share/php/libzend-framework-php/Zend/View.php(108): include('/var/vhosts/rma...') #7 /usr/share/php/libzend-framework-php/Zend/View/Abstract.php(880) in /usr/share/php/libzend-framework-php/Zend/Session.php on line 462
If i refresh the page, it works.
Sometimes it returns me the error while i send post to the same page
I'm using Zend_Auth and Zend_Acl inside a plugin and Zend_Namespace in various places of my application.
Does anyone has idea why it is happing?
Thanks

It's kinda hard to help you with so little information, but as far as i read ealier this week when i play with session_namespace, you have to be very careful with it.
This paragraph has been very helpful for me

Don't ever start the session explicitly. Just use it automatically. I also use Zend_Auth and Zend_Sesison_Namespace many times but that error never comes.

Related

Magento Error (ReflectionException): Class Unirgy\DropshipMicrosite\Helper\ProtectedCode does not exist

When I run my Magento 2 store, I get a white page with a whole lot of text, and then at the bottom I have this error. The Unirgy modules have cause us a lot of headaches so far. Does anyone know what's going on here?
1 exception(s): Exception #0 (ReflectionException):
Class Unirgy\DropshipMicrosite\Helper\ProtectedCode
does not exist Exception #0 (ReflectionException):
Class Unirgy\DropshipMicrosite\Helper\ProtectedCode does not exist
#1 Magento\Framework\Code\Reader\ClassReader->getConstructor() called
at [vendor/magento/framework/ObjectManager/Definition/Runtime.php:54]
#2 Magento\Framework\ObjectManager\Definition
\Runtime->getParameters() called at [vendor/magento/framework
/ObjectManager/Factory/Dynamic/Developer.php:48]
#3 Magento\Framework\ObjectManager\Factory\Dynamic
\Developer->create() called at [vendor/magento/framework
/ObjectManager/ObjectManager.php:70]
#4 Magento\Framework\ObjectManager\ObjectManager->get() called at
[app/code/Unirgy/Dropship/Helper/Data.php:2590]
#5 Unirgy\Dropship\Helper\Data->getObj() called at [app/code/Unirgy
/DropshipMicrosite/Helper/Data.php:123]
#6 Unirgy\DropshipMicrosite\Helper\Data->_msHlpPr() called at
[app/code/Unirgy/DropshipMicrosite/Helper/Data.php:155]
#7 Unirgy\DropshipMicrosite\Helper\Data->getCurrentVendor() called at
[app/code/Unirgy/DropshipMicrosite/Plugin/AppHttp.php:23]
#8 Unirgy\DropshipMicrosite\Plugin\AppHttp->beforeLaunch() called at
[vendor/magento/framework/Interception/Interceptor.php:121]
#9 Magento\Framework\App\Http\Interceptor->Magento\Framework
\Interception\{closure}() called at [vendor/magento/framework
/Interception/Interceptor.php:153]
#10 Magento\Framework\App\Http\Interceptor->___callPlugins() called
at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#11 Magento\Framework\App\Http\Interceptor->launch() called at
[vendor/magento/framework/App/Bootstrap.php:263]
#12 Magento\Framework\App\Bootstrap->run() called at
[pub/index.php:40]
Please check is this file available in you module
Class Unirgy\DropshipMicrosite\Helper\ProtectedCode
or Is there any grammatical error in file name

ajax javascript data not display in zend framework And display error

I want fetch data from database using ajax/javascript in zend framework. but the error is display..
Fatal error: Uncaught exception 'Zend_View_Exception' with message
'script 'attendancelist/monthleave.html' not found in path
(./application/views/scripts/)' in
/var/www/html/projects_prolive/library/Zend/View/Abstract.php:988
Stack trace: #0
/var/www/html/projects_prolive/library/Zend/View/Abstract.php(884):
Zend_View_Abstract->_script('attendancelist/...') #1
/var/www/html/projects_prolive/library/Zend/Controller/Action/Helper/ViewRenderer.php(900):
Zend_View_Abstract->render('attendancelist/...') #2
/var/www/html/projects_prolive/library/Zend/Controller/Action/Helper/ViewRenderer.php(921):
Zend_Controller_Action_Helper_ViewRenderer->renderScript('attendancelist/...',
NULL) #3
/var/www/html/projects_prolive/library/Zend/Controller/Action/Helper/ViewRenderer.php(960):
Zend_Controller_Action_Helper_ViewRenderer->render() #4
/var/www/html/projects_prolive/library/Zend/Controller/Action/HelperBroker.php(277):
Zend_Controller_Action_Helper_ViewRenderer->postDispatch() #5
/var/www/html/projects_prolive/library/Zend/Controller in
/var/www/html/projects_prolive/library/Zend/View/Abstract.php on line
988
How to Fix It??
Try to disable your layout with
$this->_helper->viewRenderer->setNoRender(true);
$this->view->layout()->disableLayout();

SIGKill Without warning or stack trace with NSLogv

I know this is a somewhat vague question, but during debug execution, the app I'm working on dies without any stacktrace or warning and with simply this message in the debug console:
Program received signal: “SIGKILL”.
I have NSZombieEnabled, NSDebugEnabled, MallocStackLoggingNotCompact and MallocStackLogging all set within XCode.
I've run Instruments to check for memory leaks with none reported.
The last place I can step into with the debugger after it reports that the "GDB: Interrupted" is this piece of code where NSLogv is invoked:
+ (void)print:(NSString *)format, ...
{
va_list args;
va_start(args, format);
// Doesn't seem to go past this line
NSLogv(format, args);
va_end(args);
}
But this method is invoked many a times throughout the app and no problem in any where until at some point after I've used the app long enough.
The stack shown through the debugger thereafter is:
#0 0x02592e07 in ___forwarding___
#1 0x02592cd2 in __forwarding_prep_0___
#2 0x000ce57f in _NSDescriptionWithLocaleFunc
#3 0x0260b00d in __CFStringAppendFormatCore
#4 0x02552f87 in _CFStringCreateWithFormatAndArgumentsAux
#5 0x025da36e in _CFLogvEx
#6 0x0014beb5 in NSLogv
Upon re-testing over and over again, the SIGKILL consistently happens with the call to NSLogv and no where else.
What else can I turn or set to figure out why the debugger is terminating the instance of the app?
Check the format string and the arguments supplied are the correct type, for instance with a format string of #"%f" and argument of #"hello", this would crash....

help Zend_Registry drops key lang out

can't figure out, why does key lang disappears between language plugin and matched custom route. I'm calling registry from inside model, which is requested inside custome route.
http://pastie.org/1088574
Message: No entry is registered for key 'lang'
Stack trace:
#0 C:\xampp\xampp\htdocs\chat\application\models\Getcategories.php(15): Zend_Registry::get('lang')
#1 C:\xampp\xampp\htdocs\chat\library\Routes\Categories.php(64): Getcategories->__construct()
#2 C:\xampp\xampp\htdocs\chat\library\Zend\Controller\Router\Rewrite.php(398): Routes_Categories->match('/ru/woman-searc...')
#3 C:\xampp\xampp\htdocs\chat\library\Zend\Controller\Front.php(911): Zend_Controller_Router_Rewrite->route(Object(Zend_Controller_Request_Http))
#4 C:\xampp\xampp\htdocs\chat\library\Zend\Controller\Front.php(212): Zend_Controller_Front->dispatch()
#5 C:\xampp\xampp\htdocs\chat\application\Bootstrap.php(65): Zend_Controller_Front::run('C:\xampp\xampp\...')
#6 C:\xampp\xampp\htdocs\chat\public\index.php(34): Bootstrap->run(Array)
#7 {main}
I have checked inside language plugin, it registers lang key fine.
Zend_Registry::get('lang') inside route throws exception as well.
Make sure the Registry-Key is set in Plugins_LangSelector::routeStartup() so it will be registered before processing the routes.
From the ZF-Manual: Plugins
routeStartup() is called before Zend_Controller_Front calls on the router to evaluate the request against the registered routes.
If you set the key in routeShutdown(), preDispatch(), postDispatch() or dispatchLoopShutdown() it is to late.

Zend Framework Deleting through a data mapper module.

I am still having problems getting table relationships defined, and have just changed the relationship between users and comment classes as advised, but when I went to test I got a new error.
C:\wamp\www\megashare\application\models\UsersMapper.php
public function deleteUser($id, Default_Model_Users $users){
$usersTable = new Default_Model_DbTable_Users();
$usersRowset = $usersTable->find( $id );
$userToDelete = $usersRowset->current();
$userToDelete->delete();
}
Generates the following error:
Zend Error Type: EXCEPTION_OTHER
REQUEST_URI: /megashare/public/users/delete/userId/14
Stack trace:
#0 C:\wamp\www\megashare\application\models\UsersMapper.php(104): Zend_Db_Table_Row_Abstract->delete()
#1 C:\wamp\www\megashare\application\models\Users.php(761): Default_Model_UsersMapper->deleteUser(14, Object(Default_Model_Users))
#2 C:\wamp\www\megashare\application\controllers\UsersController.php(112): Default_Model_Users->deleteUser(14)
#3 C:\wamp\www\megashare\library\Zend\Controller\Action.php(512): UsersController->deleteAction()
#4 C:\wamp\www\megashare\library\Zend\Controller\Dispatcher\Standard.php(288): Zend_Controller_Action->dispatch('deleteAction')
#5 C:\wamp\www\megashare\library\Zend\Controller\Front.php(936): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#6 C:\wamp\www\megashare\library\Zend\Application\Bootstrap\Bootstrap.php(77): Zend_Controller_Front->dispatch()
#7 C:\wamp\www\megashare\library\Zend\Application.php(303): Zend_Application_Bootstrap_Bootstrap->run()
#8 C:\wamp\www\megashare\public\index.php(31): Zend_Application->run()
#9 {main}
I dont know why, but this error has stopped now. There is nothing wrong with the code in this sample. There are other issues which are not related to this question. Therefore consider this question answered. I think the underlying model class definitions must have been unworkable.