Weblogic Portal Interview Questions

I thought i shall share some of the weblogic portal interview questions that I have come across. One would expect this kind of questions during interview and should be able to answer them. These questions are not in any particular order.

      1. Difference between a website and a portal?
Website is collection web pages, typically it contains information about particular company. A portal is a powerful web site that gives users a single point of access (or gateway) to applications and information in a unified interface. For eg, Yahoo.com(home page) is great example of a portal.  
      2. What are the features of portal?
 Portal has got many features. To name a few: Personalization,  Authentication(single sign-on) and content aggregation.
     3. What are components of weblogic portal?
Look and feel components, header & footer(Shell), Menus, layouts, books & pages, portlets.    
     4. What is the difference between streaming portal and file-based portal?
Portals come in two flavors: file-based and streaming. A file-based portal(.portal) also called a “light portal” obtains all of its resources from the user’s file system. Streaming portals, on the other hand, derive their  resources from one or more databases.
     5. What is backing file?
Backing file is java class used to pre-processing before portal object is rendered. The following portal controls support backing files:
    * Desktops
    * Books
    * Pages
    * Portlets
    * JspContent controls.
    6. How to create streaming portal/desktop?
Streaming desktop can be created using portal admin tool.
    7. What are the components of look-and-feel?
     Look & feel determines the appearance portal applications, it can be modified by developers programmatically or administrators using portal admin tool in staging and production environment. The following are components of look and feel:
  • Look & Feel file(.laf)
  • Skins
  • Skeletons
  • Themes
  • Chromosomes and Genes
  • Shells
  • Layouts
  • Menus  
     8. Difference between skin and skeleton?
Skins are collections of images, cascading style sheets (CSS), and JavaScript files that allow changes to be made to the look and feel of a portal without modifying the portal components directly. Skins basically provide the overall colors, graphics, and styles used by all components in a desktop interface.
Skeletons provide the physical boundaries of the portal components and provides references to the images, CSS, and JavaScript functions from the skin needed to render the portal. A portal web project can have multiple skeletons. When you select a Look & Feel for a desktop, a specific skin and skeleton is used. Each type of portal component, from a desktop to a portlet's title bar, has an associated JSP file, called a skeleton file that renders it.
     9. Difference between Genes and chromosomes?
Genes are implemented as simple text strings that are inserted into CSS styles or JavaScript files as variables. You define genes in an XML .chromosome file. In a .chromosome file, you could define a gene called "bodyColor" and assign it a value of "red," like this:
<gene name="bodyColor">
In your CSS file, you could use bodyColor as a variable:

