Friday, March 22, 2013

OJDeploy issue in PS4: when building multiple webcenter portal applications

OJDeploy Issue:
I have noticed the above said issue, when I was building multiple webcenter portal applications through Hudson (which uses ojdeploy). I was using below ojdeploy script to build these applications
ojdeploy -profile A_portal -workspace A-portal.jws
(A_portal - deployment profile name in A portal application)

I have noticed that first portal application has correct autogenerated mar file. But, on second, third and other applications it is copying the files from first mar file.



Explanation with example:
1. I have 3 portal applications: A, B, C
2. Build first application with ojdeploy, the mar profile it generates is correct on it. What I mean by that is, the autogeneratedMar.mar file has all the files from the A portal application.
3. When I build B and C applications. The ojdeploy was copying the mar profile from A application to B and C. So, B and C has autogeneratedMar.mar with all the files from A.

Note: I was not able to reproduce this issue when I was using JDeveloper to build these applications.

To resolve this issue, I have created custom mar profile in each of the applications and selected below options in the MAR deployment profile:



User Metadata > Directories: 'oracle' checked.
HTML Root Dir for Portal > Directories: 'oracle' checked.
Updated each EAR deployment > Application Assembly: checked.




Build these applications using ojdeploy (same script). The problem was resolved.
Each application has their own mar files (example: A portal application has A.mar, B has B.mar and C has c.mar file). Each mar file has files from the same application.

But, when I deploy these application to the webcenter domain. The application was throwing below exception:
oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/oracle/webcenter/peopleconnections/profile/metadata/people-p
rofile-config.xml"

Oracle support team found that the adf-config.xml(inside .adf/META-INF) is the issue.

It appears that this is a subtle JDeveloper quirk. For example, open the MAR deployment profile (in Application Properties) and click 'User Metadata' > 'Directories'. It will have oracle / webcenter / portalapp / pages, pagetemplates tree. If I check the top-level 'oracle' node to automatically select all of the child nodes, the problematic entry will be written to the adf-config.xml:

However, if I select the nodes from the bottom of the tree (i.e. pages and pagetemplates), the adf-config.xml will be written correctly. The same holds for the 'HTML Root Dir for Portal'. I tested this from a number of angles, and it always works for me.

I am not sure if the custom mar file issue is reproducible in PS5 environment. I have faced this issue in PS4 environment. But, if you notice this problem you know what to do now.

Wednesday, February 22, 2012

ADF application running on clustered environment - High Availability

In order for an ADF application to support High Availability in clustered environment with server fail over. The below steps must be followed in developing an ADF application.
  • All Manage Beans must implement Serializable.
  • UI component bindings must be declared in a bean with shorter scope (backing bean scope or request scope).
  • If it needs to be declared in Manage Bean with PageFlowScope (Not recommended), please ensure you declare the binding as transient.
  • Any objects that are declared as an attribute in Manage Bean must be Serialized.
The following files must be modified to make an ADF application High Available in clustered environment.

adf-config.xml


<adf-controller-config xmlns="http://xmlns.oracle.com/adf/controller/config">
     <adf-scope-ha-support>true</adf-scope-ha-support>
</adf-controller-config>

weblogic.xml


<session-descriptor>
      <persistent-store-type>replicated_if_clustered</persistent-store-type>
</session-descriptor>

For testing, please add the below parameter in your weblogic domain 
setDomainEnv.cmd
-Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=all

Run each use case in UI application. Verify that you don’t see below highlighted errors in Domain console log.

[2012-02-22T13:29:25.383-06:00] [manageserver1] [ERROR] [] [oracle.adfinternal.controller.state.SessionBasedScopeMap] 
java.io.NotSerializableException: com.ram.mytest.manage.TestMB


Sunday, February 19, 2012

Programmatically resetting the ADF components

oracle.adf.view.rich.util.ResetUtils - An util class to reset the components.

ResetUtils.reset(javax.faces.component.UIComponent startComponent)

All values submitted will be reset to null or empty, so that editable components will pull their values from the model.

Sunday, December 12, 2010

Display validation messages on top of the page instead of popup

Validation messages can be displayed either as popup or on top of the page. 
To diplay the messages on top of the page. Add below tag at start of the page.
<af:messages id="m1" inline="true"/>

Monday, November 15, 2010

ADF Memory Scopes

Scopes in the context of pages(jspx)


Scopes in the context of fragments(jsff)



Sunday, November 14, 2010

Building ADF Jar using maven

You can build ADF jar using maven.
Steps:
In order to build ADF application using maven you need to add 2 plug-ins to the POM file
1. compiler plugin
2. ant plugin.
    Ant plugin is used to run the ojdeploy build xml file.
    ojdeploy build xml should have the deployment profile information.

Declarative way to allow an action to set value before navigation

On Actions like CommandButton, CommandLink,.. you can allow them to set value before navigating to another page by using <af:setActionListener>

Example:
<af:commandLink text="#{row.formattedName}" id="cl1" action="toSavePage">
 <af:setActionListener from="phoneNumber" to="#{pageFlowScope.phoneNum}"/>
 <af:setActionListener from="#{row.empId}" to="#{pageFlowScope.selectedEmployeeId}"/>
 </af:commandLink>