Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Catch Exceptions of screenlets
Hi!I user an assetlist screenlet to display items. When the session is expired the screenlet is throw an Exception:
LiferayScreens: Error loading list
java.lang.IllegalStateException: You need to be logged in to get a session
at com.liferay.mobile.screens.context.SessionContext.createSessionFromCurrentSession(SessionContext.java:79)
at com.liferay.mobile.screens.base.interactor.BaseInteractor.getSession(BaseInteractor.java:102)
at com.liferay.mobile.screens.asset.list.interactor.AssetListInteractor.getEntries(AssetListInteractor.java:85)
at com.liferay.mobile.screens.asset.list.interactor.AssetListInteractor.execute(AssetListInteractor.java:56)
at com.liferay.mobile.screens.base.list.interactor.BaseListInteractor.online(BaseListInteractor.java:173)
at com.liferay.mobile.screens.base.interactor.BaseCacheReadInteractor$1.run(BaseCacheReadInteractor.java:65)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
I added the BaseListListener to assetlistscreenlet, but the error method is never invoked.How can I catch that exception?
If you are running this as a thread, you must realize that much of the initialization context available during an incoming request will not have been in place in your thread context. It will be up to you to fully initialize your context within the scope of the thread.
Strange... I just tried with the sample App and the asset list activity and I get the error method @Override public void onListPageFailed(int startRow, Exception e) { called
Sorry, I didn't catch that this was in mobile...
I'll see if I can find someone to help...
I'll see if I can find someone to help...