Friday, April 4, 2014

ADF XML Files

Oracle ADF documentation describes a lot of XML files used internally in each ADF application. As documentation says the files are used by applications to:
  • Specify the parameters, methods, and return values available to your application's Oracle ADF data control usages
  • Create objects in the Oracle ADF binding context and define the runtime behavior of those objects
  • Define configuration information about the UI components in JSF and ADF Faces 
  • Define application configuration information for the Java EE application server
In the typical ADF application we are dealing with two main elements: model layer and view-controller layer.

Model layer

ADF Model implements concepts that enable decoupling the user interface technology from the business service implementation: data controls and declarative bindings.

Data control layer
In the data controllayer we have the data control implementation files: entity and view object definitions, view links definitions, application module definition files. Generally speaking, it is a set of files visible in a typical ADF Model porject. These files, in conjunction with the bc4j.xcfg file, provide the necessary information for the data control.

Data binding layer
In the each typical data aware view-controller project we can find a set of files responsible for "data binding" functionality:
  • DataBindings.cpx - one or more files. DataBinding.cpx defines the binding context for the entire application and provide the metadata from which the Oracle ADF binding objects are created at runtime. The file contains the page map, page definitions references and data control references, and thus maps individual pages to page definition files and declares which data controls are being used by the application.
  • adfm.xml: This file lists the DataBindings.cpx files that are available in the current project.
  • <pagename>PageDef.xml: Page definition XML files. They associates web page UI components with data and data controls.

Thursday, April 3, 2014

Problem with ADF and IE11

A new browser version released by Microsoft is not supported by ADF and what is worse, ADF web pages are not rendered at all. When you run ADF webpage in IE11, you will see message box:

Unsupported image

The problem is caused by ADF javascript layer, because in IE 11 the browser's User-Agent header has changed, and ADF no longer even recognizes the browser's product family. Additionally Oracle says, that "... internal testing has shown that there are many other changes in IE 11 that have an impact on ADF, and these all need to be evaluated before ADF can be certified for use with IE 11. Customers should bear in mind that, at this time, IE 11 has only recently been formally released, and the certification process takes some time."

To fix main part of problems with IE11 you should apply patch available on Oracle Support. The path is provided for JDeveloper/ADF 11.1.1.6.0, JDeveloper/ADF 11.1.1.7.0, JDeveloper/ADF 11.1.2.4.0 and JDeveloper/ADF 12.1.2.0.0.

Bellow I will show how to proceed with patch for ADF 11.1.1.7.0.

After you download zipped patch file run command line and go to unzipped path folder. By example:

C:\Users\mariusz\Downloads\PATCH_TOP>cd 18277370

Next you can start the first step of the path procedure:

C:\Users\mariusz\Downloads\PATCH_TOP\18277370>cd oui

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\oui>cd 18277370

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\oui\18277370>C:\Oracle\Middleware7\oracle_common\OPatch\opatch apply -jdk c:\oracle\jdk
Invoking Standalone OPatch 11.1.0.0.0

Oracle Standalone Interim Patch Installer version 11.1.0.0.0
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home            : C:\Oracle\Middleware7\oracle_common
Oracle Home Inventory  : C:\Oracle\Middleware7\oracle_common\sainventory
OPatch version         : 11.1.0.0.0
Product information    : n/a
Log file location      : C:\Oracle\Middleware7\oracle_common\cfgtoollogs\opatch\opatch2014-03-07_13-34-09PM.log

ApplySession applying interim patch '18277370' to OH 'C:\Oracle\Middleware7\oracle_common'

Running prerequisite checks...

OPatch finds no 'product.xml' in Oracle Home and will attempt to create 'product.xml' file.

Attempting to retrieve patch inventory's "product" and its "version" information...

Please enter your choice to enable OPatch to create 'product.xml' file or quit creation...


Choice                          Product                         Version
------                          -------                         -------
1                               SA_JDEV                         11.1.1.7.0

2. If you wish, quit 'product.xml' creation

Please enter [1-2]:
1
User Responded with: 1

OPatch will put the information of selected product 'SA_JDEV' and selected version '11.1.1.7.0'
in product.xml during inventory updation.


OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.


Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\Oracle\Middleware7\oracle_common')


Is the local system ready for patching?

Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '18277370' for restore. This might take a while...
Backing up files affected by the patch '18277370' for rollback. This might take a while...

Patching component oracle.jrf.adfrt, 11.1.1.7.0...
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\adf-richclient-api-11.jar"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\adf-richclient-automation-11.jar"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\adf-richclient-impl-11.jar"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\adf.oracle.domain.webapp.war"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\dvt-faces.jar"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\oracle-page-templates.jar"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\trinidad-api.jar"
Copying file to "C:\Oracle\Middleware7\oracle_common\modules\oracle.adf.view_11.1.1\trinidad-impl.jar"
ApplySession adding interim patch '18277370' to inventory

