Saturday Jul 27, 2013

The ADF EMG day at Oracle Open World 2013 Sunday 22nd

I'm happy to say through the kind efforts of the ADF community volunteers, under the expert banner of ODTUG, the ADF EMG will be running another day of ADF sessions at Oracle Open World's user group Sunday 22nd September.  This adds another six ADF sessions and a whole day of solid ADF content for you to enjoy at the world's largest Oracle conference for developers.

The general announcement of sessions is covered on the ADF EMG forums, but a summary of the expert speakers and topics is here:

  • 8:00am - Oracle ADF Task Flows Beyond the 10-Minute Demo [UGF7001] - John King
  • 9:15am - Oracle on Your Browser or Phone: Design Patterns for Web and Mobile Oracle ADF Applications [UGF9898] - Floyd Teter & Lonneke Dikmans
  • 10:30am - ADF Performance Tuning War Stories [UGF2737] - Stephen Johnson, Frank Houweling, Eugene Fedorenko
  • 11:45am - Top 10 Web App Vulnerabilities, and Securing Them with ADF [UGF9900] - Brian Huff
  • 2:15pm - Worst Practices When Developing an ADF Application [UGF9860] - Paco van der Linden & Wilfred van der Deijl
  • 3:30pm - WebCenter & ADF - Responsive and Adaptive Design for Desktop, Mobile & Tablet [UGF9908] - John Sims
You can also view the sessions in the OOW content catalog, and check out all of the Oracle ADF content at Oracle OpenWorld 2013 too.

We hope you'll take the opportunity to join the ever growing ADF community at our largest ADF event, come learn, share, and participate in something that started as a single session at OOW in 2008 with just 20 people, to in 2013 a whole day of ADF content for all attendees to enjoy.

Thursday Jul 25, 2013

ADF rocks the Australian AUSOUG conference series

For Oracle customers looking to learn more about ADF and participate with the larger ADF community in Australia, this year’s AUSOUG Insync conference series across multiple cities has more ADF content than ever before.  As an ADF product manager based in Australia, I’ve seen the AUSOUG conference go from just 1 or 2 ADF presentation in previous years to this huge amount in 2013, the Aussie ADF market is certainly expanding. 

Following is a list of ADF presentations per city, and I’ve taken the liberty of including some other FMW topics including web services, FMW infrastructure, Fusion Apps and Forms which relates to ADF.

We hope you’ll take time out to register for the conference, come learn more about ADF, and be part of the expanding ADF community in Australia.

Sydney 15-16th August

• Speed dating - Oracle JDeveloper 12c and Oracle ADF New Features – Chris Muir - Oracle Corporation
• The Future of Oracle Forms: Upgrade, Modernize, or Migrate? - Chris Muir - Oracle Corporation

Melbourne 19-20th August

• Building an award winning product with Oracle Application Development Framework - Primoz Luzar – Callista
• Case Study: Redesigning core on-line systems in ADF JDeveloper - Penny Cookson - Sage Computing Services
• Redeveloping a legacy application in JDeveloper ADF  - half day workshop - Penny Cookson - Sage Computing Services
• Speed dating - Oracle JDeveloper 12c and Oracle ADF New Features – Chris Muir - Oracle Corporation
• The Future of Oracle Forms: Upgrade, Modernize, or Migrate? - Chris Muir - Oracle Corporation

• Best Practices for accelerating the roll out of Oracle Fusion infrastructure - Half day workshop - Matthew Wright, Craig Barr - Rubicon Red
• Extending Fusion Applications : What, Who, When and HOW - Debra Lilley - Fujitsu UK
• The Universal Web Service - Data Driven SQL/XML Web Service - Evan Vicary, Primoz Luzar - Callista

Brisbane 2-3rd September

• Case Study: Redesigning core on-line systems in ADF JDeveloper - Penny Cookson - Sage Computing Services
• Redeveloping a legacy application in JDeveloper ADF  - half day workshop - Penny Cookson - Sage Computing Services

Adelaide 5-6th September

• Case Study: Redesigning core on-line systems in ADF JDeveloper - Penny Cookson - Sage Computing Services
• Redeveloping a legacy application in JDeveloper ADF  - half day workshop - Penny Cookson - Sage Computing Services

Perth 12-13th November

• Case Study: Redesigning core on-line systems in ADF JDeveloper - Penny Cookson - Sage Computing Services
• CRUX (CRUD meets UX) Case Study: Building a Modern Applications User Experience with Oracle ADF and UX Design Patterns - Chris Muir - Oracle Corporation
• Elementary my Dear Weblogic - the Case of Spying on ADF - Ray Tindall - Sage Computing Services
• Empowering your business with mobile applications - Eddie Phan - RACWA
• Oracle ADF for Newbies: Surviving your first project - Kylie Payne - Sage Computing Services
• Redeveloping a legacy application in JDeveloper ADF  - half day workshop - Penny Cookson - Sage Computing Services
• The Future of Oracle Forms: Upgrade, Modernize, or Migrate? - Chris Muir - Oracle Corporation