body {
     border:1px solid ${bodyColor}
When the page is rendered in a browser, the inlined style definition becomes:

body {
     border:1px solid #FF0000
When you use this gene in your CSS files, you only need to modify the gene value itself to cascade the change throughout all configured CSS files rather than changing the value manually in each CSS file.
Chromosomes are simply the files that contain one or more genes. You can create multiple chromosome files that contain the same gene names, though with different gene values. By simply referencing a different chromosome in your Look & Feel file, you can simulate a completely different Look & Feel without changing any of your core Look & Feel files. 
     10. What is shell?
Shells define the header and footer regions of a portal. Shells control the content that appears in a desktop's header and footer regions. You can configure a shell to use specific JSPs, page flows, HTMLs to display content in a header or footer. You can place portlets too in a header or footer of a shell.
     11. Difference types of portlets?
  • JSP and HTML Portlets
  • JSR 168 portlets
  • Java Page Flow Portlets
  • Java Server Faces (JSF) Portlets
  • Struts Portlets
  • Remote Portlets
  • Browser (URL) Portlets
      12. How is IPC (inter-portlet communication) happening?
            Watch this page soon for an answer...

      13. What are portlet modes?
Portlet Modes allow you to affect the end user’s ability to edit the portlet or display Help for the portlet. You add icon buttons to a portlet’s title bar to indicate the availability of a mode. The following pre-defined modes exist for WebLogic Portal:
    * Edit – Lets you specify a custom file that lets users modify the portlet's content when they click the Edit button.
    * Help – Lets you specify a custom file that shows users help content for the portlet when they click the Help button.
You can also create your own custom portlet modes using WebLogic Portal.
      14. Types of portlet states?
Portlet states determine the end user’s ability to affect the rendering of a portlet. WebLogic Portal supports following portlet states:
  •     Normal – the typical rendered appearance of the portlet.
  •     Minimize – Collapses the portlet, leaving only the title bar, when the user clicks the Minimize button.
  •     Maximize – Makes the portlet take up the entire desktop area (not including the desktop header and  footer) when the user clicks the Maximize button.
  •     Float – Displays the portlet in a popup window when the user clicks the Float button.
  •     Delete – Removes the portlet from the desktop when the user clicks the Delete button.When you use the Portlet Wizard to create a portlet, state and mode settings are available on the Portlet  Details dialog. These settings can also be edited in the portlet’s Properties view. 
Useful Links:

Weblogic portal interview questions latest
More articles in Weblogic Portal

      Create authentication alias in Websphere Application Server

      I was recently involved in setting up the infrastructure for deploying web applications into Websphere App Server(WAS) v6.1. As a "weblogic bee", this is was something new to me. But over all, the experience was really great.

      The tasks involved in the whole process is given below:
      1) Installation of WAS6.1
      2) Creating profile called appProfile using Profile Management Tool (in weblogic we create "domains" using domain config wizard)
      3) Started the profile
      4) Created connection pools, data sources
      5) Resource reference mapping.
      6) Implement custom user registry.
      7) Deploy Web applications.
      8) Map security role to user/group mapping.

      After doing all of the above tasks, application would not connect to Data base using data source connection. It was throwing exceptions in the logs. It took couple of days to figure it out Websphere needs user name/password while creating connection. So login credentials can be passed

      a) programmatically but this is a bad idea as hard coding user id/password in the application code.
      b) create authentication alias mapping to a user name/password in websphere admin console

      So this alias name must be mapped while creating data source itself..

      ooooph! Finally it worked.

      If you don't create an alias while establishing connection using data source in Websphere 6.1 you may end up getting this error below: 
      Authentication Alias Websphere JNDI Data source Exception Connection Failed SQLException null userid is not supported. errorcode 4461

      Beware of StringUtils.containsIgnoreCase method in weblogic10.3

      In one of the web applications we use Apache commons-lang API version 2.3. We have put this library as part of web-inf/lib of the web application. But Weblogic10.3 also has it own version(2.1.0) under $BEA_home\module folder. So there was a conflict but weblogic would not throw any error :) We use StringUtils.containsIgnorecase() in one of the java classes. When this method is getting called weblogic simply hung.

      So we had to tell weblogic to load classes from web-inf not from original class loader. So in weblogic.xml we need to set prefer-web-inf-classes flag to true. This tells weblogic to load classes from web-inf folder first.



      This fixed the issue. I will take that.

      P.S:  For some web applications doing the above change might not help. In that case, commons-lang-2.4.jar needs to be added to PRE_CLASSPATH in domain's setDomainEnv.cmd. This should fix the issue.
      set PRE_CLASSPATH=C:\temp\commons-lang-2.4.jar;
      If you are running as a windows service, the jar needs to be added to beginning of the classpath.

      Create weblogic as a windows service

      By making entry in windows registry we can create weblogic server instance as windows service. To do this, we need to create a script which will have weblogic server-specific variables like domain name, server name, etc. This script calls master script called installSvc.cmd(${bea_dir}\wlserver_10.3\server\bin).

      Here are the steps:
      1. Go to${bea_dir}\wlserver_10.3\server\bin where bea_dir is home directory of weblogic installation.

      2. Create a file called createSvc.cmd with following values: please make sure you mention the right domain name, path and admin server instance name. Also check the path of installSvc.cmd it varies from one version to other.
          echo off
          set DOMAIN_NAME=sampleDomain
          set USERDOMAIN_HOME=c:\bea\user_projects\domains\sampleDomain
          set SERVER_NAME=Adminserver_name
          set PRODUCTION_MODE=false

          set JAVA_VENDOR=Sun
          set JAVA_HOME=C:\bea\jdk160_05
          set MEM_ARGS=-Xms256m -Xmx512m
          call "c:\bea\wlserver_10.3\server\bin\installSvc.cmd"

      3. Execute createSvc.cmd script from same folder c:\bea\wlserver_10.3\server\bin\

      4. This should create service with name of "beasvc sampleDomain_Adminserver_name" in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

      5. Also, if you go to services under Control panel, you should see the service with above name. Click the service to start. If you don't see it, there is some problem or sure. Check the path of domain and other variables in createSvc script.

      6. Also if there is an issue with start up, you may check the Admin server logs under domain.
      Good luck. Let me know  if you are running into any issues.

      How to change the default service name?
      As you know this script internal calls installSvc.cmd to create a windows service, this will prefix default "beasvc domain_name Adminserver....". To remove this prefix and have a custom service name, edit installSvc.cmd and look for beasvc and change the name you wanted to.
      "%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc %DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE%

      How to remove server instance as a windows service:
      Create a script called removeSvc.cmd and copy the following lines. Make sure adminServer name & domain name values are correctly set. And execute from the same place(c:\bea\wlserver_10.3\server\bin) where you created window service before.

      echo off
      set DOMAIN_NAME=sampleDomain
      set SERVER_NAME=AdminServer
      call "c:\bea\wlserver_10.3\server\bin\uninstallSvc.cmd"

      P.S: The name should be matching with the name given at the time of creating service in installSvc.cmd.