Updating wps.ear using WSAdmin Script

The WebSphere Portal engine is implemented as J2EE application. The portal engine logic is implemented in wps.ear. These are some of the use cases in which you might want to update the wps.ear


  • You want to introduce a new THeme or Skin or something that is deployed as part of wps.ear

  • You might want to add Servlet Filter to do some pre/post processing on the portal engine requests.



I am working on creating a new Theme and Skin and as part of that i need to update the wps.ear frequently and i follow these steps to update wps.ear using wsadmin script

  • First connect to wsadmin console for WebSphere Portal, you can do that by executing following command

    ./wsadmin.sh -user wasadmin -password wasadmin -lang jython -port 10033

    By default the portal is configured to listen on 10033 port for SOAP connection

  • THen execute AdminApp.export('appname','eardestinationpath') command on the wsadmin consoel and it will export the installed application into .ear

    AdminApp.export('wps','/tmp/wpsear/wps.ear')

    In this case i am export wps enterprise application into /tmp/wpsear/wps.ear

  • The wps.ear contains 3 .war files and one .ejb.jar file. I can use either normal jar utility to expand the .ear first and then expand .war files in the .ear file or i can use EARExpander utility which is part of WAS and available even in profile_home/bin directory to expand the .ear file

    ./EARExpander.sh -ear /tmp/wpsear/wps.ear -operationDir /tmp/wpsear -operation expand -expansionFlags all

    This will expand the wps.ear and the .war files inside into /tmp/wpsear directory

  • Now you can apply your changes by either copying new theme or skin related directory or modifying the web.xml file for adding filter definition

  • We can use the EARExpander utility to collapsing the content of directory into .ear file using command like this

    ./EARExpander.sh -ear /tmp/wps.ear -operationDir /tmp/wpsear -operation collapse


  • Once the updated wps.ear is ready we can use the following wasadmin command to update the .ear file on the server

    AdminApp.update('wps', 'app', '[ -operation update -contents /tmp/wps.ear -nopreCompileJSPs -installed.ear.destination $(APP_INSTALL_ROOT)/DefaultNode -distributeApp -nouseMetaDataFromBinary -nodeployejb -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -processEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude]' )


  • Last step would be to commit changes in the WAS configuration, at this point the WAS xml configuration files will actually get modified

    AdminConfig.save()


3 comments:

srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

Vikas Chaudhary said...

Battery Mantra is Authorized exide car battery dealer in Noida and Greater Noida. We are providing our service in Indirapuram, Delhi, Ashok Nagar.

Exide Battery Dealer in Noida
Battery Dealer in Noida
Authorized Battery Dealer in Noida
Car Battery Dealer in Noida
Car Battery Dealer
Exide Battery Dealer

EG MEDI said...

Egmedi.com is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery


Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store