For anyone based in Perth, you've also the opportunity to participate in the AUSOUG ADF special interest group, which runs sessions bimonthly.

We hope to see you at one of these events soon. 

Wednesday Jul 17, 2013

This is ADF Architecture TV

In 2011/12 Oracle conducted a survey amongst key ADF customers asking what they'd like to see next from Oracle's ADF Product Management team beyond the ADF basics which we’ve already covered in-depth? Concepts such as ADF design, architecture, best practices and patterns were high in the results.  We responded in late 2012/early 2013 by delivering a one week internal training course to staff and key Oracle partners around the world.  Yet we wanted to do more for everyone, and with support from Oracle's Development Tools management we’d like to announce the ADF Architecture TV YouTube channel. 

This free TV channel will publish, week by week, episode by episode, a huge array of short, distinct topics as relating to all parts of the ADF development lifecycle, from planning, to design, to development, deployment and delivery.  All in all we have current plans for near 100 episodes.  The channel also takes a distinct departure from our traditional online video content in that key Oracle staff now stand in front of the YouTube camera, no longer are we a background narrator of the slides.  (Though our budget is limited, no makeup artists for us, you get to enjoy us on even on our bad hair days!)

The complete set of topics to be covered is currently indexed on the ADF Architecture Square for you to check out.  We’ve already published two episodes on the YouTube channel so you can get a taste of what's to come, which you can enjoy from either work with a small time investment each week, or even from your iPad/Android tablet at home (well maybe that's just me, I really need to get a life outside Oracle).

We hope you personally will find the channel a new and engaging model for consuming our ADF collateral, and in turn this will help you and your organization to success on your next ADF project.  Take time out to subscribe to the channel so you receive instant notification of new episodes being published.

Tuesday May 21, 2013

ADF Mobile - Deploying to Android fails with "Cannot find program ... aapt"

There's an old saying, if things don't change, they often stay the same.

It appears as of last week (post Google's I/O conference) that there has been a change to the Android SDK.  If you download the complete Android SDK as of 14th May 2013 and later, Google has changed the structure of the SDK such that some critical files that JDeveloper and ADF Mobile rely on deployment have moved.  The error during deployment you'll see is something similar to:

[08:36:21 AM] Shutting down Android Debug Bridge server... 
[08:36:21 AM] Deployment cancelled. 
[08:36:21 AM] ----  Deployment incomplete  ----. 
[08:36:21 AM] Cannot run program 
"/Users/joedoe/Oracle/adt-bundle-mac-x86_64-20130514/sdk/platform-tools/aapt": error=2, No such file or directory 
[08:36:21 AM] error=2, No such file or directory

In the SDK it appears the following files/directories have moved:





...and it is this which causes the JDev ADF Mobile Android deployment process to choke.

For your reference Oracle is working on this and is tracking it via bug 16837655.  However there appears to be a simple workaround. Simply copy those files and the lib subdirectory to the platform-tools directory.  If the workaround does not work for you please log the issue on the OTN Forums and/or Support so we can investigate why.

Please note if you've downloaded the SDK prior to this, you wont hit this issue.  It only applies to anyone downloading the complete SDK since 14th May+.

Image courtesy of David Castillo Dominici /

Thursday May 16, 2013

Migrating ADF Mobile apps from 1.0 to 1.1

I thought I'd share something valuable from ADF Mobile’s product manager Joe Huang. Within context of migrating ADF Mobile v1.0 applications to v1.1, there’s some important migration notes in the release notes that developers should read.

Of particular interest for myself is the change to how Javascript libraries need to be imported for the series of device integration videos I recently recorded. In ADF Mobile v1.0 you would have used the following JavaScript references:

<script type="text/javascript" src="../../../../www/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../../../www/js/adf.el.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../../www/js/phonegap-1.0.0.js"></script>
<script type="text/javascript" src="../../../../www/js/"></script>

In ADF Mobile v1.1 you replace these with just the two following lines:

<script type="text/javascript">if (!window.adf) window.adf = {}; adf.wwwPath = "../../../../www/";</script>
<script type="text/javascript" src="../../../../www/js/base.js"> </script>

That's it - otherwise there are no other changes needed.

Please note, that if you need to invoke device services from a localHTML feature, you would still need to include cordova-2.2.0.js as well. In the previous version, due to some internal issues, PhoneGap1.0.0 always needed to be included even if you are only calling ADF Mobile related functions. In, only base.js needs to be included for ADF Mobile related functions, and cordova-2.2.0.js is needed only for device services integration like camera. And yes PhoneGap1.0.0 has been replaced with Cordova 2.2 in ADF Mobile

Thanks very much to Joe for sharing this information.

Image courtesy of Vlado /

Monday Apr 08, 2013

JDeveloper Where did Git go?

In the previous release of JDeveloper in a special build known as CLOUD, Oracle included Git support built into the IDE.  Recently on our JDeveloper release it appeared we had removed it.  Where did the Git go?

I'm happy to say Git support is still available, but not as a direct part of the IDE as per the previous version.  Rather in it is supported through an extension available via the Help -> Check for Updates menu option, then the Official Oracle Extensions and Updates repository.  You can also download the extension from the following extensions page and install it manually.

Friday Apr 05, 2013

Not 'how' but 'why' should you upgrade to JDeveloper & ADF

I recently received questions from Oracle ACE Director (ACED) Tim Hall on upgrading to JDeveloper, not necessarily asking about the 'how' but rather the 'why should we upgrade to the latest version beyond new features?' Oracle has a close relationship with its ACED members, and overall the questions that we receive from the ACE Directors are well thought out and indicative of what the wider customer base are interested in, so we’re more often than not willing to address their concerns.  As such Tim and I thought we’d collaborate to write and publish the questions and answers for everyone to benefit from.

Tim Q1) Assuming we don't need the extra functionality in ADF, what is the advantage of moving to it? Are the bug fixes and maybe browser compatibility changes enough to warrant the upgrade?

