Friday Jan 16, 2015

Using the Oracle Public Maven Repository With ADF Applications

Apache Maven lovers, rejoice! Thanks to the Fusion Middleware team, Oracle now has a public repository for you to use! It is located at The official Fusion Middleware documentation even contains a section on how to configure your environment to leverage it. While accurate, this documentation is fairly generic. My aim in this post is to explain you how to use the repository with ADF applications. I recorded a video demonstration as well.

I started to use Maven with ADF back in 2007, when the first technical previews for 11g were made public. I had used Maven on other Java projects before. I was the architect on a large software development project and wanted my team to implement a workflow build around continuous integration principles. At the time, JDeveloper didn't support Maven. Thus, we had to deploy our own internal repository. I wrote a tool to scan the JDeveloper extensions, extract the various JAR files and import them in the repository. Nowadays, this process is automated; you simply have to use the Maven Synchronization Plug-in.

JDeveloper is not only compatible with Maven, but it actually ships with it. This started with Maven 3.0.4 back in version 12.1.2. JDeveloper 12.1.3 brought small but significant improvements to Maven support, and updated the Maven version to 3.0.5. I strongly recommend you to use the Maven release that ships with JDeveloper, as the various Oracle plugins involved may not have been tested with later releases. You will be on your own if you do otherwise.

Let's now see in detail how to setup your environment in order to compile and deploy ADF applications with Maven from the command line.

Step 1: Register 

The repository may be public, but you need to register in order to access it. This is to ensure you have accepted the licence agreement for the artifacts it contains. You can register here:

Every time you will access the repository, you will need to provide your OTN user name and password. 

Step 2: Create environment variables and alter the path. 

The Maven distribution bundled with JDeveloper is located in the following directory. 


You have to create two environment variables: M2_HOME, which must point to the directory above, and M2, which must be set to %M2_HOME%\bin on Windows or $M2_HOME/bin on Linux and OS X. You must add the M2 variable to the PATH as well. In addition, ensure JAVA_HOME exists and points to a valid Java install.

Once you are done, you may test your setup by executing the maven -version command on the command line. Below is the output I get on a Windows 8.1 machine. 

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\Frédéric>mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
Maven home: C:\Oracle\jdev1213\oracle_common\modules\org.apache.maven_3.0.5
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: c:\Java64\jdk1.7.0_60\jre
Default locale: en_CA, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

Step 3: Define the repository 

You must provide Maven the information it needs in order to connect the repository. This can be achieved by adding a repository definition either to your POM or to Maven's settings.xml file. Personally, I prefer to go the settings.xml route since such information will likely be shared among several applications.

Typically, setting.xml is found in the user's home directory under the .m2 subdirectory.  On my Windows machine, the full path is c:\users\Frédéric\.m2. The equivalent path would be /Users/Frédéric/.m2 under OS X. You can learn more about this file on the official Maven website

To ensure that the repository definitions contained in settings.xml will be available at runtime, they should reside in a profile marked as active by default. 


The repository definition  must look like this:


Only releases are enabled, since Oracle will not deploy snapshots to the repository. In addition, I set the update policy to never since Oracle will not provide patches or other updates. New artifacts will be published for future releases of ADF, but you will have to explicitly reference the new version numbers in your POMs to pick them up. We did this for stability reasons.

The repository is defined twice; once as an artifact repository and once as a plugin repository. The latter is needed since the ojmake and ojdeploy plugins are needed in order to build ADF applications. Moreover, the WebLogic plugin might be required for runtime deployment. This distinction between artifact and plugin repositories has been introduced in Maven 3.

Step 4: Update Wagon-http 

Wagon-http is a component used by Maven to access remote repositories. The Oracle public Maven repository is protected by the same single sign-on (SSO) solution that other Oracle web sites use. Unfortunately, older versions of wagon-http are not compatible with such enterprise-grade infrastructures. However, it is possible to override the version that is bundled with Maven.

To use the Oracle repository, you will need wagon-http 2.8. Simply download the required JAR file from the following location:

You will then need to copy the file to the M2_HOME\lib\ext directory. 

