Friday 11 June 2010

IBM WebSphere Portal Content Templates Catalog - The Fun Continues, this time on Windows

Following two earlier posts about the rather excellent Portal Templates Catalog, I was helping a colleague, Stuart, with an implementation of the same on WebSphere Portal Express 6.1.5 on a VMware image running Windows XP SP3.

Previously, I'd only ever deployed the Catalog onto Linux, as per my previous postings here: -

http://portal2portal.blogspot.com/2010/05/ibm-websphere-portal-content-templates_13.html

and here: -

http://portal2portal.blogspot.com/2010/05/ibm-websphere-portal-content-templates.html

whereas it was somewhat more tricksy on Windows.

In the first instance, I was seeing the following exception: -

BUILD FAILED
D:\IBM\WebSphere\PortalServer\IBM.WebSphere.Portal.Content.Templates.Catalog\components\sample.ctc.content\config\includes\sample.wcm.content.common_cfg.xml:12: The following error occurred while executing this line:
D:\IBM\WebSphere\PortalServer\IBM.WebSphere.Portal.Content.Templates.Catalog\components\sample.ctc.content\config\includes\wcm_cfg.xml:18: Warning: Could not find file D:\IBMWebSpherewp_profile\PortalServer\wcm\config\wcm60_conf.xml to copy.

even though I'd modified install.bat as follows: -

set installPath      =    d:\IBM\WebSphere\PortalServer
set assemblyRoot     =    %installPath%\IBM.WebSphere.Portal.Content.Templates.Catalog
set profilePath      =    d:\IBM\WebSphere\wp_profile
set portalServerPath =    d:\IBM\WebSphere\PortalServer
set wasUserName      =    wpsadmin
set wasUserPassword  =    passw0rd
set pwdUserName      =    wpsadmin
set pwdUserPassword  =    passw0rd
set hostName         =    localhost
set portalConfigUrl  =    http://localhost:10040/wps/config
set soapPort         =    10033

and also modified d:/IBM/WebSphere/PortalServer/IBM.WebSphere.Portal.Content.Templates.Catalog/wcm.properties as follows: -

profile_dir          =    d:\IBM\WebSphere\wp_profile

to match my environment.

Reading the error message more fully ( ...D:\IBMWebSpherewp_profile... ), I wondered whether script was ignoring the back slash (\) characters in the paths set in the .bat and .properties file, as I've seen similar issues before. To prove this, I replaced them with forward slash (/) characters, doubled up in case one character was being treated as an escape character.

Therefore, the path-related statements in the .bat and .properties files changed to look like this: -

set installPath      =    d://IBM//WebSphere//PortalServer
set assemblyRoot     =    %installPath%//IBM.WebSphere.Portal.Content.Templates.Catalog
set profilePath      =    d://IBM//WebSphere//wp_profile
set portalServerPath =    d://IBM//WebSphere//PortalServer

and: -

profile_dir          =    d://IBM//WebSphere//wp_profile

respectively.

This helped in that the script ran for slightly longer, but still failed, this time with: -

[6/11/10 13:44:31:609 BST] 00000049 SysViewConten E com.ibm.icm.jcr.serialization.handler.SysViewContentHandler endElement javax.jcr.RepositoryException: d:\IBM\WebSphere\PortalServer\IBM.WebSphere.Portal.Content.Templates.Catalog\components\sample.ctc.content\content\wcm\shared\rootworkspace\jcr_root\423dc4e4\8632bc4e\%57orkflow\%41ctions\18bdfa32\e910e1b8.value (The system cannot find the path specified.)
                                 javax.jcr.RepositoryException: d:\IBM\WebSphere\PortalServer\IBM.WebSphere.Portal.Content.Templates.Catalog\components\sample.ctc.content\content\wcm\shared\rootworkspace\jcr_root\423dc4e4\8632bc4e\%57orkflow\%41ctions\18bdfa32\e910e1b8.value (The system cannot find the path specified.)

This baffled me completely, until I compared the message with the content / path of the contents of the extracted IBM.WebSphere.Portal.Content.Templates.Catalog directory, which needs to be copied into D:\IBM\WebSphere\PortalServer.

The error message referred to: -

d:\IBM\WebSphere\PortalServer\IBM.WebSphere.Portal.Content.Templates.Catalog\components\sample.ctc.content\content\wcm\shared\rootworkspace\jcr_root\423dc4e4\8632bc4e\%57orkflow\%41ctions\18bdfa32\e910e1b8.value

whereas when I explored the file system via Windows Explorer, I was seeing: -

d:\IBM\WebSphere\PortalServer\IBM.WebSphere.Portal.Content.Templates.Catalog\components\sample.ctc.content\content\wcm\c-content\rootworkspace\jcr_root\423dc4e4\8509a2db\%002557orkflow\%002541ctions.node

I don't claim to understand WHY this is the case, but I'm assuming that it's something to do with Windows Explorer and, perhaps, 255 character path lengths ?

Interestingly, the Windows DIR command shows the same weirdness e.g.

%002557orkflow.node

rather than: -

%57orkflow.node

In the end, I was able to resolve the problem by avoiding the use Windows Explorer etc. and manually extracting the content of the ZIP file ( 1WP1002G6_615.zip  ) from the Windows command prompt using the PKZip utility, unzip.exe, and then copying the IBM.WebSphere.Portal.Content.Templates.Catalog directory structure into place using the XCopy /S command.

By this time, however, the repeatedly failing import had left my JCR repository in a bit of a muddle; I had to manually delete the content libraries that had already been imported e.g. TB_Catalog, TB_Core etc. using the Web Content Libraries portlet whilst logged in as wpsadmin. I then restarted WebSphere Portal for good measure.

Having done all of the above, I was able to successfully run the install.bat script and, after 19 minutes and 28 seconds, the CTC installed, and I now have lots of content loveliness at which to look.

The moral of the story ? Stick to the command line :-)

I'll feed this back to the Dublin lab. in case there's anything that I'm doing wrong ...

PS I'm running the VM on a Thinkpad W500 with 4 GB total, and 2 GB allocated to Windows.

No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...