Tuesday Sep 25, 2012

Oracle OpenWorld / JavaOne Where I'll Be

It's that time of the year again when San Francisco get flooded with Oracle and Java geeks for the annual OpenWorld and JavaOne conferences.

Here are some of the places where you'll be able to find me:

Sunday has a bunch of great ADF content in the ADF Enterprise Methodology Group track - I'm not sure if I'll make it there but I'm sure those who will will get some serious knowledge transfer.

I'm starting Monday at the Keynote for Developers (10:45 in Salon 8 at the Marriott) - that's a great place for ADF developers to start the official week with an overview of what's new and upcoming in the world of development with ADF. While I'm not presenting this session - Chris Tonas who leads the development tools org will -  a demo that I built will be shown. So I'll be sitting in the audience crossing my fingers praying for the demo gods (and the wifi connection to work).

My presentation part of the week starts on Monday at 12:15 at Moscone South room 306 where I'll be presenting "CON3004 - Understanding Oracle ADF and Its Role in Oracle Fusion . A basic introduction to ADF, it's architecture, development experience and how it integrates and works with the rest of the Fusion Middleware components. 

After the session between 2-4 I'll be at the JDeveloper demo booth in Moscone South to answer any questions people might have.

Then at 6:15 together with Grant we'll host BOF4492 - How to Get Started with Oracle ADF where we'll try and explain some of the learning paths and resources that are available for people who want to start learning ADF. This is a birds-of-a-feather so we'll also love to hear ideas from the audience about what paths they took and what things work or need improvment.

Tuesday is relatively a quite day for me with a shift at the Oracle ADF Essentials pod at JavaOne from 1:30-3:30. There are several very good ADF architecture and best practices sessions on that day - so I'll try and hit those.

Wednesday starts with another shift at the JDeveloper booth at JavaOne. Then at 4:30, instead of doing what all the ADF developers should do and heading over to the ADF meetup at the OTN Lounge, I'll be heading over to JavaOne for my CON3770 - Oracle JDeveloper and Oracle ADF: What’s New session. It's been a couple of years since the last time JDeveloper or ADF got any airtime at JavaOne - so it will be a great opportunity to show those in the Java community with open minds our approach to Java development. Now that ADF Essentials offers a free way to develop with ADF on GlassFish, I hope we'll be getting more people from the core Java camp interested in what we have to offer.

Thursday is another relaxed day for me - who knows maybe I'll even be able to catch a session or two on that day.

If you want to learn more about the ADF related sessions at OOW check out our full list here.

Monday Sep 24, 2012

Deploying Oracle ADF Essentials Applications to Glassfish

With the new Oracle ADF Essentials offering you can now deploy applications that leverage Oracle ADF on the open source Glassfish 3.1 server.

Deployment is documented in the official JDeveloper and ADF documentation (here) but below is a summary of the steps and a video of the steps you'll need to take to get a basic Oracle ADF Essentials application to work on GlassFish.

Note - to make starting/stopping GlassFish easier for my demo I used my GlassFish extension that you can get here.

First we'll install some ADF Runtime libraries on GlassFish

  1. Download and install Glassfish (Note - if you also have an Oracle DB on the same machine, you'll want to switch GlassFish's HTTP port to something else instead of 8080).
  2. Download the Oracle ADF Essentials packaging - this will get you an adf-essentials.zip file.
  3. Copy the adf_essentials.zip to the lib directory of your Glassfish domain - on a default windows install this would be: C:\glassfish3\glassfish\domains\domain1\lib
  4. Go the the above lib directory and issue a unzip -j adf_essentials.zip

This will extract the ADF libraries to the directory. Now you can start the Glassfish server.