Attempting to create/replace 'product.xml' as requested...

"C:\Oracle\Middleware7\oracle_common\product.xml" file under Oracle Home is successfully created.

Verifying the update...
Inventory check OK: Patch ID 18277370 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 18277370 are present in Oracle Home.

The local system has been patched and can be restarted.

OPatch succeeded.
OK. Path succeded, and we can start the next step:
C:\Users\mariusz\Downloads\PATCH_TOP\18277370\oui\18277370>set oracle_home=C:\Oracle\Middleware7\jdeveloper

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\oui\18277370>cd ..

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\oui>cd ..

C:\Users\mariusz\Downloads\PATCH_TOP\18277370>cd sa

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\sa>cd 18277370

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\sa\18277370>C:\Oracle\Middleware7\oracle_common\OPatch\opatch apply -jdk c:\oracle\jdk
Invoking Standalone OPatch 11.1.0.0.0

Oracle Standalone Interim Patch Installer version 11.1.0.0.0
Copyright (c) 2007, Oracle Corporation.  All rights reserved.


Oracle Home            : C:\Oracle\Middleware7\jdeveloper
Oracle Home Inventory  : C:\Oracle\Middleware7\jdeveloper\sainventory
OPatch version         : 11.1.0.0.0
Product information    : n/a
Log file location      : C:\Oracle\Middleware7\jdeveloper\cfgtoollogs\opatch\opatch2014-03-07_14-09-44PM.log

ApplySession applying interim patch '18277370' to OH 'C:\Oracle\Middleware7\jdeveloper'

Running prerequisite checks...

OPatch finds no 'product.xml' in Oracle Home and will attempt to create 'product.xml' file.

Attempting to retrieve patch inventory's "product" and its "version" information...

Please enter your choice to enable OPatch to create 'product.xml' file or quit creation...


Choice                          Product                         Version
------                          -------                         -------
1                               SA_JDEV                         11.1.1.7.0

2. If you wish, quit 'product.xml' creation

Please enter [1-2]:
1
User Responded with: 1

OPatch will put the information of selected product 'SA_JDEV' and selected version '11.1.1.7.0'
in product.xml during inventory updation.


OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.


Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = 'C:\Oracle\Middleware7\jdeveloper')


Is the local system ready for patching?

Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '18277370' for restore. This might take a while...
Backing up files affected by the patch '18277370' for rollback. This might take a while...

Patching component oracle.jdeveloper, 11.1.1.7.0...
Copying file to "C:\Oracle\Middleware7\jdeveloper\adfv\jlib\oracle-page-templates.jar"
Copying file to "C:\Oracle\Middleware7\jdeveloper\jlib\oracle-page-templates.jar"
ApplySession adding interim patch '18277370' to inventory

Attempting to create/replace 'product.xml' as requested...

"C:\Oracle\Middleware7\jdeveloper\product.xml" file under Oracle Home is successfully created.

Verifying the update...
Inventory check OK: Patch ID 18277370 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 18277370 are present in Oracle Home.

The local system has been patched and can be restarted.


OPatch succeeded.

C:\Users\mariusz\Downloads\PATCH_TOP\18277370\sa\18277370>

Tuesday, February 4, 2014

Glassfish: Secure Admin must be enabled to access the DAS remotely

Some times ago I wrote article about installation of Glassfish server 3.1.x on Debian.or Ubuntu. You can find this article here.

But in the fresh installation you can't run administration console from remote IP. If you try this, you will see an message: "Secure Admin must be enabled to access the DAS remotely".

To activate Secure Admin, you have to:
  • start Glassfish server
  • go to you Glassfish installation bin folder, by example: /home/glassfish/glassfish3/bin
  • run asadmin enable-secure-admin
But. In the fresh installation, you will see here next error message:  "remote failure: At least one admin user has an empty password, which secure admin does not permit. Use the change-admin-password command or the admin console to create non-empty passwords for admin accounts."

So you first need to run: asadmin change-admin-password and put the new password.
Then you can safely use the command again: asadmin enable-secure-admin

To complete the described procedure you need to restart the Glassfish server. Finally after this operation you can run Glassfish console. Usually, if you have not changed the default ports, the console is available at: https://your_flassfish_server_ip:4848 .

Thursday, January 16, 2014

VS: Web Publish raises an error: Could not connect to the remote computer, ... , ERROR_COULD_NOT_CONNECT_TO_REMOTESVC. The remote server returned an error: (403) Forbidden.

Above error was raised when we tried to deploy Web Application to a remote IIS server:



The detailed message was:


I tried to resolve an error as shown in IIS.net, but without any success. I gone through the link and checked all the points mentioned there. Both Web Management Service and Web Deployment Agent Service are running fine. In event log on remote server I don't found also any errors. Strange.

Finally I found verry simple (but why not documented) solution. To fix the problem you should go to IIS management console (on remote machine of course) and select appropriate host:

 Next you should select Management Service, as shown above.

