Wednesday, September 22, 2010

Deployment/Undeployment with Ext plugins environment

I found some weird behavior when i started working with ext plugins using Liferay version 6.0.5. These problems are related to deployment & undeployment of ext plugins.I thought it might be helpful to beginners of new liferay ext plugins.

You will be having files related to your each ext plugin under following places

Suppose for example i have created a ext plugin named "second"

1) You will be having some jars @ temp folder of your tomcat instance @ \temp\liferay\com\liferay\portal\deploy\dependencies

In my case,

2) You will be having jars related to each of your ext plugin @ \webapps\ROOT\WEB-INF\lib

In my case,

3) xml file related to each ext plugin will be placed @ \webapps\ROOT\WEB-INF

In my case,

4) Service file @ global class path of app server - \lib\ext\ext-second-ext-service.jar. Since this is a shared library/global class path you cannot undeploy when server is in running state.


5) Once your ext plugin is deployed properly you may see some message some thing like below
[ExtHotDeployListener:188] Extension environment for "YOUR_EXT_PLUGIN_NAME" has been applied. You must reboot the server and redeploy all other plugin

Copy the below code to a bat file, change tomcat_home according to your tomcat instance
> you need to send your ext plugin name as parameter , in my case "second"
> before redeploying stop the server & run the following command then redeploy

@echo off
set app_name=%1
if "%app_name%" == "" goto end
set tomcat_home=E:\Liferay605\bundles\tomcat-6.0.26
rmdir /S /Q %tomcat_home%\webapps\%app_name%-ext
del /S /Q %tomcat_home%\lib\ext\ext-%app_name%-ext-service.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-bridges.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-taglib.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-java.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-impl.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\ext-%app_name%-ext.xml
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-bridges.jar
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-taglib.jar
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-java.jar
Please post your comments/feedback/suggestions on this topic if possible


  1. Thanks for explanations, Nagendra! This cleans-up things a bit. Will try and report how well this works.
    One possible suggestion I just thought about: its possible to modify EXT plugin build.xml to run "undeploy" task prior to deploy, since there is complete config about Tomcat (or other server) location present in parent build.xml! Doing so may make deployment/undeployment of EXT plugin quite transparent thing I think :)

  2. Even i thought about that, one problem i found was we will have service related jar of ext plugin(s) in global class path of the server (tomcat or any other)which cannot be loaded/applied without restarting the server.

  3. This comment has been removed by the author.

  4. Anyway it's way better then redeploying ENTIRE Liferay Portal and re-applying EXT plugin after that. My ANT task works like charm, but 2 server restarts required in order to make EXT plugin active... Unfortunately, Liferay Plugin SDK isn't mature enough yet...

  5. You are right ext plugins are not mature enough, it will take some time to come to certain level maturity.

    I can say ext plugins are not hot deployable as of now (It depends on what changes we have made even)

    We have problem if we try to deploy more than one ext plugin in Liferay 6.0.5,it is not able to merge ext related configuration files under ROOT\WEB-INF\ of tomcat deployment directory.

  6. I share your pain.

    Ext Plugin isn't right now what it could be - I'm trying to be patient.

    If you are hungry for more info try to look at:

    -- tom

  7. Thomas, Thank you very much for details & link :)

  8. Here is the link to patch for redeploy problems

  9. Thanks Nagendra ...
    I've faced one another problem while using plugins-ext.
    When i removed the plugins-ext jar files created in tomcat/webapps/ROOT/WEB-INF/lib and when i redeploy it didn't copy all those jars again after restaring the server.

    Then i've found somewhere we've one ant task for ext-plugins that is "direct-deploy". When i've used it, jar files started copied using this ant target.

    Not sure what is the problem with deployment or i am doing anything wrong. But "direct-deploy" works for me.


  10. If you have any custom classes in ext plugin then there is problem with loading on first start of the server. JSP files its not a problem. Direct deploy i hope will work in that case

  11. [gigya width="300" height="225" quality="high" src="" bgcolor="FFFFFF" ]

  12. Hi everybody and thanks Nagendra for this topic.
    I have the same problem as TEJ. When I use direct deploy, I have all my jars copied to the WEB-INF/lib folder of my liferay instance, but I'd like to deploy the ext plugin on another server different from my development server. And when I just use the hot deploy it doesn't copy those jars, so I have to do it manually.

    Is it an issue or am I missing something?

    Thanks everybody for your answers.

  13. Alex, redeployment is handled entirely in a different way when it comes to Ext plugins. Here is some notes from liferay doucumentation

    The direct-deploy target is faster because the changes are applied directly., while the Liferay server does it on start up if you use the deploy target. For that reason it is usually preferred during development.

    Check this for more info,