Chris A1) Of course Oracle would love you to look at the new features and we hope they are compelling enough reasons on their own to get you to upgrade.  Probably the most exciting parts are the 'eye candy'components (cough, DVT controls) such as the Sunburst, TreeMap, TimeLine and Code Editor.  However for programmers the PanelGrid, ListView and new (returned?) pagination support in Table’s will also make ADF UI development easier, and who doesn’t want an easier job?

Possibly a more compelling reason is the optimisations introduced under the covers which might not be overly obvious, but will make your users happy with the responsiveness of the app migrated to  In this release Oracle has introduced a new skin 'Skyros' which to some people will be 'just another skin'.  Yet this skin introduces CSS3 with its graphics rendering support to replace the 10s, if not 100s of images we used to include with each skin for the overall application chrome.  This means your user’s browsers now download far less bytes, the browser and CSS3 can use the graphics processes of the users’ PCs for faster interactions, the end outcome, faster apps, happier users.

Not enough on the optimization front?  To prove my point about optimizations under the covers, check out the bug fix list and note the DOM optimizations (e.g. bug 14015969) to make components more 'HTML-light-weight'.  The ADF programmer won’t see this in their day to day coding, but it will make a performance difference to the applications as the browser has less HTML to review and DOM to process.

Yet I agree, this and the other new features might not be enough.  So let’s address your other points.

Between releases Oracle does put it in significant effort addressing JDeveloper and ADF bugs, as well as behind the scenes optimizations that you get for free and we don’t necessarily publicize. Admittedly we also introduce in a few new bugs, but lets be realistic, that’s the nature of modern complex software, there’s always going to be bugs.  The goal is of course to reduce the amount and this is something Oracle pursues at length. Since starting at Oracle 1 year ago I’ve lodged just over 100 bugs and ERs, and have worked at length with our developers who are committed to addressing these issues, something all our team members do daily.  With all this in mind, from experience in having talked to external development teams who have upgraded in the past, generally speaking when quizzed about the quality of the IDE and ADF, I’ve not yet heard a customer say they wanted to go back versions.  So overall my opinion, is yes, you should diligently plan to upgrade when new releases come out.

In turn you mentioned browser compatibility.  One goal of ADF Faces is to remove the mess of programming and testing for different browsers and versions.  This problem for everyday HTML, CSS and JS programmers has got worse in my opinion with the acceleration of browser releases and even mobile browsers thrown into the mix (have you read Webkit might be the next IE6?).  So one thing we’re doing behind the scenes on every customer’s behalf is testing and fixing issues of all our components on each browser release as they become available.  As an exception that hopefully proves the rule, have a look at the release notes and read all the different browser issues Oracle has detected and have bugs listed for, Oracle continues to make these sort of issues a priority.  Why? We’ve a vested interest in fixing these too, our applications are all written in ADF, all rendered in browsers, we need this to work for our products too otherwise our customers wont use them.

Arguably some readers might say that they don’t have to upgrade to pursue the latest browser fixes as their application only runs internally to their organization where the browsers are pegged to a certain vendor and version.  I think this used to be relevant argument, but is becoming less so now with the BYOD mobile movement, where staff are accessing internal systems via their own tablets and smartphones.  It’s only a matter of time till your CEO sends a nasty email that she can’t access the systems from her latest Android or iOS device.  Oracle includes optimizations & fixes for these devices, indeed introduces better support for Android Chrome to address the mobile browser market issues too.

At this point in re-reading my answer, I feel like I’ve been drinking the Oracle cool-aid a little too much.  So let’s address reasons why you shouldn’t upgrade at this stage.