In management service form you should check "Enable remote connections" checkbox which is in default unchecked. Next restart IIS instance and voila, Web Deployment works.

ADF: difference between Create and CreateInsert

Today I met a simple question: what difference exists between Create and CreateInsert operation?

Operation "Create" will create the record but not put it in the VO's recordset whereas operation "CreateInsert" will also create new, empty record and puts it in recordset.


There is a practical effect of described difference. Create Insert should be used to insert new record to af:table, because when you use Create instead, record will be created but not shown in the table. With adf forms you can use Create or CreateInsert.

Wednesday, November 6, 2013

Oracle SOA: How to Configure Transaction Timeout for BPEL on SOA 11g

During runtime of your BPEL process you may be seeing errors like this:

Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: 
Transaction timed out after 30 seconds 
BEA1-484455D7A39364D50D1F
 at 
weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1788)

 at 
weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1676)

 at 
weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1988)

 at 
weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1586)

 at 
weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35)
 at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
 at 
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)

 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
; nested exception is: weblogic.transaction.internal.TimedOutException: 
Transaction timed out after 30 seconds 
BEA1-484455D7A39364D50D1F

The solution is typically to increase the transaction timeout for the process.
But how do we could configure transaction timeout for BPEL on SOA 11g?

In the first, before we start changing, we should keep in mind two generall rules:
  • This solution is ONLY applicable to Sync Processes
  • syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout

Let's start from syncMaxWaitTime. This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.

To change default value you should run Enterprise Manager and go to Farm -> SOA -> "soa-infra" branch and next select from context menu: SOA Administration -> BPEL Properties and expand "More BPEL Configuration Properties...".


Next thing you can change is BPEL EJB's transaction timeout. You can/should update the timeout for following EJB's:
  • BPELActivityManagerBean
  • BPELDeliveryBean
  • BPELDispatcherBean
  • BPELEngineBean
  • BPELFinderBean
  • BPELInstanceManagerBean
  • BPELProcessManagerBean
  • BPELSensorValuesBean
  • BPELServerManagerBean
The timeout properties for the EJBs control the particular timeout setting for the SOA application, overriding the global setting specified by the JTA timeou.

To perform changes you have to run Administration Console, stop SOA server/cluster and next go to Deployments -> soa-infra and expand this position:


For each of cited EJB's you can change default timeout value in Configuration tab (you have to click on selected EJB to view its properties and next select second tab described as Configuration).

To modify Global Transaction Timeout go to Services -> JTA in Administration Console, as shown below:


After applying this change you have to restart Weblogic Domain.


Tuesday, November 5, 2013

New and usefull services in WebcenterContent 11.1.1.8

In last version of WebcenterContent (UCM) I found two, new, very usefull services. The first of them is COPY_REVISION service.

The COPY_REVISION service copies one document revision, creating a new rev class from it. As says "Services Reference for Oracle WebCenter Content" most of the document metadata from the original revision will be carried over. The caller can also overwrite any metadata value by setting it in the request parameters.

You can use COPY_REVISION service as shown below:

// Databinder for Creating the clone request

DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "COPY_REVISION");

//Original Content dID and Content Id (dDocname)
dataBinder.putLocal("dID","1001");
dataBinder.putLocal("dDocName","001001");

//clone item Content ID - this is not mandatory - If set to Auto Content ID this need not be added 
//dataBinder.putLocal("newdDocName","Cloned_item");

//The user only needs READ permissions to the original document revision. 
//However, because the new revision inherits the metadata of the original, new security metadata values 
//must be set if the user does not have WRITE permissions to the original revision. By example you can modify group and ACL
dataBinder.putLocal("dSecurityGroup","New_better_group");
dataBinder.putLocal("xClbraUserList","your_user(RW)");

//If the original content is in a Contribution Folder (Folders_g) then below parameter is mandatory - Either blank Collection ID or set a new Folder ID
//In case of Framework Folder this parameter is not needed
dataBinder.putLocal("xCollectionID","1214234324324324");

//Clone Item's Content Title
dataBinder.putLocal("dDocTitle","Title-cloned");

//Any other new / custom metadata for Clone Item
dataBinder.putLocal("Custom","Clone Item Metadata");

Service returns two ResultSets:
  • NewDocInfo: Information about the newly created document.
  • OriginalDocInfo: Information about the original document that was copied.
Next interesting service is RESTORE_REVISION. The service restores the document revision corresponding to the supplied dID as a new (latest) revision.

To call this service you should supply only dID of source revision:


// Databinder for Creating the restore request

DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "RESTORE_REVISION");

//Original Content dID
dataBinder.putLocal("dID","1001");

As the results the service returns:
  • dID: The document ID of the new revision created.
  • dDocName: The document name of the new revision created.
  • dDocTitle: The document title of the new revision created.