Deploying The SRDemo ADF Sample Application on WebLogic Servers

An Oracle JDeveloper How To Document
Written by Shay Shmeltzer, Oracle
June, 2008

Introduction

The SRDemo Application is an Oracle ADF based application that is used for learning ADF, it is available as a direct download through the JDeveloper Help->Check for Updates feature and is referenced by the ADF Developer Guide. A WebLogic compatible version of the SRDemo ADF Business Components based application is available as a JDeveloper extension through the Help->Check for Update option in JDeveloper.

In this how-to we'll show you how to successfully deploy this application to an instance of WebLogic Server. The steps in this tutorial have been tested with both WebLogic 9.2 and 10 versions.
You can also follow through the instruction and steps in this online video.

Connection JDeveloper to WebLogic

Note: When you are deploying to WebLogic 9.0 from JDeveloper, ensure that the HTTP Tunneling property is enabled. From the WebLogic console under Servers > ServerName > Protocols >HTTP - check the checkbox for HTTP Tunneling. (ServerName refers to the name of your WebLogic server).

In order for JDeveloper to work with WebLogic it will need a copy of the weblogic.jar file that can be found at [WLS-root]\weblogic92\server\lib, copy this file to [jdev-root]\jdev\lib\ext directory and restart JDeveloper.

Now let's create an application server connection from JDeveloper to your WebLogic Server.
From the View Menu choose Connection Navigator.
Right click the Application Server node and choose New Application Server Connection, follow the instructions in the dialog to establish and test a connection to your WebLogic Server.

Once the connection has been established you'll be able to directly deploy from JDeveloper to your WebLogic server.

Setting up ADF Libraries on WebLogic

Before we actually deploy the application onto the WebLogic server we need to install the ADF Runtime libraries on the server. To do this we can use either the stand alone ADF Installer utility or the installer that is embedded inside JDeveloper - which we'll use in this how-to.
The detailed instructions for setting ADF libraries on WebLogic are described in the deployment chapter of the ADF Developer Guide. (Note the specific extra steps needed for WebLogic Server)
There is one correction needed in order to run SRDemo specifically. SRDemo was built with the Oracle DB datatype specific jar and not the database agnostic one, so: Locate the setupadf.cmd/setupadf.sh file that was created by the ADF Installer in your domain home directory.
Remark the line
set CLASSPATH=%CLASSPATH%;..\..\..\weblogic92\ADF\jlib\bc4jdomgnrc.jar
and add the following line instead
set CLASSPATH=%CLASSPATH%;..\..\..\weblogic92\ADF\lib\bc4jdomorcl.jar

Setting up Users for the SRDemo Application

The SRDemo application integrates Java security into the system. In order to run the demo you'll need to define at least three users in your WebLogic Server. Instructions for adding users through the WebLogic console are here:
You'll need at least the following 3 usernames defined:

  • sking
  • ahunold
  • dfaviet

The users represent various roles in the application and those are defined in the weblogic.xml file in the SRDemo application.
Don't forget to remove these users once you are done using the SRDemo application.

Deploying the SRDemo Application

Now that your WebLogic server is ready, it's time to deploy the applicaiton.
Open the SRdemoSampleADFBC workspace in JDeveloper, and expend the UserInterface project->Resources. Locate the SRDemoWebLogic.deploy file and right click on it and choose deploy to->your WLS server. This will start a deployment process that you can follow through the JDeveloper log window.

Note if you are using a different username/password or database then the default you'll need to update the database connection information for your ADF Business Components. Expend the DataModel project->oracle.srdemo.model and locate the SRService application module - right click on it and choose configurations...
Edit the SRServiceWL configuration to have the parameters matching your database connection information.

Basic Troubleshooting

Symptom Likely Cause
Error when testing the connection to WebLogic server from inside JDeveloper Check that you copied the weblogic.jar file to the jdev/lib/ext directory
Check that your WebLogic server enables HTTP Tunneling
Class not found on oracle/adf classes when deploying the application Verify that the setupadf.cmd file can be located by the WebLogic starting script.
Verify that you started the right domain with the right startup script.
Failed to checkout SRService application module. Ensure your datasource name is SRDemo [case-sensitive!] and that connection settings are properly defined for a database with the SRDEMO schema installed. See server log for more exception details... This is a generic error that we are throwing out - to find the real problem follow these steps: Go to the SRDemoPageLifecycle.java class (under oracle.srdemo.view.frameworkExt) and locate the lines:
        else if (ex instanceof ApplicationPoolException) {
          throw new KnowErrorStopException("srdemo.failedcheckout");
        }
Add the following line in there
        else if (ex instanceof ApplicationPoolException) {
ex.printStackTrace();
          throw new KnowErrorStopException("srdemo.failedcheckout");
        }
This will throw the actual error message into the server log and you'll be able to find out what is the real problem.
false ,,,,,,,,,,,,,,,