Depending on the scale of your ADF infrastructure (code, servers, developer PCs, CI engines), the act of upgrading can be substantial across the organization.  Undertaking an upgrade while your part of the organization is under deadlines might not be the wisest thing to do.  If you’re just about to go to production with your latest ADF application, and the dev teams are under pressure to get it out the door, throwing in a new JDev/ADF release at the last moment could be disastrous to your milestones, & even the quality of your software if the QA team doesn’t have time to do a full regression test.

As most readers will be aware, regression testing is an important process of ensuring between upgrades a system doesn’t introduce any new bugs, something you definitely should pursue when upgrading your ADF infrastructure or anything else for that matter.  Yet at many sites they’ll attempt to do this testing manually, which with any large system will be difficult, time consuming, and prone to missing issues.  As such in chasing the ADF release cycle, with any system of size, it’s well worth pursuing automated regression testing through tools like Oracle Application Test Suite or similar.

Finally, recognize that Oracle is going to continue to release new versions of ADF, with new features, fixes and optimizations.  As such it seems prudent to me that any organization serious about software development shouldn’t be planning these upgrades on an adhoc basis, but it should be something built into their plans.  The browser world is going to continue to churn, Oracle is going to continue to innovate and fix issues, why are customer’s inadvertently drawing a line in the sand after each upgrade to not consider planning for the next?

Tim Q2) Is there a significance in upgrading as far as support lifecycle is concerned?

Chris A2) Good question, and yes, something I’ve written about before, Do you know your ADF "grace period?".  In brief while Oracle agrees to support ADF for considerable time, your grace period for bugs and fixes to the release is now ticking.

Disclaimer: I’m paraphrasing the Oracle support policies here and it is important Oracle customers keep up to date with these policies themselves.  Please read the previous blog and research the associated support notes.

Tim Q3) Is the upgrade likely to break anything that has already been converted for

Chris A3) Well, we'd hope not ;-) Oracle doesn't deliberately release software that is designed to break our customers' software, but as we admitted together earlier on in this discussion, modern software is a complex business and Oracle will have bugs in its software, to say otherwise will be a lie.  But that’s why I put the emphasis on regression testing and automated regression testing early on, not just for Oracle! … but also you.  The grace period gives you a year to upgrade your systems in your test environments, and lodge bugs and get fixes from us, before you upgrade.  

As a final note some customers will be asking why Oracle has two current JDeveloper versions, and  This older blog post, though talking about and is still relevant and worth a read for anybody confused about the two releases.

Image courtesy of pat138241 /

Reminder: ADF Mobile workshops in Australia April/May

Just a small reminder that Oracle in conjunction with the Australian Oracle User Group (AUSOUG) will be running whole day hands-on ADF Mobile workshops in Australia over April/May.

The schedule is follows for the following Aussie cities.  Follow the links to register separately for each city:

Wednesday Mar 27, 2013

ADF Mobile: Working with Contacts (new video)

I'm happy to announce the final video in the ADF Mobile series of "Integrating Device Services", this time looking at working with the device's contacts (aka. address book).

The complete set of videos includes integrating email, SMS, contacts, GPS and pictures. A YouTube playlist can be found here.  I recommend subscribing to the ADF Insider Essentials YouTube channel so you receive notification of all the videos we make available to assist your learning of ADF Mobile and it's big-brother ADF.

Friday Mar 22, 2013

ADF Mobile: Integrating the Camera (new video)

You guessed it, yet another video in the ADF Mobile series on integrating the device services, this time on the camera.

The complete set of videos includes integrating email, SMS, contacts, GPS and pictures. A YouTube playlist can be found here.  I recommend subscribing to the ADF Insider Essentials YouTube channel so you receive notification of all the videos we make available to assist your learning of ADF Mobile and it's big-brother ADF.

ADF Mobile: Integrating SMS (new video)

We released yet another video in our series of integrating services into ADF Mobile today, this time how to use SMS.

The complete set of videos includes integrating email, SMS, contacts, GPS and pictures. A YouTube playlist can be found here.  I recommend subscribing to the ADF Insider Essentials YouTube channel so you receive notification of all the videos we make available to assist your learning of ADF Mobile and it's big-brother ADF.

Book review - SOA Made Simple

A few weeks ago Packt Publishing asked would I review SOA Made Simple, written by Lonneke Dikmans & Ronald van Luttikhuizen. Being a so called FMW expert, but (self-induced) pigeon holed in the ADF space I always take these offers, a good book provides an opportunity to widen my understanding of the topics & keep up with trends. Besides I know Lonneke & Ronald personally from my time as part of the Oracle ACE Directorship before I joined Oracle & they've always impressed me as knowledgeable and down to earth people (and this also declares my bias in reviewing their new book). 

Now I must admit I started reading this book & by the end of chapter one I was concerned the book was going to be an overall dry read, the opening chapter discusses architecture "ontologies", a word that required a careful check of the dictionary on my part.  But with some perseverance & completing chapter two, in fact I completed the rest of the book in one sitting.  Somehow the ontologies grabbed me ;-) 

