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
Hi,
https://forums.oracle.com/forums/thread.jspa?threadID=2313640&tstart=0
please visit to this forum post
Â
thanks
juddi
Hi Lucas,
We have 6 HWF applications deployed in Weblogic 11g.The required library files are loaded from adf.oracle.domain.webapp(1.0,11.1.1.2.0), adf.oracle.domain. When we access each HWF application, it is loading all necessary classes independently in the PERM Gen. Due to this we are operating with 95% of PERM Gen space.Since each HWF(webapp) has different class loaders , the same version of classes will be loaded for each HWF. We need to have the classes loaded at one time. How can we achieve this?. Your suggestion is appreciated.
My application is created in Oracle Jdeveloper 10.1.1.3. i want to compile it on JDeveloper 11g. But it couldnt be compiled. When I opened my application in JDeveloper 11g, it first asks to migrate it (Y/N). I click Yes. It migrates successfully. But Toplink file was giving error that ‘Unexpected error in Toplink’. I cannot open the Toplink file due to errors. How can i resolve this issue…?
Thanks…
Would you recommend that the .ear file be deployed on all Weblogic 11g applications instead of the .war file?
If you wanted to get ahold of detailed directions on this, where would you go?
Â
Thank you,
Michele
Nice article. I have one question whether i can deploy adf application as war or not?
Info on the ADF runtime is available on this person’s blog post
http://radalcove.com/blog/?p=34
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
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.
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.