{ My Geek Journey }

Enable Auto JSP Reload in WebSphere Portal

The easiest way to enable auto jsp reload in WebSphere Portal is via WebSphere Application Server console. Do the following steps to enable auto jsp reload in WebSphere Portal:

  1. Log on to the WebSphere® Integrated Solutions Console (https://<server ip>:10041/ibm/console) and go to Applications > Application Types > WebSphere enterprise applications.
  2. Click on the application that you wish to enable auto jsp reload.
  3. Click on “JSP and JSP options“.
  4. Checked “JSP enable class reloading” and key in “1” for JSP reload interval in seconds. Click on the OK button.
  5. Click on “Save” link (Save directly to the master configuration).
  6. You have successfully enable auto jsp reloading for that particular application in WebSphere Portal.

WebSphere Portal: Using Command Prompt

Still working on this article

Command Prompt for deploying PAA (Portal Application Archive) File

Task Steps
Install PAA file for the first time
  • Open a command prompt and go to <wp_profile>/ConfigEngine.
  • Run the following command to upload the paa file:
    ConfigEngine.bat install-paa -DPAALocation=<paa_file_location> -DWasPassword=<password> -DPortalAdminPwd=<password>
  • Ensure that you are able to see “BUILD SUCCESSFULLY” in the cmd and the subdirectory exists under <wp_profile>/paa/<paa_filename>.
  • Open the components.properties under the subdirectory and ensure that the parameter value is set to true.

  • Run the following command to deploy or update the changes (If you are deploying to a clustered environment and your PAA file contains XMLAccess script files, do include -DmaxTimeToWait (default: 30) and -DmaxAppTimeToWait (default: 5):
    ConfigEngine.bat deploy-paa -DappName=<paa_component_name> -DWasPassword=<password> -DPortalAdminPwd=<password>
  • Ensure that you are able to see “BUILD SUCCESSFULLY“.
 Update PAA file Running install-paa-update command will creates a backup of your existing PAA file and stored it in the <wp_profile>/paa/backup directory.

  • Open a command prompt and go to <wp_profile>/ConfigEngine.
  • Run the following command to upload the paa file:
    ConfigEngine.bat install-paa-update -DPAALocation=<paa_file_location> -DappName=<paa_component_name> -DWasPassword=<password> -DPortalAdminPwd=<password>
  • Ensure that you are able to see “BUILD SUCCESSFULLY” in the cmd and the subdirectory exists under <wp_profile>/paa/<paa_filename>.
  • Open the components.properties under the subdirectory and ensure that the parameter value is set to true.
  • Run the following command to update the paa components:
    ConfigEngine update-paa-components -DappName=<paa_component_name> -DWasPassword=<password> -DPortalAdminPwd=<password>
  • Ensure that you are able to see “BUILD SUCCESSFULLY“.
  • Run the following command to deploy or update the changes (If you are deploying to a clustered environment and your PAA file contains XMLAccess script files, do include -DmaxTimeToWait (default: 30) and -DmaxAppTimeToWait (default: 5):
    ConfigEngine.bat deploy-paa -DappName=<paa_component_name> -DWasPassword=<password> -DPortalAdminPwd=<password>
  • Ensure that you are able to see “BUILD SUCCESSFULLY“.

Note: You are required to invalidate theme cache if you are deploying theme static resources.

 

WebSphere Portal: Clicking Any Button in Inline Editing Will Causes Chrome Scrollbar To Disappear

How to replicate the issue:

  • Ensure that your WebSphere Portal version is 8.5 CF9 and below
  • Ensure that your Chrome browser is up to date
  • Open any content that is long enough for the Chrome vertical scrollbar to appear in Inline Editing.
  • Click on any button and the Chrome scrollbar will disappear.

 

We have raised a PMR ticket with IBM and below is their temporary workaround (as of 18 Mar 2016). The full workaround should be in WebSphere Portal 8.5 CF10.

For WebSphere Portal 8.5 CF9 and below, modify the following files:

  • AuthoringUIView.jsp (<wp_profile>/installedApps/cellname/PA_WCM_Authoring_UI .ear/ilwwcm-authoring.war/jsp/html/AuthoringUIView.jsp)
  • dialogCloserLaunchPage.jsp ( <wp_profile>/installedApps/cellname/PA_WCM_Authoring_UI .ear/ilwwcm-authoring.war/jsp/html/dialogCloserLaunchPage.jsp)

with the following codes:


/*BEFORE: find the following lines */
dojo.addOnUnload(function() { 
 if (frameElement) { 
  frameElement.scrolling="no"; 
 } 
});

/*AFTER: change the code as follows */
dojo.addOnUnload(function() { 
 if (frameElement) { 
  if (i$.isChrome) { 
   frameElement.scrolling="auto"; 
  } else { 
   frameElement.scrolling="no"; 
  } 
 } 
}); 

There is an additional step for WebSphere Portal 8.5 CF8 and below:

  • Go to <PortalServer>/theme/wp.theme .modules/webapp/installedApps/ThemeModules.ear/ThemeModules .war/modules/dialog/js/.
  • Backup dialog_layer.js and dialog_layer.js.uncompressed.js.
  • Copy dialog_layer.js.uncompressed.js content to dialog_layer.js and modify the file with the following codes:

/*BEFORE: find the following lines */
// Don't display scrollbars until dialog content has loaded, this is set back to auto in onLoadFrame 
// Note: in chrome setting overflow style to hidden will not hide scrollbars 
f.setAttribute("scrolling","no");

/*AFTER: change the code as follows */
// Don't display scrollbars until dialog content has loaded, this is set back to auto in onLoadFrame 
// Note: in chrome setting overflow style to hidden will not hide scrollbars
if(i$.isChrome) { 
 f.setAttribute("scrolling","auto"); 
} else { 
 f.setAttribute("scrolling","no"); 
}

WebSphere Portal: Specify White and Black List for Web Application

If your SystemOut.log is throwing the following warning message, it means that you will need to specific white and black list for your custom web application:

[3/24/16 12:18:17:143 SGT] 0000027f AbstractReque W com.ibm.wps.resolver.resource.AbstractRequestDispatcherFactory matchesWebAppDefault(aResource) Servlet context [/WebApp] does not specify a blackwhite list when accessing resource [themes/html/dynamicSpots/custom/header.jsp], falling back to the default [[whitelist(null), blacklist(WEB-INF/.*)]]. Applications can define a custom list by adding the keys [com.ibm.portal.resource.whitelist] and [com.ibm.portal.resource.blacklist] to their web.xml deployment descriptor. For details see information for APAR PI47714 related to CVE-2014-8912 (Security bulletin: http://www.ibm.com/support/docview.wss?uid=swg21963226).

Add the following parameters to your web.xml and redeployed your application:

<web-app> 
...
<context-param>
 <description>A regular expression that defines which of the resources in the war file can be served by the portal res datasource.</description> 
 <param-name>com.ibm.portal.resource.whitelist</param-name> 
 <param-value>.*</param-value>
</context-param> 
<context-param>
 <description>A regular expression that defines which of the resources in the war file cannot be served by the portal res datasource.</description> 
 <param-name>com.ibm.portal.resource.blacklist</param-name> 
 <param-value>WEB-INF/.*</param-value>
</context-param>
... 
</web-app> 

How to Remove Sign Up Link in WebSphere Portal Theme?

WebSphere Portal theme will show Sign Up link by default for anonymous users. We can remove the link by deleting “Anonymous Portal User” from USER SELF ENROLLMENT virtual resources Editor role.

Do the following steps to remove Sign Up Link in WebSphere Portal Theme:

  • Login to WebSphere Portal using your portal administrator account.
  • Go to Portal Administration page (http://<hostname>/Administration).
  • Go to “Access > Resource Permissions” and click on “Virtual Resources” (It should be on the 2nd page).
  •  Click on USER SELF ENROLLMENTAssign Access” button.
  • Click on EditorEdit Role” button.
  • Remove “Anonymous Portal User” from Editor Role.
  • Now logout to verify the changes. The Sign Up link should be remove for Anonymous Portal User now.

WebSphere Portal: Remove “/wps/portal” from URL

IBM has finally provides us a way to remove "/wps/portal" in WebSphere Portal *pops champagne*. Do take note that this only applies to WebSphere Portal v8.5 CF8 onwards.

Take note (as of WebSphere Portal v8.5 CF8): After you have successfully remove “/wps/portal”, the system will not be unable to locate all previous custom themes that you have created earlier. You will need to run xmlaccess manually to remove “/wps” from the theme context-path.
“EJPFD0097E: No theme was found to render the page. Navigate to Administration and assign a working theme to restore full function to your site.”

 

Do the following steps to remove “/wps/portal”:

  1. Start cw_profile. Open your cmd and go to <app_server>\ profiles\cw_profile\bin and type “startServer.bat server1“.
  2. Go to Configuration Wizard (http://<server_ip>:10200/ibm/wizard).
  3. Login in with admin ID for cw_profile profile.
  4. Click “Set Up a Stand-alone Server > Modify Site URLs for Search Engine Optimization” or “Set Up a Cluster > Modify Site URLs for Search Engine Optimization” depending on your environment type.
  5. Click on “URL Settings” and select “Yes” for “Do you want to modify or remove your context root” field blank. (as of WebSphere Portal v8.5 CF8) I would not remove navigation state information using this method as this will cause default portal 8.5 theme to lose its navigation state as well. A better method will be this.
  6. Click on the “Next” arrow.
  7. Key in the required admin information and leave “Context root” and “
  8. Click on “Start Configuration” button.
  9. Click on “OK” button.
  10. The wizard will pause at certain manual steps. Click on the “Instructions” link to follow through the manual configuration.
  11. Congrats! You have remove “/wps/portal” from the url!

 

Useful MySQL Commands

How to connect to MySQL?

  • Open your command prompt (type ‘run’ in your windows search)
  • Go to <mysql installation folder>\bin
  • Type “–user=<root username> –password=<your root password>

How to check MySQL version?

  • Connect  to MySQL
  • Type the following command:
    SHOW VARIABLES LIKE "%version%";

Removing Extra Space Underneath An Image

You have already applied normalize.css but there is still additional white space underneath an image. This is because the browsers by default will recognize the images as an inline-element, hence additional “line-height” is apply.

For example, key in the following html:


<div style='border:1px solid red;'>
 <img src='marvel.jpg'/>
</div>

Noticed that extra space (line-height)?

Solution:

  1. Either add in “display:block” to the image
    <div style='border:1px solid red;'>
     <img src='marvel.jpg' style='display:block;'/>
    </div>
    
  2. Or add in “line-height:0” to the containing dom
    <div style='line-height:0;border:1px solid red;'>
     <img src='marvel.jpg'/>
    </div>
    

IBM WebSphere Portal Woes

We have been working with IBM WebSphere Portal for almost 8 years (from version 6.0 to 8.5) and often we realized that there are some points that IBM sales personnel deliberately wouldn’t let you know.

Disclaimer: We are still happy with IBM WebSphere Portal.


Poor PMR (aka Service Request) support

They wouldn’t attempt to read and replicate the issue in their own environment on their first reply (despite how much information you have provided them).

For example, we had reported recently that the Top Left Edit Tools in WebSphere Portal v8.5 were not showing in the latest Chrome version (44.0.2403.125) and even pointed out that we had experienced similar issue with the portal provided in one of the IBM training workshops.

We were thinking that L2 should be able to replicate the issue easily as L2 just need to update his Chrome browser. We are wrong:

Didn’t mean to be mean but we have already tried our best to provide you as much information as we could and it is really difficult to get trace.log from client environment with all the red tapes involved. Plus in this case, all you need to do is to update your Chrome browser to the latest version:

Mystery resolved (once L2 decided to update his browser and escalated the issue):

 

Windows Update Takes Forever to Update

One of my Windows 2008 R1 servers suddenly refuses to update. The process seems to be taking forever (or rather stuck) even for searching for updates.

Luckily the solution for me is simple:

  • At the Task Manager, search for “wuauserv” process (in Window 10, search for Windows Update) and stop the process.
  • Delete all of the files found under C:\Windows\SoftwareDistribution directory
  • Run Windows Update (issue should be resolved)