So where this book makes it, is, to carry the joke forward is in its focus on SOA ontologies, with a careful if not methodical consideration of what makes a SOA project and services and how to proceed.  In less than 300 pages it covers many of the basic SOA concepts you need to know to understand SOA, and also what you'll need to do as part of a SOA project, without getting bogged down in detail. Thus the title SOA Made Simple I guess.

Frank's already given a good run down of the chapters, but to summarize the book first introduces you to different IT architectures and where SOA fits in, then what is a service, the cornerstone of SOA projects. Next how to identify & classify services, & only then are you introduced to the SOA platform, that is the different vendor solutions and their capabilities.  What's a winner at the end of this book is the two chapters entitled "How to Spend Your Money and When" and "Pick your Battles", which seems a delightfully down to earth and pragmatic approach to SOA projects.

Definitely this isn't a book that discusses how to use the SOA tooling from different vendors including Oracle, so don't pick this book up expecting to learn Oracle SOA Suite.  But conversely if you're looking for a concise text to articulate defining and progressing with a SOA project, this is for you.

One other comment I wasn't quite sure where to put in my brief review, is, the book is littered with references to other key SOA and computing texts and papers.  Let's just say for a SOA text this was brilliant idea, because it keeps the overall book digestibly small by not trying to cover all the same information again, but you're free to go read more on the referenced topics if it takes your fancy.

Overall a recommended read for anyone starting out with a SOA project, and for me, a good refresher on the SOA concepts and a concise list of what needs to be done over a SOA project's lifecycle. 

Friday Mar 15, 2013

ADF Mobile: Integrating the GPS (new video)

A quick note to say the ADF product management team has released a new video showing how to integrate the GPS into your ADF Mobile apps.

The complete set of videos includes integrating email, SMS, contacts, GPS and pictures. A YouTube playlist can be found here.  I recommend subscribing to the ADF Insider Essentials YouTube channel so you receive notification of all the videos we make available to assist your learning of ADF Mobile and it's big-brother ADF.

Wednesday Mar 06, 2013

ADF Mobile: Avoiding the Android Emulator with AndroVM

(Post edit 2nd July 2014: For users of Oracle's next generation ADF Mobile known as Oracle Mobile Application Framework (MAF), on the Android Emulator it now supports Intel's HAXM drivers which significantly speeds up the execution of the emulator. We highly recommend this as a way of speeding up your development experience.)

If you've had a chance to use ADF Mobile since its release and you're developing for Android, you will have been unlucky to encounter a small issue with Google's Android Emulator, it's incredibly, painfully, excruciatingly slow.   It really is an annoyance as the iOS Simulator on Macs runs lighting quick.  Oh the woes of developing for the Android platform, who would of thought this was the developer friendly platform?! ;-)

Mind you the problem isn't particular to ADF Mobile, just a generic issue with Google's software which all Android programmers have to deal with.  This means of course you can search for solutions on the internet, and between the hundreds if not thousands of posts detailing requests on "how do I make the Android Emulator faster" you will find the occasional very useful answer.  The most common one is "test on an actual device".  However there are some alternatives, of which one I've been recently exploring and I'd like to mention here in order to make ADF Mobile Android testing slightly less painful.

Before I do, I must clearly note this option is not supported by Oracle at all, and, via my testing it doesn't 100% work with all ADF Mobile's features.  But given the woeful state of the Android Emulator it at least gives you an option to work with.

AndroVM is a project dedicated to providing a working Android VM client for VirtualBox.  Of significance for ADF Mobile unlike other efforts such as Android-x86 project, AndroVM attempts to mimic the ARM architecture under the covers with an ARM instruction set translator called Houdini.  Why is this important?  If you can imagine Oracle has written a mini JVM for the iOS and Android platforms which sits above the hardware layer.  If the underlying chip architectures are wrong, this is going to cause the JVM grief.

Installing AndroVM is a fairly easy affair, you download and import the VirtualBox OVA file.  Ensure to download an OVA with Houdini included.  Beyond here it takes 14 seconds to boot to the Android home screen on my Mac.  Take that with the 38 seconds it takes to boot the Android Emulator on the same machine even while hot restarting, that's a big difference.

The AndroVM documentation pages have plenty of useful installation notes which are worth checking out.  One important point, the Escape key on your keyboard is mapped to the Android back button.

From here the most important bit to configure correctly is the VM network settings.  At the time of writing the androVM-4.1.1_r6.1-20130222 release comes with two network settings, the first (eth0) is a null (disabled) connection, and the second (eth1) is a NAT connection to emulate a wifi connection.  The documentation states you need to set the first connection as a "host only network" and attach it to a "DHCP-enabled network".  For whatever reason I couldn't get this to work so instead I configured a "bridged network" as follows: 

Note this connects to my Mac "en1: Wi-Fi (AirPort)" connection which in turn connects to my local router which serves an IP for the Android VM.  If you decide to go this same path, you'll need to pick an appropriate connection on your local machine to bridge the network connection.

