Fórum

Page needs a session and none is available

thumbnail
Ankit Chaudhari, modificado 9 Anos atrás.

Page needs a session and none is available

New Member Postagens: 20 Data de Entrada: 06/03/14 Postagens Recentes
21:33:26,502 ERROR [RuntimePageImpl-1][IncludeTag:129] Current URL null generates exception: java.lang.IllegalStateException: Page needs a session and none is available
java.lang.IllegalStateException: Page needs a session and none is available
at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:148)
at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:125)
at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:112)
at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:65)
at com.liferay.portal.kernel.servlet.JspFactoryWrapper.getPageContext(JspFactoryWrapper.java:63)
at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:419)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1636)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)


It seems this is one of the peculiar error happens while using session variables.

Has anyone found a fix for this? Appreciate any inputs.

Regards,
A
Tom Was, modificado 9 Anos atrás.

RE: Page needs a session and none is available

New Member Mensagem: 1 Data de Entrada: 12/08/14 Postagens Recentes
I have the same problem.
thumbnail
Ankit Chaudhari, modificado 9 Anos atrás.

RE: Page needs a session and none is available

New Member Postagens: 20 Data de Entrada: 06/03/14 Postagens Recentes
I got this fixed by adding
<private-session-attributes>false</private-session-attributes>
in liferay-portlet.xml
Traolly Xiong, modificado 9 Anos atrás.

RE: Page needs a session and none is available

Regular Member Postagens: 195 Data de Entrada: 30/12/11 Postagens Recentes
I am getting this error when adding the parameters to the "liferay-portlet.xml".

ex)

<portlet>
<portlet-name>your-requests</portlet-name>
<icon>/icon.png</icon>
<action-url-redirect>true</action-url-redirect>
<instanceable>false</instanceable>
<requires-namespaced-parameters>false</requires-namespaced-parameters>
<private-session-attributes>true</private-session-attributes>
<header-portlet-css>/css/main.css</header-portlet-css>
<css-class-wrapper>your-requests-portlet</css-class-wrapper>
</portlet>





Error:

