Schlagwort-Archiv: ADF

Fix “INSTALL FAILED CONTAINER ERROR” when deploying MAF app to android emulator after system upgrade to Mac OS X Yosemite

During our Oracle MAF Hackathon we wanted to deploy our app to both android emulator and iOS simulator. Feeling giddy because of having XCode5 and Android SDK installed on my Mac I wanted to show our crowd that apps built with MAF are really multi-platform compliant. Confident of victory because deployment to android emulator succeeded a few weeks ago I started deployment. But this time an INSTALL_FAILED_CONTAINER_ERROR exception occurred:

After copying the “command-line executed” from log messages window into console a more detailed error message was shown.

Actually this error message does not point out the issue’s cause. In our case deployment failed because I upgraded my Mac OS X from Maverick to Yosemite what entailed the Intel Hardware Accelerated Execution Manager (HAXM) did not longer work. The emulator’s android virtual device (AVD) I used for deployment was configured to run with hardware accelerated „Intel Atom (x86)“ CPU instead of ARM. Switching this back to „ARM“ solved the problem with the side-effect of losing hardware accelaration. Recognizing that something with HAXM went wrong I decided to upgrade my HAXM installation via Android SDK Manager. HAXM can be found under node „extras“:

After upgrading my HAXM installation there were two dmg packages: One for Mac OS installations below 10.9 and one for Mac OS X 10.9 and above.

Re-installing the appropiate package for Maverick/Yosemite (10.9 or higher) re-enabled me to deploy our Oracle MAF app to an android emulator’s AVD that uses an Intel CPU with hardware acceleration.

Maybe this helps someone out there to save time for investigating the cause of the error message we got during deployment.

Using log4j2 in an Oracle ADF 12c Application

Configure ADF12c application to work with log4j2

One of our customers had the requirement to use log4j 2 in his ADF 12c application. When executing his code

an UnsupportedOperationException was thrown.

To resolve this issue you can configure your ADF12c application to use a specific implementation of DocumentBuilderFactory. This is quite simple and straightforward. Just configure your weblogic specific deployment descriptor (weblogic-application.xml) to use

as application’s DocumentBuilderFactory implementation. This is what worked for us. Other implementations of DocumentBuilderFactory might be valid, too. To configure the DocumentBuilderFactory you can use JDeveloper tooling:

This will put the following lines into your weblogic-application.xml:

To dodge possible other unsupported operations, we also provided values for SAX Parser Factory and Transformer Factory:

  • SAX Parser Factory: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
  • Transformer Factory: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl

The screenshot below shows our configuration:

 

Prerequisites

The following JARs have been added to project’s classpath:

  • log4j-api-2.1.jar
  • log4j-core-2.1.jar
  • log4j-web-2.1.jar

These files are contained within the log4j2 download package.

Follow ups

Without providing any configuration file log4j2 will log our messages on console. To configure another behavior just put a configuration file into your project’s src directory (e.g.  ./Model/src or ./ViewController/src).  The  configuration file itself can be written in XML, JSON, or YAML. For more information on the expected syntax have a look at log4j2’s official documentation.