Restarting Portlet Application

While development/testing portlet application, we come across to situations when we make changes to properties file or java file or even portlet.xml.

I have seen people, who update the portlet application war file on portal to reflect changes. (Assuming Portal test environment is not involved in this case).

For example:- You have deployed your portlet app ton dev box.
Now while testing, you found some bug and you realised this could be because of wrong value in property file OR some wrong java method call or wrong entry in portlet.xml

For this situation, updating a war file could be a heavy process, specially when you are making changes to a single line java code or changing a single property value or editing some entries in portlet.xml.

To save time, you can quickly verify this by
making necessary changes to your application deployed on on dev box inside <wp_profile>/installedApps/ and restart portlet application from WAS.

Here is how you can restart your portlet application from WAS

1) Login to WAS as admin
2) Click on Applications
3) click on Enterprise Applications
4) find your application and just click on stop and start.
(remember, find EAR name for your deployed application)


Now, just access your portlet and you should find your changes straight away.....

If all works well after making changes, you can always update WAR later on with changes made to your actual code.

Hope this will save your time.....

1 comment:

Joe said...

You bet! Any developer would love this piece of info. Simply I would like to add to it that the URL to start/stop portlet applications on Portal WAS admin console(WebSphere_Portal), to reflect the said changes, would be different (at least the portnumber) from the usual WAS admin console (server1) on which Portal is sitting.
If you use the usual WAS admin console (server1) on which the Portal is sitting and try to restart any application which is installed on Portal (WebSphere_Portal) it wont allow to restart and error out saying something similar that its installed on another server.
Neeraj, can you please thorough some more light on this.
Also, you may want to try 'enable the JSP reloading' in which you may not even need to restart the portlet application too. Not sure how far this may help.