Please note that wagon-http 2.8 is included in Maven 3.2.5 and higher. Thus, this step will likely become unnecessary in the future, since new releases of JDeveloper will probably provide an even more recent build of Maven.  

Step 5:  Define the server

While is is possible to define repositories in the POM, certain settings must absolutely be defined in the settings.xml file. Here is how the server definition look like.

	  <realm>OAM 11g</realm>

 In theory, you could write your password in clear text and things would work. However, Oracle strongly recommends that you encrypt the password using the tools provided by Maven.

Step 6: Encrypt your password 

There are two tasks to perform in order to complete this step.

First, you must generate and store a master password. This password is used to encrypt other passwords and should not be the same used by your Oracle account. To generate it, open a command prompt and execute the following command:

mvn --encrypt-master-password <password>

This will give you back a string such as {RpmTqVoMD0kHBbAIe2Jq1vdcM8HuPb/uvdnO+R4c67g=}.You should then create a file called settings-security.xml in the same folder as the settings.xml file used by Maven. The contents of this file should look like this:


 Once you are done with the master password, you can encrypt the actual password for your account using the command below.

mvn --encrypt-password <password>

 Simply paste the string returned in the server definition that you created in step 5.

Step 7: Add the WebLogic plugin to your POM 

If you want to deploy your ADF application to WebLogic through Maven, you will need to reference the appropriate plugin in its top-level POM. 


In this example, the WLS administrative password has been specified in clear text. The userConfigFile and userKeyFile parameters make it possible to encrypt the password, however. In addition, the source parameter must point to the EAR produced by the build process. The name for that EAR is managed through JDeveloper settings, and not through the POM. Moreover, please note that the value for the targets parameter should be set to DefaultServer if you want to deploy to the JDeveloper integrated WLS instance.

The WebLogic plugin requires a specific JAR in the classpath in order to execute. This requirement can be fulfilled by adding this dependency to the POM:


The systemPath parameter must be the absolute path to the weblogic-classes.jar file. 

Step 8: Update your JDBC settings

In the case you plan to deploy your ADF application to WebLogic using Maven, you need to change a specific JDBC setting using JDeveloper. The reason for this is that, normally, the IDE will regenerate the WLS JDBC descriptors at deployment time. Unfortunately, this results in an error message when deploying without JDeveloper, whether through the command line or the WLS console. The specific error message is: « No credential mapper entry found for password indirection »

To avoid this, create a JDBC datasource on the WLS server and uncheck the following setting in the Application Properties dialog. 

Please note that defining a credential mapping using the WLS console will not work.  

If you have deployed the application from JDeveloper before, you will need to delete the generated weblogic-jdbc.xml and remove the reference to it inside the weblogic-application.xml descriptor. You will find both files under the src/META-INF subdirectory of the application workspace.

Step 9: Let's do this!

You are now ready to compile and deploy your application. You can do so on the command line only for the time being. Moreover, you will need to specify a value for the ORACLE_HOME environment variable, since this is normally something JDeveloper will do for you. Here is an example:

mvn pre-integration-test -Denv.ORACLE_HOME=c:\Oracle\jdev1213

 Just remember to make sure the JDeveloper integrated WLS instance is running before starting the build process if you want to deploy on it.

At this time, it is not possible to index the contents of the Oracle public repository. We will need to update JDeveloper in order to make this possible. 

Monday Oct 07, 2013

ADF at 12c: time to get the facts straight

The 12c release is a major milestone both for ADF and JDeveloper. Most of you already know how strategic ADF is to Oracle; day after day, thousands of our own developers use it to build Fusion Applications, Enterprise Manager, SOA Suite and WebCenter among others. What is not readily apparent is how much maturity there is in the framework. The roots of ADF can be traced back to 1999, when the first release of Java Business Objects (JBO) was made available. The ancestor of today's ADF Faces components, User Interface XML (UIX), has been introduced in 2002. More than ten years later, ADF is still going strong and the best is yet to come.

