Deploying and running ADF 11g applications on WebLogic 11g
Last week we had some problems with the deployment of our ADF 11g applications on a stand alone WebLogic 11g (10.3.1) server. One of the issues that kept recurring during the deployment was a ClassCastException reffering to the ADFLogger class – that our application did not explicitly use. We got the impression that the ADF libraries that we rely on, somehow reference this internal class. The exception was just the first of potentially many indications of a WebLogic server lacking in ADF runtime readiness.
Here are some pointers as to the things that need to be ready in WLS 11g in order to ADF 11g application to be deployed and run:
- either during installation of WLS 11g or at some later point using the installation wizard, add the JRF 11.1.1.0 Java (and ADF 11g) Runtime Framework to the domain on which you want to deploy the ADF application (see: Extending WebLogic 11g for ADF applications by Lynn Munsinger)
- make sure to deploy the ADF application as an EAR file – not as a WAR file. The EAR file should contain the file weblogic-application.xml in its META-INF directory. This file should contain a library reference to the ADF Runtime library:
<library-ref>
<library-name>adf.oracle.domain</library-name>
<implementation-version>11.1.1.1.0</implementation-version>
</library-ref>
you will find this file in JDeveloper under Application Resources in the Descriptors node. Note: deploying the application the application to an ear is done from the little dropdown menu that you can find right after the dropdown with a list of all applications currently open in IDE. You should not use the deploy option on the ViewController project – or whatever the name of your web application
- (this step is not yet entirely clear to me – I will describe my current understanding that has it working for us; we may be doing too many things or not entirely correct things; hopefully this can at least help you further along the road to successful deployment)
The managed server in the WebLogic domain to which you want to deploy the ADF application needs to be started with several special options, to activate the JRF (which included the ADF 11g runtime libraries).
The server should be started with these JVM options:
-Djrf.version=11.1.1 -Djrockit.optfile=%ORACLE_HOME%\modules\oracle.jrf_11.1.1\jrocket_optfile.txt
the classpath needs to include:
%ORACLE_HOME%\modules\oracle.jrf_11.1.1\jrf.jar
Note: these settings can be included in the setDomainEnv.cmd file in the same directory as the startManagedWebLogic.cmd script that you probably use for starting the managed server. In fact: I found these settings in the setDomainEnv.cmd file that was created for me during the installation of the SOA Suite 11g.
Resources
Deploying simple ADF application to WebLogic Server – weblog article by Lynn Munsinger



14/9/2009 - 5:49 am
Hi Lucas
With regards the options in the setDomainEnv.cmd and startManagedWebLogic.cmd, presumably the ADF runtime installer takes care of that? We’ve not found it necessary to make these changes ourselves.
What’s the behaviour if those aren’t added to the .cmd files?
Cheers,
CM.
14/9/2009 - 5:54 am
One further comment regards your 2nd bullet point. It’s worth pointing out to readers that hardcoding the implementation-version has pros and cons. Positive is your application is pegged to the exact ADF version it requires. Negative if you migrate your app to an upgrade WLS/ADF installation that uses a later ADF library, and you forget about your hardcoding, you’ll hit errors as WLS tries to enforce the specific library your application needs to run.
CM.
14/9/2009 - 10:27 pm
Hi Chris,
I am not sure what currently the ADF Runtime installer is. Have you seen a stand alone tool with that name?
I have seen the WebLogic Configuration Wizard that allows you to extend the domain with the JRF. I suppose that during the actions of that wizard, these settings were created in the setDomainEnv.cmd. But I am not sure – suddenly they were there. And as today once again proved: they are necessary too.
Of course you are right: these version references are hard-coded, which is undesirable in general. However, for the very short term we are very happy to have the application running at all, to be frank.
Lucas
18/9/2009 - 9:14 pm
Info on the ADF runtime is available on this person’s blog post
http://radalcove.com/blog/?p=34