To use AndroVM from here, what we're going to do is use the Android SDK adb command line tool to manually deploy an Android .apk file generated by ADF Mobile to the VM.  Before we can do this we need to know the IP address the VM has started with.  You can obtain this by logging in, opening Apps then androVO Configuration which will show you the IP address top left:

If you can't see this it means you haven't configured the network settings on the VM correctly.  You wont be able to proceed without this so take a step back and get that working correctly.  There's an excellent explanation of the different VirtualBox network types here.

Once you know the IP of the VM, open a terminal window, cd to your Android sdk install directory then cd to platform-tools:

cd <sdk dir>/platform-tools

From we'll use adb to connect to the VM by issuing the following command to connect to the IP address we revealed a few steps ago:

adb connect <ip address>

...and if you've set up the network connections properly you should hopefully see:

At this point you need to return to JDeveloper and generate the .apk package.  As such we cannot deploy directly from JDeveloper at this stage (though you could easily setup an extension to do this), rather we'll manually deploy the .apk via adb into the VM.  Upon generating the .apk make sure you understand where the file was generated as it will be used in the next command.

Returning to the terminal once the .apk has been successfully generated, you need to issue the following command in the terminal:

adb install <path to apk>/<apk file name>.apk

(Note it's worth reading the documentation on using adb, it's a very handy little utility)

In the example below you can see I've successfully installed the DeviceDemo sample application supplied with ADF Mobile:

Note that blindingly fast <2 second deployment time!

From here you're ready to test the application, and just like the regular emulator the application will be available from the Apps window:

And from there you can start the application, here's the Device Demo running, and it only took 3 seconds to start:

Now I've deliberately led us down the garden path here with the Device Demo, because it reveals limitations in the solution.  The Android Emulator allows us to connect up PC services like the webcam so we can take pictures as if were using a real device.  Via AndroVM we're not going to have the same facilities.  So while it's great that we've massively cut the deployment times, it's not going to be suitable for all our needs.

Beyond this from my testing it seems to run most (not all) applications fine.  I took all of the ADF Mobile sample applications (CompGallery, DeviceDemo, GestureDemo, HelloWorld, JavaDemo, LayoutDemo, LifecycleEvents, Navigation, PrefDemo, SkinningDemo, StockTracker) and they all appeared to work with some rudimentary testing.  However the HR application did crash at the beginning.  I suspect this might be because it's the only application that uses the SQLite database though when I have time I'll need to investigate this further.

Be it as it may, this is not a supported platform for ADF Mobile so you'll need to live with its issues.  However the speed benefits are I'm willing to bet enticing.

I'm going to leave the Comments for this blog post open.  Please do not post any "it doesn't work" or "how do I get this to work" type comments as I will delete them, as I said it's not supported.  However if you do happen to find a problem and solve it, it would be good if you could share it here.

One final note, remember, your company, such as Oracle, may have a policy restricting you from installing third party software which is not official approved. You should check before proceeding with this installation.

Wednesday Feb 06, 2013

ADF Essentials meets the Raspberry Pi

Summer holidays in Australia always has me searching for a new project to keep me from annoying the kids by stealing their Lego. This year I was introduced to the Raspberry Pi and set myself a goal of installing and running ADF Essentials on this miniature computer.

So what's a Raspberry Pi?

The Raspberry Pi, or Raspi or Pi for short is a credit card sized computer that was designed to teach the "real" basics of computers to kids.  The story goes a "bunch of old computer hacks" recognized that kids today are far removed from the electronics side of computing and as a result we're losing kids with an interest in the fundamentals of what makes computing tick.  As such the team had a brilliant idea of creating a small and cheap Linux driven computer with the usual standard connectors (HDMI, USBs etc), but also importantly a set of GPIO pins which allow the Pi to connect a traditional old electronics kit to controls LEDs, switches, sensors and more.

