How to test an error page with Error 500 using Zend Framework - zend-framework

I am working on a project where client requires me to beautifully display error 500 with stacktrace etc.
So, I checked the Error Controller and made a nice fancy error page in corresponding views/script
The problem is, how do I test it?
Whilst working on the project, I cleared error on every page and there is no way I could generate it again. Also, I am using doctrine and I remember "echo-ing" the entitymanager array but, I cannot trace the location.
How would I custom generate error 500, "keeping it real"?
PS: I tried htaccess thing and trust me, it throws apache error and not zend 500.

It was pretty silly but, finally found it.
All I needed was to mis-spell a dql tablename on any page where I use querybuilder.

Related

JSF 2.2 misspelled redirect doesn't generate an error

I'm converting an app written in JSF 1.1/ADF faces to JSF 2.2 (Mojarra) /Primefaces and converting all of the faces-config navigations to inplace (implicit?).
I just spent two hours debugging why the redirect:
"blahbla?faces-redirect=true"
wasn't working. Turns out it was supposed to be
"blahblah?faces-redirect=true"
I'm not sure why I didn't get some sort of error. Web developer didn't show anything, nothing in the logs - and my logs are working fine. The only indication was a lack of an error message but nothing redirecting.
Searching, I found only this
You only need to keep in mind that the new JSF 2.0 provided implicit
navigation doesn't scan for the presence of the file,...
Migrating from JSF 1.2 to JSF 2.0
I guess I expected a "404" type of error if the redirect page didn't exist. I told the server to display a page that doesn't exist, so some error must of raised and then discarded somewhere?
Is there some setting - maybe in web.xml - that will help display this type of coding error? Or anything else?
I just need it for dev.
PS. I did check the file name by copying it from the code and pasting it into the term but I made the mistake of using tab completion and of course it completed. If I had just put .xhtml on the end I would have seen the missing char.
if it helps, I'm running Tomcat 7

PageExpiredException occurs after closing of ModalWindow

Currently I'm trying to upgrade the application from wicket 1.4 to wicket 6 and I'm stuck with the following issue:
When I try to close ModalWindow, it is closed but I receive PageExpiredException on the page where I was opening this ModalWindow, so I'm redirected to
/myapp/wicket/bookmarkable/org.apache.wicket.markup.html.pages.PageExpiredErrorPage
I thought maybe the way I create ModalWindow is outdated, so I've tried an example from here
http://www.wicket-library.com/wicket-examples-6.0.x/ajax/modal-window?0
and it gives me the same exception.
Maybe I have to configure something in my WebApplication implementation, but I don't know what.
If anyone could help, it'll be really appreciated. Thanks.
Check your server logs for errors related to the serialization of the opener page. PageExpiredException means that the page cannot be found in the page storage. If there was an error with the serialization then it won't be stored and thus later won't be found too.

Zend Error controller stopped working for 500

My Zend application was running fine until today, when I changed something which caused the error controller to stop working.
I have debugged every part of the code but I can not find any traces as to why is it happening
If I produce a 404 error, the error controller runs perfectly. But in case of 500, the control does not go to error controller.
I have tried many things but am still unable to find out what's wrong. I have searched the internet but people who encountered this problem, seemed to get no answer :(
Any help would be much appreciable
I have debugged the application step by step and found out that in case of 500, the execution stops instantly when it encounters a fatal error or exception
(UPDATE)
If I do something like...
$blabla->getInfo();
where $blabla is not defined, I don't get redirected to error controller.
But if I do something like...
Zend_Registry::get('blabla');
where no key is set for 'blabla' in Zend_Registry, then I get redirected
500 is a general server error, so no wonder the control does not go to your controller.
You will need to check your server logs to find out what is causing the error.
Also, try to recall whether you have altered your .htaccess file(s) recently and/or created an infinite redirect loop by accident.

Zend Log: Unexplained Error On Page Request

I'm working on a very custom project using the Zend Framework, where the application uses database driven routes, default routes disabled by default, and a module setup.
I've just created a Zend_Log writer, that logs application errors in the Database.
The thing is, I've got two unexplained errors:
5 NOTICE M:\Zend_Framework\library\Zend\Controller\Action.php Line 516 Page not found
5 NOTICE M:\Zend_Framework\library\Zend\Controller\Action.php Line 516 Request Parameters
I've had a look at the line in question and it just has $this->$action();, which doesn't help me!
Can anyone tell me how I can debug this further?
These are not complete errors. Your logging is somehow broken. We did something like this for our project earlier - you can as well log get/post params, stacktrace, etc.
This looks like someone request nonexistent action - something like /index/does-not-exist

symfony/zend integration - blank screen

I need to use ZendAMF on a symfony project and I'm currently working on integrating the two.
I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function:
// load symfony autoloading first
parent::initialize();
// Integrate Zend Framework
require_once('[MY PATH TO ZEND]\Loader.php');
spl_autoload_register(array('Zend_Loader', 'autoload'));
The executeIndex function my the gateway actions.class.php looks like this
// No Layout
$this->setLayout(false);
// Set MIME Type
$this->getResponse()->setContentType('application/x-amf; charset='.sfConfig::get('sf_charset'));
// Disable cause this is a non-html page
sfConfig::set('sf_web_debug', false);
// Create AMF Server
$server = new Zend_Amf_Server();
$server->setClass('MYCLASS');
echo $server->handle();
return sfView::NONE;
Now when I try to visit the url for the gateway module, or even the other module which was working perfectly fine until this attempt, I only see a blank screen, with not even the symfony dev bar loaded. Oddly enough, my symfony logs are not being updated as well, which suggests that Synfony is not even being 'reached'.
So presumably the error has something to do with Zend, but I have no idea how to figure out what the error could be. One thing I do know for sure is that this is not a file path error, because if I change the path in the following line (a part of frontendConfiguration as shown above), I get a Zend_Amf_Server not found error. So the path must be correct. Also if I comment out this very same line, the second module resumes to normality, and my gateway broadcasts a blank x-amf stream.
spl_autoload_register(array('Zend_Loader', 'autoload'));
Does anyone have any tips on how I could attach this problem?
Thanks
P.S. I'm currently running an older version of Zend, which is why I am using Zend_Loader instead of Zend_autoLoader (I think). But I've tried switching to the new lib, but the error still remains. So it's not a version problem as well.
got it...
I was not using
set_include_path()
while loading Zend. It's still odd that it would give such a cryptic error, but this was the missing piece indeed.