JSF 2.2 misspelled redirect doesn't generate an error - redirect

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

Related

Disabling SPA at porlet level

I have an WAR style application that has been converted from Liferay 6.2 to 7.1. it needs to have SPA turned off and has been tested successfully when turning off SPA at the portal level but would like to turn off at the portlet level.
have tried adding the false property to the object in liferay-portlet.xml but the app doesn't load into Liferay correctly after that and complains.
this appears to be the recommended approach from https://portal.liferay.dev/docs/7-0/tutorials/-/knowledge_base/t/automatic-single-page-applications. there may be some "order" necessary to these properties? I can't determine exactly what that might be from this DTD https://docs.liferay.com/ce/portal/7.1-latest/definitions/liferay-portlet-app_7_1_0.dtd.html#single-page-application.
a further inspection of the error message that occurs when the portlet is loading provides help that indicates the properties order that should appear in the liferay-portlet.xml. I'm able to deploy the portlet without error now.
unfortunately, the portlet still does not act properly. its an EXTJs front end and there are consistent "The schema can only be reconfigured once" and "duplicate object" errors reported in the browser console. reloading the entire page works fine.
how might one start to debug this issue?
I disabled SPA in a WAR application by setting <single-page-application> to false in liferay-portlet.xml
See: https://github.com/jorgediaz-lr/index-checker/blob/master/docroot/WEB-INF/liferay-portlet.xml#L18
<portlet>
<portlet-name>index_checker</portlet-name>
<icon>/icon.png</icon>
<configuration-action-class>com.liferay.portal.kernel.portlet.DefaultConfigurationAction</configuration-action-class>
<control-panel-entry-category>
apps
</control-panel-entry-category>
<control-panel-entry-weight>1.5</control-panel-entry-weight>
<control-panel-entry-class>
jorgediazest.indexchecker.portlet.IndexCheckerControlPanelEntry
</control-panel-entry-class>
<preferences-company-wide>true</preferences-company-wide>
<preferences-unique-per-layout>false</preferences-unique-per-layout>
<single-page-application>false</single-page-application>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>
/js/main.js
</footer-portlet-javascript>
<css-class-wrapper>index_checker-portlet</css-class-wrapper>
</portlet>
If that setting is not working to you and causes errors, please copy your log traces with the problems.

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.

How to test an error page with Error 500 using 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.

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.