08:54:24,309 ERROR [localhost-startStop-7][PortletLocalServiceImpl:840] com.liferay.portal.kernel.xml.DocumentException: Error on line 21 of document : The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-class?,staged-model-data-handler-class*,template-handler?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class*,social-request-interpreter-class?,user-notification-definitions?,user-notification-handler-class*,webdav-storage-token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-collection-adapter*,custom-attributes-display*,ddm-display?,permission-propagator?,trash-handler*,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,requires-namespaced-parameters?,action-timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)". Nested exception: The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-class?,staged-model-data-handler-class*,template-handler?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class*,social-request-interpreter-class?,user-notification-definitions?,user-notification-handler-class*,webdav-storage-token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-collection-adapter*,custom-attributes-display*,ddm-display?,permission-propagator?,trash-handler*,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,requires-namespaced-parameters?,action-timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)".
com.liferay.portal.kernel.xml.DocumentException: Error on line 21 of document : The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-class?,staged-model-data-handler-class*,template-handler?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class*,social-request-interpreter-class?,user-notification-definitions?,user-notification-handler-class*,webdav-storage-token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-collection-adapter*,custom-attributes-display*,ddm-display?,permission-propagator?,trash-handler*,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,requires-namespaced-parameters?,action-timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)". Nested exception: The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-class?,staged-model-data-handler-class*,template-handler?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class*,social-request-interpreter-class?,user-notification-definitions?,user-notification-handler-class*,webdav-storage-token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-collection-adapter*,custom-attributes-display*,ddm-display?,permission-propagator?,trash-handler*,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,requires-namespaced-parameters?,action-timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)".
at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:426)
at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:444)
at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:161)
at com.liferay.portal.service.impl.PortletLocalServiceImpl._readLiferayPortletXML(PortletLocalServiceImpl.java:1801)
at com.liferay.portal.service.impl.PortletLocalServiceImpl.initWAR(PortletLocalServiceImpl.java:793)
at sun.reflect.GeneratedMethodAccessor739.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
at com.sun.proxy.$Proxy73.initWAR(Unknown Source)
at com.liferay.portal.service.PortletLocalServiceUtil.initWAR(PortletLocalServiceUtil.java:428)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:346)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:124)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:227)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:28)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:164)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:154)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:74)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:58)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.dom4j.DocumentException: Error on line 21 of document : The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-class?,staged-model-data-handler-class*,template-handler?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class*,social-request-interpreter-class?,user-notification-definitions?,user-notification-handler-class*,webdav-storage-token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-collection-adapter*,custom-attributes-display*,ddm-display?,permission-propagator?,trash-handler*,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,requires-namespaced-parameters?,action-timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)". Nested exception: The content of element type "portlet" must match "(portlet-name,icon?,virtual-path?,struts-path?,parent-struts-path?,configuration-path?,configuration-action-class?,indexer-class*,open-search-class?,scheduler-entry*,portlet-url-class?,friendly-url-mapper-class?,friendly-url-mapping?,friendly-url-routes?,url-encoder-class?,portlet-data-handler-class?,staged-model-data-handler-class*,template-handler?,portlet-layout-listener-class?,poller-processor-class?,pop-message-listener-class?,social-activity-interpreter-class*,social-request-interpreter-class?,user-notification-definitions?,user-notification-handler-class*,webdav-storage-token?,webdav-storage-class?,xml-rpc-method-class?,control-panel-entry-category?,control-panel-entry-weight?,control-panel-entry-class?,asset-renderer-factory*,atom-collection-adapter*,custom-attributes-display*,ddm-display?,permission-propagator?,trash-handler*,workflow-handler*,preferences-company-wide?,preferences-unique-per-layout?,preferences-owned-by-group?,use-default-template?,show-portlet-access-denied?,show-portlet-inactive?,action-url-redirect?,restore-current-view?,maximize-edit?,maximize-help?,pop-up-print?,layout-cacheable?,instanceable?,remoteable?,scopeable?,user-principal-strategy?,private-request-attributes?,private-session-attributes?,autopropagated-parameters?,requires-namespaced-parameters?,action-timeout?,render-timeout?,render-weight?,ajaxable?,header-portal-css*,header-portlet-css*,header-portal-javascript*,header-portlet-javascript*,footer-portal-css*,footer-portlet-css*,footer-portal-javascript*,footer-portlet-javascript*,css-class-wrapper?,facebook-integration?,add-default-resource?,system?,active?,include?)".
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:423)
... 36 more



Any thoughts on why this is happening?
thumbnail
Pankaj Kathiriya, modificado 9 Anos atrás.

RE: Page needs a session and none is available

Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
Its because of wrong order of tags.

If you see pattern in error requires-namespaced-parameters is coming after private-session-attributes, and you have provided requires-namespaced-parameters tag before private-session-attributes hence this error is appearing.

Take note that order of tags matters in liferay-portlet.xml
Traolly Xiong, modificado 9 Anos atrás.

RE: Page needs a session and none is available

Regular Member Postagens: 195 Data de Entrada: 30/12/11 Postagens Recentes
Thanks!
Traolly Xiong, modificado 9 Anos atrás.

RE: Page needs a session and none is available

Regular Member Postagens: 195 Data de Entrada: 30/12/11 Postagens Recentes
Looks like this parameter helped the issue from re-occuring.

portal-ext.properties:

layout.parallel.render.timeout=30000

I'm not sure why the other parameter in the "liferay-portlet.xml" did not work.
Traolly Xiong, modificado 9 Anos atrás.

RE: Page needs a session and none is available

Regular Member Postagens: 195 Data de Entrada: 30/12/11 Postagens Recentes
Adding this

<private-session-attributes>false</private-session-attributes>

before the

<requires-namespaced-parameters>false</requires-namespaced-parameters>

tag still does not help.

Any ideas?

I would think it's ideal to have this config in the "liferay-portlet.xml" vs. the properties file.

Thoughts?
Traolly Xiong, modificado 9 Anos atrás.

RE: Page needs a session and none is available

Regular Member Postagens: 195 Data de Entrada: 30/12/11 Postagens Recentes
The private session attributes did NOT work. I've decided to use the "layout.parallel.render.timeout=30000" in the portal-ext.properties file.

Thanks.