The specs of the Model B Raspberry Pi (there's two models, A and B) are deliberately minimal, running on a 700MHZ ARM processor, 512MB RAN (shared with the GPU), and it doesn't even have a harddrive, but rather uses a SD card for storage.  The neat part is the base price for the Model B is only US$35!

If you're exceptional underwhelmed by the specs of the Pi, you might not be understanding the point.  This isn't meant to be a highpowered Intel quad-duo-core thing, but a small lightweight computer to learn from, or run exactly one task.

Many people have "got it", and as a result the Pi has reportedly seen huge success in just the last year selling over a million units.  The Pi has found itself not only supporting the important role of teaching kids electronics and computer science, but it has also established itself into the hacker space with people declaring successful projects in robotics, home media centers, and lighting a humble LED when you receive an email.

What's this got to do with ADF Essentials?

The Pi is capable of running different Linux distributions, with a Debian distribution known as Raspbian "wheezy".  Instantly this peaked my interest, as where Linux goes, a JVM often follows, followed by Java EE servers such as Tomcat, and ha! Doesn't ADF Essentials run on Tomcat?!

So one 38C (100F) summer Perth day while hiding in the airconditioning I set myself a goal of seeing if I could get ADF to run on the Pi.  Why?  Why not?  I knew it wasn't going to run well, a full blown server solution on only 512MB of memory is pushing the limits, but would it actually run at all?

I'm happy to declare with a few hours to spare and a great amount of patience, a world record was declared on 27th January 2013:

From here on in I'd like to describe the steps to build the ADF Essentials Pi from scratch, for all those ADF hackers out there ;-)

Base Pi Specs and Basic Setup 

For this setup I worked with a Model B Raspberry Pi with 512MB RAM and a 4GB SD card.  By chance the Model A was released today with just 256MB RAM, possibly a challenge too far for ADF Essentials!

The SD card needs to have a preinstalled Linux of which Raspbian "wheezy" is a Debian distro built specifically for the Pi.  For purposes of my tests I used the 2012-12-16 wheezy img/zip available via the Raspberry Pi main website.

You can purchase the SD card preinstalled or burn your own installation via your PC/Mac onto the card.  The Raspberry Pi wiki has a good set of instructions on how to do this and I used the RPi-sd v1.2 card builder for the Mac to assist the process.  If you happen to take the RPI-sd route ensure that both the .app and .img files are located in a directory without spaces otherwise you'll hit errors.

After the installation of the base SD, I did hit a problem in getting the HDMI output to work.  The fix was via my Mac to edit the config.txt file on the SD card to include the following line:


Upon the first boot of the Pi you're presented with the Raspi-config screen, of which I changed the following options:
  • expand_rootfs  - invoked
  • change_locale - selected an Aussie locale en_AU.UTF-8
  • change_timezone - Australia/Perth
  • ssh - enabled
  • boot_behaviour - Start desktop
There is also an update command.  As I live behind the Oracle proxy this didn't work for me, but it's worthwhile to run if you've a normal internet connection to update your Pi with the latest software.

Once rebooted you're greeted with the Raspberry Pi desktop:

Due to the proxy issue above, I opened a terminal, configured apt-get to work with the Oracle proxy:

sudo nano /etc/apt/apt.conf.d/01proxy

..with the following line:

Acquire::http::Proxy "http://supersecretoracleproxy:80";

..and on returning to the terminal executed the following 2 lines to update my Pi installation with the latest software:

sudo apt-get update
sudo apt-get upgrade

This will take sometime to complete, time for a nice cup of raspberry tea while you wait.

As connecting the Pi to a dedicated monitor becomes a bit tedious, you can configure SSH and a VNC server so you can maintain the Pi remotely.  Firstly you'll need to know the IP address of the Pi through executing ifconfig in the terminal so you can connect via SSH/VNC.  Remember that by default the Pi uses dynamic IP (DHCP) so this may change on each boot.  I'll assume from here on in.

To use and setup SSH and a VNC server, Adafruit provides good instructions on how to do this.  Ensure to remember the password you define for the VNC server.

From a Mac accessing the Pi via SSH is easy as it's supported through the terminal/Mac OSX.  On Windows you'll need to install a dedicated SSH client.

Also from a Mac accessing the Pi via a VNC client is easy as it comes with a ready made VNC client "Screen" located under /System/Library/CoreServices in OSX Mountain Lion.  Remember the user id/password combo is that you specified when setting up the VNC server, and the password is a maximum 8 characters long.

On accessing the Pi you'll need to enter the IP address you discovered before and the port number.  Note if you started the VNC server on the Pi using something like "vncserver :1", the port number you must access is 590 + the digit you started the vncserver, 1 in this example, along the lines of

On accessing the Pi from VNC for the first time I did hit the following error:

"GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject"

..and a fix is suggested here.

It's also worthwhile installing the Chromium browser and an FTP server such as proftpd.

Setting up the ADF Environment

Once we have the basic Pi up and running, we're now ready to install the infrastructure and software required for ADF Essentials.  In brief this includes:
  • JDK 1.6 SE
  • Apache Tomcat 7
  • jsf-api.jar + jsf-impl.jar + glassfish.jstl_1.2.0.1.jar
  • Oracle ADF Essentials
  • Oracle ADF Component Demo
The following instructions are mostly derived from Raphael Rodrigues's blog with a couple of twists.

At the time of writing this article there was some "hoohaw" over Java security and a rapid release of JDKs from Oracle to patch security holes.  As such an ARM distribution from Oracle of the JDK wasn't yet available.  To give myself the chance of finishing this blog post I went with installing the OpenJDK.  Warning: I've no idea if the current distribution includes all the security patches necessary.  However somehow I don't think security is a primary concern for most Pi uses:

sudo apt-get install openjdk-6-jdk

Installing Tomcat is also a fairly painless task.  First visit the Tomcat 7 download page and determine which is the latest version.  At the time of writing this was 7.0.35 for me.  In addition locate the tar.gz link and note the URL.  This will automatically be pointing at a mirror close to your location.

Return to the Pi terminal, ensure you're in the home directory and execute the following command, but change the URL to suit the one presented in the previous step:


Once downloaded, execute the following command to explode the tar to your home directory:

tar zxf apache-7.0.35.tar.gz

You can then start and stop the tomcat server by executing one of the following 2 commands after issuing the cd command:

cd ~/apache-tomcat-7.0.35/bin

sudo sh
sudo sh

Via the Pi desktop if you open the Chromium browser, you should be able to access the Tomcat console by going to http://localhost:8080, or remotely via the ip address such as  Be patient for the server to start.

At this point shutdown the Tomcat server.

Next we need to install the jsf-api.jar, jsf-impl.jar and glassfish.jstl_1.2.0.1 jar files into the TOMCAT_HOME/lib directory.  These are best borrowed from an existing JDev installation on your local PC/Mac and ftp'ed across from JDEV_HOME/oracle_common/modules/oracle.jsf_2.0

Finally we're ready for some ADF setup!

We need to install the ADF Essentials runtime libraries into Tomcat.  Officially Oracle doesn't support Tomcat (at least currently) against ADF Essentials, but this doesn't mean ADF doesn't run on Tomcat.

As ADF Essentials requires you accept the license conditions on Oracle's website before you download it, you cannot use wget to do this.  In addition attempting to download this via the Chromium browser isn't that easy as it's chews so much CPU that often it times-out before it has a chance to download any file.  As such the easiest solution seems to be to download the ADF Essentials file on your PC/Mac and then ftp it across to your Pi.  While you're at the same site, also download the Oracle ADF Faces Components Demo

Move the ADF Essentials zip file to the TOMCAT_HOME/lib, and extract it using the following command:

unzip -j

The -j option here flattens the directory structure within the zip such that all JARs included are placed in the Tomcat lib directory directly, not a subdirectory there of.

The final part of the install is we need to deploy the ADF Component Demo.  There is a number of different deployments options to take, but the easiest is to place the associated .war file in the TOMCAT_HOME/webapps directory.  However the file is a rather large and chunky application of over 100MB of source code.  Tomcat's default behavior at runtime is to explode the war into a directory of the same name at startup, and given the resources of Pi this is going to take a long time.

Best solution is to preexplode the file for Tomcat, by making a directory, say TOMCAT_HOME/webapps/rcf-dvt-demo, copy the war into this new directory and execute unzip on the zip file.  Remember to delete the zip file once done.

One last fix.  From experimentation Tomcat 7 on starting will attempt to scan all the source code for annotations to execute.  To stop it doing this we can modify the WEB-INF/web.xml file of the demo we just exploded, and add the attribute metadata-complete="true" to the <web-app> node.  As you're about to see starting the Tomcat server with all the preconfigured ADF software is a *really* long process.

Drum Roll: Voila! ADF Essentials on the Raspberry Pi

So the big drum roll moment is to again start Tomcat and then access the application via a browser.  Just starting the Tomcat server is now going to consume a vast amount of CPU.  In fact 2984981 ms at 100% CPU on my Pi! Phew.

What you can do while the server starts up is execute "tail -f" on the catalina.log file found under the TOMCAT_HOME/logs.  Very very slowly you'll see the server start up.  You might note the server seems to start 1 or two apps that aren't possibly needed and this could be something we could eliminate to speed the startup process later.

Finally once up and running, open the browser and access Once again it will take sometime to start and load, but eventually you'll see the component demo running.  If you attempt to open another session to the same page (say from your PC/Mac) you will see it's an order of magnitude faster.  But it does run!

 "But Chris, it runs so slowly it's near useless!"

Ya, I did set expectations early on that it would run slowly, and you weren't seriously going to run an enterprise framework on a Raspberry Pi were you?  The goal here has been to see if it will just run, and it does.

"But Chris, what about ADF BC/EJB/my favorite part of ADF?"

Indeed, I didn't make any claims of exercising the entire ADF stack.  Though it would be fun to try.  The component demo is a good exercise in that it's a very large JSF application.  I'd love to see somebody try to get ADF BC running by seriously throttling back the AM and connection pool.  Could you even install MySQL on the same Pi to be fully contained?  Hmmm, sounds like a cool hacking opportunity!

"But Chris, did you try X/Y/Z to speed up deployment?"

Awesome, you've got some hacking ideas!  Let's start an ADF Pi community and take this further for the fun of it  :-)

In summary the Raspberry Pi provides an awesome learning environment for kids to learn about computer science, but also a great playground for old fellas like me to see if we can get our favourite technologies to work on this mini computer.  I look forward to reading your Raspberry Pi ADF stories soon.


Not a selfie
Chris Muir
Oracle Mobility and Development Tools Product Manager

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



« July 2016