Monday, September 26, 2011

Consuming External Web Services in UCM11g

In our project, we were trying to consume external web services from a component in UCM 11g but were unsuccessful for a long time.

The component in 10g to consume web services was working very well but when upgraded to 11g, this component was not working.

In 10g, we bundled the stub classes as a jar and deployed it as part of custom component ($Component/lib). When this component was deployed in 11g, we were getting the below error.

Illegal Argument Exception..............
Interface not visible from class loader.


It was clear from the error that the stub classes are not loaded to the correct class loader.

Finally we achieved it by placing the stub jar in the $DOMAIN_DIR/lib folder where $DOMAIN_DIR is the UCM Domain. Then removed the jar from the component and its class path and restarted and then it started working.

If there is a better solution to the problem, please leave your suggestions as comments.

Saturday, August 27, 2011

Content Server won't start with CSDS failing to get initialized in UCM 11g

Recently I got the below error, because of which my managed server (content server) in UCM 11g was getting started with errors but the application won't come up.

Failed to initialize the application 'CSDS' due to error com.rsa.jsafe.JSAFE_PaddingException: Could not perform unpadding: invalid pad byte..

CSDS is the datasource for the DB that UCM connects to. The CSDS datasource configuration and test connection can be done from the Weblogic Server(WLS) console.

The configuration for CSDS that is viewed through the WLS console is stored in the file
cs-ds-jdbc.xml

The file is located in the below path
$MiddlewareHOME/user_projects/domains/YOUR_DOMAIN/config/jdbc/cs-ds-jdbc.xml

The above mentioned error is due to the encrypted password getting corrupted and to resolve it just replace the encrypted password with its corresponding clear text value in the file cs-ds-jdbc.xml

The password is the schema password to connect to the UCM schema.

Then restart the server, it should start without any errors and the application should come up.

Hope this helps someone.

Weblogic server won't start with invalid pad byte error

Many of us would have faced the below error and weblogic server won't start shortly after either extending a domain or creating a domain or done something related to domain.
weblogic.security.internal.encryption.EncryptionServiceException: com.rsa.jsafe.JSAFE_PaddingException: Could not perform unpadding: invalid pad byte.

I use weblogic 10.3.4. This error occurs when the SerializedSystemIni.dat file gets corrupted. It simply means that the server is unable to decrypt the encrypted passwords because the file that has the hash value to decrypt it - SerializedSystemIni.dat - has got corrupted.

There is nothing to worry though, this error could be resolved easily.

All the encrypted passwords in the file config.xml should be replaced with its corresponding clear text (ordinary text) values and then start the server.

For example if weblogic@123 was your password for the server, then follow the below steps to solve the error.
1) In SecurityConfiguration tag, do the following.

i) Replace
<node-manager-password-encrypted>{3DES}Va1McYXiUPirK77U+SQfMg==</node-manager-password-encrypted>

with

<node-manager-password-encrypted>weblogic@123</node-manager-password-encrypted>

ii) Replace
<credential-encrypted>{3DES}diqufr0TEjlJuLvdnhvtCxEUbxr0yIm8dadNaJRqiefJgGQqcWagiY4tlLX3I3pWa/jpBKeMzyEJgufp/725y1/PXSt0mWOh</credential-encrypted>

with

<credential-encrypted>weblogic@123</credential-encrypted>

2) In the EmbeddedLDAP tag do the following.

Replace

<embedded-ldap>
<name>Your_Domain</name>
<credential-encrypted>{3DES}OVxKttua/KHdFNAxuTypkcPZFAcC8kSHQ4X/ZrhTRLUFLAGocQP0yBT7xX7qijqTBMcMBuXkPq0PC19KDuGy2/fAUXMUGpUn</credential-encrypted>
</embedded-ldap>

with

<embedded-ldap>
<name>Your_Domain</name>
<credential-encrypted>weblogic@123</credential-encrypted>
</embedded-ldap>

Now start your server. It should start without any error.

Note: A word of caution - don't change the order of any of the tags in the config.xml file because if you change it, then you get SchemaValidator error. Just replace the encrypted passwords with its corresponding clear text values.


Friday, July 29, 2011

Hiding Navigation Menus in UCM 11g

I was facing problem in hiding the menus that were coming by default - Search and Check In in UCM11g. It took a little time to find out the syntax to make the OOTB menus disappear in 11g.

There is a dynamic html named navigation_filter_rset_menu_item which is used for this purpose. This dynamic html is defined in the file "std_nav.idoc". Follow the below steps to hide the default menus in UCM 11g.

1) Create an environment variable in your component's environment.cfg file.
ShowOOTBMenus=false

2) <@dynamicdata CoreMenuItems@>
id, label, linkType, linkData
MY_MENU, MY Custom Menu, cgi, IdcService=CUSTOM_SERVICE
<@end@>

3) <@dynamicdata CoreMenuItemRelationships@>
parentId, id, loadOrder
MENU_A, MY_MENU, 30
<@end@>

4) <@dynamicdata CoreMenuItemsFlags@>
id, flags
NEW_CHECK_IN, isContributor:isShowOOTBMenus
<@end@>

5)<@dynamichtml navigation_filter_rset_menu_item@>
<$include super.navigation_filter_rset_menu_item$>
<$if not tmpDeleteRow$>
<$if not isTrue(#env.ShowOOTBMenus) and flags like "*isShowOOTBMenus*"$>
<$tmpDeleteRow = 1$>
<$endif$>
<$endif$>
<@end@>

This should hide the Check In menu from the top horizontal menu. This is the same process for hiding the left navigation menus and sub menus.

Hope this helps.

Saturday, May 21, 2011

Javascript undefined error when using wwStrings in UCM 11g

A javascript error is thrown in UCM 11g when wwStrings is used in javascript as in 10g like wwStrings["someString"].

This is because in UCM 11g, wwStrings is moved to the namespace idc.string.wwStrings

So the syntax in UCM 11g to access the strings in javascript is lc("someString") .

It took all day long for me to figure out this.

Wednesday, May 4, 2011

Creating custom menu items in Oracle UCM 11g

A lot of things have changed in UCM 11g, and there is not much documentation or article on how to make things work as it did in UCM 10g.

One such thing is creating custom menu items in Oracle UCM 11g.

CoreMenutItems and CoreMenuItemRelationships resources are used to introduce menu items. Below is a sample code on how to get it done.

<@dynamicdata CoreMenuItems@>
id, label, linkType, linkData
MY_SEARCH, My Custom Search, cgi, IdcService=CUSTOM_SEARCH_SERVICE
<@end@>

<@dynamicdata CoreMenuItemRelationships@>
parentId, id, loadOrder
MENU_A, MY_SEARCH, 30
<@end@>

Keep checking this space, I will try to bring some more tips on how to achieve
few more things in UCM 11g.

Tuesday, March 15, 2011

Forcing the user to select an item from ajax suggest box using JQuery

Suggest boxes (Type Ahead box) are a great way to display a list of data from database or any other resource from a server in a text box.

There might be requirement at times to force the users to select from the items displayed in suggest box list and not allow them to enter anything other than the list displayed.

This can be done easily using JQuery. JQuery has a parameter named mustMatch which should be set to true. By default mustMatch is set to false. Here is an example.

$("#sampleSuggest").autocomplete("Server_URL",
{

minChars: 3,
max: 10,
multiple: true,
multipleSeparator: "\n",
mustMatch: true,
matchContains: true,
scrollHeight: 220,
}

mustMatch saved my day. I hope it saves someone else's day.