I have been developing with ADF since 2007. Since then, I often had the opportunity to introduce new developers to it. While I was often greeted with skepticism, the natural qualities of the framework and the productivity brought by JDeveloper usually won minds if not hearts. I saw this once again at OpenWorld 2013. Obviously, ADF is not perfect and there are several worthy alternatives in the market. But what surprises me is that many of the objections made against ADF stem from misconceptions - even after all those years. Here are five of the most common ones:

  • ADF is not open.
  • ADF is just for huge enterprise applications.
  • ADF is proprietary.
  • ADF is tied to JDeveloper,  Weblogic and Oracle Database.
  • ADF is expensive.

My aim in this post is to get the facts straight. Let's discuss each of them.

ADF is not open

This is something I heard frequently. But what does « open » mean? Is it about access to the source code? About technical interoperability? Maybe about stewardship? Customers covered by a valid support contract can request access to the ADF source code. Not only that, but some of its components have been released under open-source licenses, the most significant being Apache MyFaces Trinidad. And since ADF is built on the top of Java Enterprise Edition, it integrates with other solutions running on the platform. True, Oracle keeps full control over strategic orientations and new features. But our company is making significant efforts to better address the concerns of the community. The ADF Enterprise Methodology Group, for example, is a great forum to propose and discuss new features. We follow closely what is posted there and will never hesitate to open enhancements requests if needed.

ADF is just for huge enterprise applications

This is a funny one, and probably comes from the fact that ADF is based on Java. Yet, small and simple applications are a cinch to implement with the framework; it focuses on productivity first. Lots of people forget that ADF favors a code last approach. In other words: most ADF artifacts can be implemented declaratively rather than through code. In addition, most of the time, developers will build the user interface simply by drag and dropping attributes from the data controls palette. Moreover, ADF puts great emphasis on reuse. Entity Objects, View Objects, Task Flows and Page Fragments are inherently reusable. You can push this even further by using page fragments, JSF templates and declarative components. Thus, you can reduce the actual size of your applications by sharing code extensively between applications. It is also essential to remember that ADF implements several common software patterns, such as Model-View-Controller, for you. This results in a little more complexity, but ensures that even the smallest of your applications adhere to industry best practices. 

ADF is proprietary

ADF is certainly unique to Oracle. In fact, it represents one of our biggest competitive advantages in the marketplace. Yet, some people conveniently forget it is a superset of Java Enterprise Edition first and foremost. ADF Faces, for example, is probably the most comprehensive set of JSF components available right now; the Data Visualization components now render to HTML 5 instead of Flash. On the other hand, ADF offers extensive support for the SOAP protocol and the WS-* extensions, which are industry standards. Yes, ADF deviates from JEE in some cases - but typically this is because it was ahead of the curve. ADF BC is rooted in JBO, a technology introduced in 1999. EJBs didn't deliver the performance and features required by developers at the time. In 2008, ADF Controller and Task Flows brought more flexibility than the standard JSF controller - which finally caught up in 2013 in JEE 7. We even make it possible to use EJB or JPA to implement business logic if you prefer them to ADF BC. 

Moving forward, you can expect ADF to integrate many more standards, but not at the cost of innovation.

ADF is tied to JDeveloper,  Weblogic and Oracle Database

This one was true a few years ago. Nowadays, you can build ADF applications in Eclipse by installing the Oracle Enterprise Pack for Eclipse plugins. You can use almost any SQL92-compliant database with ADF, and we even offer optimizations specific to IBM DB2 and Microsoft SQL Server. Best of all, we offer integration to various Application Lifecycle Management platforms in JDeveloper and OEPE, but are not offering one ourselves. You get to choose the tools you prefer to support your development process. And with the free ADF Essentials, you can deploy your ADF applications to nearly all containers implementing the Java Enterprise Edition web profile. GlassFish server is an obvious choice here, but old favorites like Apache Tomcat and JBoss can be used too. 

ADF is expensive

No, it's not. For a long time, ADF has been merely inexpensive as it was bundled with WebLogic Server. With ADF Essentials, the core features are free; the features cut from from it are essentially hooks to other Fusion Middleware products. The developer tools, by the way, are completely free. You cannot really appreciate that fact unless you had to pay for multiple IDE licenses for your team, something I had to do earlier in my carrier when I was building software for IBM and Microsoft platforms. 


ADF 12c is there. And it's here to stay. Maybe you should consider it...