Now let's configure Glassfish to handle applications of the ADF type:

  1. Invoke the admin console of glassfish (http://localhost:4848) and log into your admin account.
  2. Go to Configurations->Server-config->JVM Settings and choose the JVM Options tab
  3. Add the following entries:
    • -XX:MaxPermSize=512m (note this entry should already exist so just make sure it has a big enough value)
    • -Doracle.mds.cache=simple

While we are in the admin console, we can also define JDBC connections that will be used by our application.

  1. Go into Resources->JDBC->JDBC Connection Pools and click to create a New one
  2. Give it a name and choose the resource type to be javax.sql.XADataSource and choose Oracle as the Database Driver vendor. Click Next
  3. Scroll down to the Additional Properties section and start filling in the information for your database. The values for an Oracle XE will be (user=hr, databaseName = XE, Password=hr, ServerName=localhost, DriverType=thin, PortNumber=1521)
  4. Click Finish
  5. Click Ping to check your connection works.
  6. Now define a new JDBC Resource that will use the pool you just defined. In my example I called the resource jdbc/HRDS

You will need this name to match the name in your Application Module connection configuraiton.

Now you can re-start the Glassfish server for the changes to take effect.
  1. Get an ADF application going (you can use the regular Fusion Application template for this)
  2. Go into the project properties of your viewController project, under the deployment section click to edit the deployment profile that is defined there.
  3. Go to Platform and choose Glassfish 3.1 from the drop down list. Click ok to go back to your project.
  4. Go to Application -> Application Properties-> Deployment
  5. Go to Platform and choose Glassfish 3.1 from the drop down list. Click ok to go back to your project.
  6. This step will make sure that JDeveloper will autoamtically add the necessary ADF libraries to the EAR file that is being generated for deployment on Glassfish
  7.  Go to your Application->Deploy and deploy either to an EAR file or directly to a Glassfish server connection that you created.

Things should just work, but if they don't then look up the server.log in the log directory and check out what error is in there.

Here is a video demo of the various steps:

Note - right now the deployment of an ADF application takes about 2 minutes on my machine we are hoping to be able to improve this timing in the future. People who are more familiar with Glassfish might want to explore using exploded directory deployment and see if they can get it to work.

 FAQ - some common questions/problems that people posted on comments:

  • "The zip in the video is 70mb, OTN's zip is 20mb" - that's fine. The video was recorded with a pre-production version of the zip. The 20mb zip of adf-essentials is all you need.
  • "My JDeveloper log window show an error on deployment - "status of 400 Deployment cancelled." " - To better understand where the problem is check your server.log file in under your GlassFish server. This will give you the actual error message. 
  • "I'm getting a class not found error in the server.log when trying to deploy" - this usually means one of two things:
    • 1 - you didn't use a -j when unzipping the adf-essentials.zip file - so you ended up with sub directories in your lib directory. -j will get all the jar files to be extracted into a single directory.
    • 2 - you didn't specify Glassfish as the platform in the deployment profile for both the viewController project and your application level. Without doing this JDeveloper won't know to include all the needed jars in the EAR file it is producing. Check the EAR file you got from JDeveloper - if it is smaller than 30MB - you probably skipped this step. 

 


GlassFish Extension for Oracle JDeveloper

We just release a new version of Oracle JDeveloper - 11.1.2.3.

One new feature here is built-in support for GlassFish. This include the ability to create an "application server" connection to GlassFish and then deploy to that server with one click from inside JDeveloper. You can use this for deploying Oracle ADF Essentials application on Glassfish, but you can also use it to deploy any Java EE application you build in JDeveloper on GlassFish.

However, if you are planning to work with GlassFish and JDeveloper on a more regular basis as your development server, then you might find my new extension useful.

The new extension allows you to start and stop an external GlassFish instance, as well as start it in debug mode (which will allow JDeveloper to remotely debug your application as it runs on the server. I also added a button that will invoke the web admin console of Glassfish.

Here is a quick demo that will show you how to work with the extension:

The extension is available from help->check for updates, or you can download it directly from here, and then use help->check for updates pointing to the local zip file.

[update Nov-2012] - The new version 1.3 now runs on Mac and Linux thanks to updates to the source code by Alexis Lopez and David Aroca. Make sure to download that latest version, I also added the option to disable the extension from tools->features in JDeveloper.

By the way if you want to improve or modify this extension you can find the source for it here. You can also use this as a way to learn a bit about building JDeveloper extensions.

About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« September 2012 »
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
26
27
28
29
30
      
Today