0

Liferay portlet problem.

asked 2009-02-20 10:33:03 +0800

cuongtv gravatar image cuongtv
63 1 1

updated 2009-02-21 01:38:39 +0800

Hi all.
I'm newbie, and I developing portlet on liferay with ZK.
When I add new ZK portlet to liferay I encounter the error message
"org.zkoss.zk.ui.http.SimpleSession is not serializable and will prevent this session from being replicated."
Anyone can help me, please!

delete flag offensive retag edit

15 Replies

Sort by ยป oldest newest

answered 2009-02-21 02:56:10 +0800

cuongtv gravatar image cuongtv
63 1 1

Everything seem ok when I use only component for demo purpose (no event processing). But when add attribute "use" for window component, then error ocured, the portlet screen is not accessible, only snipping "loading" above. The portlet inherited from GenericPortlet, but when I replace it with DHtmlLayoutPortlet, the error remain. As for me the class SimpleSession is not serializable, while as liferay implement, when something store in session it must be serializable. Please give me some advices, thanks!

link publish delete flag offensive edit

answered 2009-02-21 03:56:25 +0800

cuongtv gravatar image cuongtv
63 1 1

I've removed the error "org.zkoss.zk.ui.http.SimpleSession is not serializable and will prevent this session from being replicated.", but the snipping is still remain, then I can access my portlet. Is this the conflict between jQuery of Liferay and Prototype of ZK. Please help me, thanks!

link publish delete flag offensive edit

answered 2009-02-21 17:28:41 +0800

hideokidd gravatar image hideokidd
750 1 2

Hi,

It seems a bug of portlet, but it's not easy to solve the problem without code, how about sharing some sample code so that we can help. Of course please make code short and let error remain. Besides, complete error message is proper.

Thanks.

link publish delete flag offensive edit

answered 2009-02-23 01:32:49 +0800

cuongtv gravatar image cuongtv
63 1 1

Thank hideokidd. My portlet is just a very simple "helloworld". It's java class is:

public class TaskManagerPortlet extends GenericPortlet  {
	protected String editJSP;
	protected String helpJSP;
	protected String index;
	private static Log _log = LogFactory.getLog(TaskManagerPortlet.class);

	public void init() throws PortletException {
		editJSP = getInitParameter("edit-jsp");
		helpJSP = getInitParameter("help-jsp");
		index = getInitParameter("index");
	}
	
	public void doView(RenderRequest req, RenderResponse res)
	throws IOException, PortletException {
		include(index, req, res);
		//super.doView(req,res);
	}
	protected void include(String path, RenderRequest req, RenderResponse res)
	throws IOException, PortletException {
		PortletRequestDispatcher prd =
			getPortletContext().getRequestDispatcher(path);

		if (prd == null) {
			_log.error(path + " is not a valid include");
		}
		else {
			prd.include(req, res);
		}
	}

}

And here is portlet-ext.xml
<portlet>
		<portlet-name>taskmanager</portlet-name>
		<display-name>Task manager</display-name>
		<portlet-class>ipc.ipcms.portlet.taskmanager.TaskManagerPortlet</portlet-class>
		<init-param>
			<name>index</name>
			<value>/html/portlet/ext/task-manager/index.zul</value>
		</init-param>
		<expiration-cache>0</expiration-cache>
		<supports>
			<mime-type>text/html</mime-type>
		</supports>
		<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
		<portlet-preferences>
			<preference>
				<name>test</name>
				<value>123</value>
			</preference>
		</portlet-preferences>
		<security-role-ref>
			<role-name>power-user</role-name>
		</security-role-ref>
		<security-role-ref>
			<role-name>user</role-name>
		</security-role-ref>
	</portlet>

The index.zul is just
<?page id="testZul" title=" New ZUL Title" cacheable="false" 
	language="xul/html" zscriptLanguage="Java" contentType="text/html;charset=UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>



<zk xmlns="http://www.zkoss.org/2005/zul"
	xmlns:h="http://www.w3.org/1999/xhtml" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<window title="My First Window" border="normal" width="200px">Hello, World!</window>
</zk>

In web.config i've add zk support part

<!--zk framework -->
	<listener>
		<description>
		Used to cleanup when a session is destroyed</description>
		<display-name>
		ZK Session Cleaner</display-name>
		<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
	</listener>
	<servlet>
		<description>
		The servlet loads the DSP pages.</description>
		<servlet-name>dspLoader</servlet-name>
		<servlet-class>
		org.zkoss.web.servlet.dsp.InterpreterServlet</servlet-class>
	</servlet>
	<servlet>
		<description>
		ZK loader for ZUML pages</description>
		<servlet-name>zkLoader</servlet-name>
		<servlet-class>
		org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
		<init-param>
			<param-name>update-uri</param-name>
			<param-value>/zkau</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet>
		<description>
		The asynchronous update engine for ZK</description>
		<servlet-name>auEngine</servlet-name>
		<servlet-class>
		org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>dspLoader</servlet-name>
		<url-pattern>*.dsp</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.zul</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.zhtml</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>auEngine</servlet-name>
		<url-pattern>/zkau/*</url-pattern>
	</servlet-mapping>

I also copied zk library to application.
The portlet seems work well when I add it to portal, but when reload the snipping "loading" appear and I couldn't access the portlet.

link publish delete flag offensive edit

answered 2009-02-23 06:27:44 +0800

cuongtv gravatar image cuongtv
63 1 1

I've found the solution at liferay forum http://www.liferay.com/web/guest/community/forums/-/message_boards/message/2109508

link publish delete flag offensive edit

answered 2010-03-22 02:25:59 +0800

ady1981 gravatar image ady1981
120 4

I met the same problem with Liferay ("...the portlet screen is not accessible, only snipping "loading" above").

And:
1) the adding the property "speed-filters-enabled=false" in the liferay-plugin-package.properties file in the WEB-INF directory of the portlet does not help me.
2) the adding the properties:
com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.gzip.GZipFilter=false
in the portal-ext.properties file in the ROOT/WEB-INF/classes directory of the portal does not help also.

Are there any suggestions?

link publish delete flag offensive edit

answered 2010-03-25 20:14:54 +0800

samchuang gravatar image samchuang
4084 4

@ady1981

hi, which ZK version do you use, and which liferay version do you use ?

I tested ZK5 with Liferay 5.2.1 and 5.2.2 and has no problem

link publish delete flag offensive edit

answered 2010-12-07 10:46:08 +0800

younes gravatar image younes
3

Dear Samchuang,

Can you please package a sort of 'hello-zk-portlet' and post it? That would be very useful for people trying to start with ZK on Liferay.

Warm regards

Younes

link publish delete flag offensive edit

answered 2010-12-08 01:49:38 +0800

samchuang gravatar image samchuang
4084 4

Hi, you can download portlet example form http://docs.zkoss.org/wiki/ZK/How-Tos/Installation/How_to_Install_ZK_on_Liferay, in the wiki, you can find a link to download war file

link publish delete flag offensive edit

answered 2011-11-15 06:51:14 +0800

rohitwadke gravatar image rohitwadke
339 1 5

Hello All,

i facing problem in adding zk potlet in liferay,

I have created zk application which i run independently on tomcat it works fine. Same application i have created as portlet and deployed on liferay, it shows portlet name in application list, when i try to add on page its not showing in portlet panel..
any suggestion ???

thanks in advance
Rohit

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-02-20 10:33:03 +0800

Seen: 4,467 times

Last updated: May 29 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More