Search code examples
javatomcatservletsliferayweb.xml

How to deploy a non-Liferay web application to tomcat bundled with Liferay


I have decided to use Liferay for my next project and I'm trying to somehow get an old non-Liferay web application deployed on tomcat 8 that was bundled with Liferay. The application uses servlets.

After some googling I got the impression that it should be possible to simply deploy the application on tomcat which I did. Liferay does pick it up from the /deploy folder but there is an error while deploying it saying web.xml needs to be upgraded to 2.4. My web.xml is almost empty because I use @WebServlet annotatations for servlet mapping.

So my question is, is it possible to deploy a non-Liferay application to tomcat that comes with Liferay without making any changes to it?


Solution

  • You should only place Portlet-WARs into LIFERAY/deploy, as Liferay will try to convert such WARs into a Liferay specific Portlet-WAR, before deploying them in Tomcat.

    If you need to deploy a legacy WAR you should place that into LIFERAY\tomcat...\webapps\ and Tomcat will start it without any modification.