Wednesday Sep 04, 2013

Out of the matrix: the ADF EMG goes to OpenWorld!

The ADF Enterprise Methodology Group is an invaluable resource for ADF architects and experienced developers. Where else on the web can you discuss best practices and methodologies to deliver enterprise-level ADF applications? If you like it as much as I do, you will be glad to know there is an ADF EMG day this year at Oracle OpenWorld. Yes, the EMG leaves the matrix and boldly comes to the real world for a full day of presentations by well-known experts from the ADF community. And there is no better way to prepare for the conference than to share stories from the trenches over a few beers ar the ADF EMG social night. I hope to meet you there!

Sunday Sep 01, 2013

Think TV is boring? Think again!

Since July, I have been busy contributing to an exciting new initiative from Oracle. Our aim is simple: to revolutionize TV! While Apple's infamous iTV is still little more than a rumor, we are delivering! Ok. Maybe I got a little carried away... Anyway, if you are an ADF architect or developer, you really should  check our ADF Architecture TV channel on YouTube. There, you will find a series of weekly episodes which will help you learn ADF design and best practices from key Oracle ADF specialists. This is real, deep technical content; not marketing fluff. Make sure you subscribe as we have over 100 episodes planned covering security, web services, PL/SQL integration, UI design and much more! This week's episode was recorded by Frank Nimphius and is about Task Flows. 

The episodes I recorded are about internationalization. There are five of them and cover resource bundles, character encoding and time zone management, among other things. I will let you know when they are released. 

Who would have thought TV could get this interesting? Here is the official trailer for the channel:

Monday May 06, 2013

From Russia with Java: answering the most frequently asked questions

Last week, I had the wonderful opportunity to visit Moscow and meet fellow Java developers. I was one of the presenters at the JavaOne Russia 2013 conference, on April 23 and 24. There, I talked about ADF, ADF Mobile and even forms. I was even able to spare a few hours for sightseeing...

