Monday 23 January 2012

LIferay - new liferay project "Failed while installing Liferay Portlet 6.0"

While attempting to create my first Liferay project I found my self facing an error.
"Failed while installing Liferay Portlet 6.0. Most of the project seemed to be present but there were missing xml files and a missing icon. Being dumb and keen I perservered. The portlet would deploy but nothing worker right.
So having deleted everything I came in on the monday morning to start again.
A quick bit of research shows the following:
  • Installing Eclipe for Java developers does not include the web development tools;
    So a dynamic web site will not work;
  • Installing the Liferay IDE plugin fetches you the latest version of the tools which allows a dynamic web site 2.x to 3.0;

When a dynamic web project  is created, various information is assembled to specify the type of project, add standard libraries, set compiler options, control publishing tasks, set the build path and/or add an annotation processor. This information is specified by choosing facets during project creation. Facets can also be added and deleted from a project after its initial creation. To edit a project's facets, select Project > Properties > Project Facets.
Facets have version numbers. Not all facet version numbers can be changed (e.g., a facet available in only one version of software can not have other version numbers). Some facet version numbers are inter-dependent (e.g., if you choose the facet Java Annotation Processing, you must also have Java version 5.0 selected since Java versions 1.3 and 1.4 did not support annotation processing).
Doing some more research I discovered that the version number was related to the Servlet API version. A snippet from Wikipedia: http://en.wikipedia.org/wiki/Java_Servlet


Servlet 3.0December 2009JavaEE 6, JavaSE 6Pluggability, Ease of development, Async Servlet, Security, File Uploading
Servlet 2.5September 2005JavaEE 5, JavaSE 5Requires JavaSE 5, supports annotations
Servlet 2.4November 2003J2EE 1.4, J2SE 1.3web.xml

Tomcat 7 will support 2.2 and 3.0 (See ...) and if you attempt to create a standard dynamic web project everything goes fine.
So what to do .....

While creating your project click the Advance project configuration... button link.


After selecting this option select a lower version of the servlet protocol. Postings on the Liferay forum seem to indicate that 2.5 and 3.0 do not work.So choose 2.4 ...

This seems to work a treat!

No comments:

Post a Comment