When not presenting, I passed most of my time at the ADF Demo booth, where I fielded lots of interesting questions from attendees. Since some of these questions were asked quite frequently, I thought it would be interesting to answer them here.

  1. How do I get a license for ADF Mobile?
    Maybe you don't even need to buy anything! Isn't this great?

    ADF Mobile is bundled with ADF. Currently, there are two ways to license ADF: on its own or through a WebLogic Server license. If you buy named user licenses, you can distribute your ADF Mobile applications to those same users on the devices they own. On the other hand, you can distribute your applications to an unlimited number of users and devices if you buy a processor license. Thus, a processor license is your best bet if you plan to distribute your applications through the Apple and Google Play stores.

    If you hesitate between named user licenses and the processor license, the latter will be more advantageous if you have around 50 users or more. I am not in sales, and prices in your regions could affect the value equation so please check with a sales representative. 

  2. What is the difference between ADF, ADF Mobile and ADF Mobile Browser?
    Oracle Application Development Framework (ADF) is the toolkit at the core of Fusion Architecture. Through the ADF Faces set of components, it enables you to build rich and scalable web applications for desktop and high-end mobile devices (such as Apple's iPad), and can be used to build SOA backbones that will be accessed by Swing and JavaFX applications, among others. You can even integrate ADF back-ends in Microsoft Office through ADF Desktop Integration. ADF is built from the ground up for easy integration with the other components of Fusion Middleware, such as Oracle WebCenter and Oracle SOA Suite.

    Oracle ADF Mobile enables you to build Java applications that will run directly on most current iOS and Android devices. Its model and controller layers provide a developer experience very close to the ADF one. ADF Mobile applications can consume standards-based web services and work very well with ADF SOA back-ends.

    Oracle ADF Mobile Browser is a set of JSF components that you can use instead of the regular ADF Faces components to create web applications that target a wide variety of mobile devices. The pages produced will gracefully adapt to the device's capabilities in order to deliver the richest user experience possible.

  3. Oracle has got JDeveloper, Netbeans and Oracle Enterprise Pack for Eclipse. Why do you have so many IDEs?
    Exactly for the same reason your favorite car brand offers several models: because not everyone has got the same needs.

    Netbeans is the perfect complement to the GlassFish Application Server, which is the reference implementation for Java Enterprise Edition. Thus, it will be your IDE of choice if you want to benefit from the latest advances in that space. Moreover, Netbeans provides unparalleled tools for JavaFX applications.

    Oracle Enterprise Pack for Eclipse (OEPE), on the other hand, shows Oracle's commitment to the current market share leader in Java IDEs. Oracle has been a member of the Eclipse Foundation for a long time and contributes to at least ten distinct Eclipse subprojects. In the last few years, OEPE has added support for a number for Fusion Middleware technologies such as Oracle ADF. Thus, you can build Fusion Architecture applications using an IDE you already know and love.

    Finally, Oracle JDeveloper is the best development environment for building Fusion Architecture application. With deep support for both other Fusion Middleware products and Java Enterprise Edition technologies, it focuses on developer productivity. JDeveloper is heaviliy used internally at Oracle, especially by the Fusion Applications team.

  4. When will JDeveloper 12c be out?
    I wish I could tell you! Unfortunately, revenue recognition rules in the US prevent us to provide a better answer than « sometime this year » The product team is working very hard on it as I write this. 12c will be a very nice release, and the internal builds I used recently show great promise. 

I hope you found my answers useful. During my flight back home, I got a fortune cookie with my meal. I got two prophecies and really hope they will come true...

Tuesday Mar 19, 2013

ADF Mobile and SDO: making the connection

One of the great difficulties in building a mobile application is building a strong web service back-end. If you are using ADF BC as your data access layer, service-enabled application modules are a compelling option. My good friend Frank Nimphius published an article in Oracle Magazine on that very topic, titled Consume Early; Consume Often

In the perspective of an ADF Mobile application, the web service methods exposed by the SDO interfaces of ADF BC view objects are accessed through the web service data control. It is worth remembering that, at this point, SDO interfaces can be reached through the SOAP protocol only. Support for REST interactions is currently planned for ADF 12c. Fortunately, the WSDL description for the service is generated by JDeveloper.

It is possible to bind directly your AMX pages to the web service data control. Shay Shmeltzer has posted a few blog entries where he uses this technique, even for calling web services with complex parameters. Some use cases, however, can be implemented more cleanly by calling the web service data control in Java code, which implies the page is bound to a bean or to a POJO-based data control. But how does one invoke the web service data control from code?

The first step is to look at the structure for the data control. Suppose I want to call the createVisit method exposed by the VisitsWS data control. The method accepts a single input parameter of type java.lang.Object

Calling the method with any random object will not work. The data control expects an object of a very specific type, with attributes matching its own definition. It is possible to determine the name of the type expected by the data control by hovering above the parameter with the mouse pointer, as shown in the screenshot below.

VisitsWS.Types.createVisit.visit is not implemented through a Java class; it is a virtual type managed by the data control. In ADF Mobile, the web service data control, when operating over the SOAP protocol, requires parameters to be passed as instances of the oracle.adfmf.util.GenericType interface. The only way to instantiate such objects is to use the GenericTypeBeanSerializationHelper class provided by the framework.  This class will transform POJO instances to and from GenericType.

Below is a  code sample that shows how to build the GenericType and  invoke the web service through the data control.

Visit visit = new Visit();

// Set attribute values for visit here.

List namesList = new ArrayList(1);
List paramsList = new ArrayList(1);
List typesList = new ArrayList(1);

GenericType gtVisit = GenericTypeBeanSerializationHelper.toGenericType("VisitsWS.Types.createVisit.visit", visit);


try {
    AdfmfJavaUtilities.invokeDataControlMethod("VisitsWS", null, "createVisit", namesList, paramsList, typesList);
} catch (AdfInvocationException ex) {
    // If the web service is not available throw a nice exception
    if (AdfInvocationException.CATEGORY_WEBSERVICE.compareTo(ex.getErrorCategory()) == 0) {
        throw new RuntimeException("Error with the server. Please try later.");

There are a few things you should take into account when creating your POJO objects.

  • The attributes must have the same name as the data control attribute they are mapped to. 
  • The attributes must preferably be of type java.lang.String. Other types may work, but you may run into problems.
  • When manipulating dates, it is essential to express them in the ISO-8601 format expected by the SOAP service layer. This can be achieved through the oracle.adfmf.misc.ISO8601DateTimeUtil class.
  • If the service you invoke is based on a view object that contains attributes retrieved through a join that are marked as a reference, your POJO must declare these attributes as transient. This way, no values will be transmitted back to the server in the case of create and update operations. Failing to do so will raise a JBO exception on the server.  

By the way, if you found this post interesting, one of the two presentations I will make at the ODTUG Kaleidoscope 2013 conference in June will show you how to build flexible and SOA-compliant back-ends using Oracle ADF. See you in New Orleans! 

Sunday Jan 20, 2013

Internationalization: which bundle type is right for you?

Choice is one of the fundamental tenets of JDeveloper's approach to development. This probably explains why so many people on the OTN forums and the ADF Enterprise Methodology Group ask for guidance on picking the best alternative to handle specific use cases. Most of the time, the answer will start with: Well... It depends. Developer skills, functional requirements, performance expectations and other variables make it difficult to come up with a single, straightforward recommendation. This is the case with resource bundles. 

In the context of the Java platform, a resource bundle is simply a collection of objects related to a specific locale. Each object can be retrieved by its key, which must be unique among all the bundles available to an application. When a program needs a locale-specific resource, such as the string for an error message, it can load it from the resource bundle that is appropriate for the current user's locale. This mechanism allows you to write programs that can:

  • be easily localized, or translated, into different languages
  • handle multiple locales at once
  • be easily modified later to support even more locales
    Source: Javadoc for the ResourceBundle class. 

JDeveloper supports three different types of resource bundles: Java classes, .properties files and XLIFF files. All three behave exactly in the same way at runtime; choosing one type or the other will be completely transparent to the end user and will not likely impact performance or resource usage in a well-designed application. Why would you pick one type over the other, then?

[Read More]

Friday Dec 21, 2012

The great Windows 8 experiment

Two weeks ago, I decided to make the plunge: I upgraded my personal workstation to Windows 8. Why? Sure, I wanted to check if JDeveloper and WebLogic worked correctly. But I must admit my main motivation was curiosity. You see, when I read quotes such as: « On a regular PC, Windows 8 is Mr. Hyde: a monster that terrorizes poor office workers and strangles their productivity. », it was hard to resist the temptation of forging my own opinion. 

Today, I am writing this post under Windows 8. And I have no intention to go back to Windows 7.

I have very little to report about Oracle's Java tools. They simply just work, as I expected. The JVM  abstracts the underlying OS as on any other platform. I only had two small glitches up to now.

[Read More]

Thursday Dec 13, 2012

How to force ADF to speak your language (or any common language) in the logs

When I started working for Oracle, one of the first tasks I was given was to contribute some content to a great ADF course Frank and Chris are building. Among other things, they asked me to work on a module about Internationalization. While doing research work, I unearthed a little gem I had overlooked all those years. 

JDeveloper, as you may know, speaks your language - as long as your language is English, that is. Oracle ADF, on the other hand, is a citizen of the world. It is available in more than 25 different languages. But while this is a wonderful feature for end users, it is rather cumbersome for developers. Why is that? Have you ever tried to search the OTN forums for a solution with a non-English error message as your query? I have, once. But how can you force ADF to use English for its logging operations? 
[Read More]

Wednesday Dec 12, 2012

I owe you an explanation

Welcome to my blog!

I am Frédéric Desbiens, a new member of the ADF Product Management team.  I joined Oracle only a few weeks ago. My boss is Grant Ronald, and I have the privilege to work in the same team as Susan Duncan, Frank Nimphius, Lynn Munsinger and Chris Muir. I share with them a passion for all things Java and ADF. With this blog, I hope to help you be more successful with our products – whether you are a customer or a partner.  

[Read More]

Frédéric Desbiens

The musings of a member of the Mobility and Development Tools Product Management team.

I focus here on my favorite development frameworks, namely Oracle ADF and the Oracle Mobile Application Framework (MAF), but also have a strong interest in SOA and web services.

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.


« July 2016