Monday, 5 January 2009

Configuring WebLogic Server Domain/Machine/Server instances with the JDeveloper 11g ADF installer

(Post edit: An important addition to this post can be found in the following OTN forum thread)

These instructions were inspired by Duncan Mills's recent post A Rough Guide To Installing and Setting up WebLogic 10.3 Production for Running ADF Applications. This post constitutes my notes based around Duncan's post, and includes pictures. I've posted here as it may be useful to readers.

Preamble:

Readers tinkering with the latest JDeveloper 11g release will be aware that the predominate deployment platform for JDeveloper is now Oracle WebLogic Server (WLS) v10.3. For development purposes JDeveloper 11g comes with an integrated WLS 10.3 server. However for production purposes a standalone WLS is required.

The WLS architecture is somewhat different from Oracle Application Server and OC4J, with the WLS concepts of domains, machines and servers. The WLS installer can be used to set these up with minimal fuss for a new WLS instance.

The following are my notes on using the WLS installer under Windows to configure a WLS domain, machine and server for production purposes for use with JDeveloper 11g. As always readers should be aware that this post is provided as-is, will most likely be updated after the initial post as I discover issues and solutions, so be careful that your mileage may vary in using this post.

This post takes you through the following logical sections of work:
  • Running the WebLogic 10.3 installer
  • Configuring ADF to run on the new server
  • Running the post installer Configuration Wizard
  • Running the WLS console and sharing the ADF libraries with the new server
  • Starting the additional WLS server
  • Inspecting the WLS domain/server/machine setup
Running the WebLogic 10.3 installer

(This section encompasses steps 1 to 6 in Duncan's post)

Download the WLS 10.3 "package installer" from http://www.oracle.com/technology/software/products/ias/htdocs/wls_main.html

Once downloaded turn off your virus scanner, in particular McAfee as it's a Java killer.

Run the WLS exe.

The WLS installer dialog will display, skip the Welcome page by pressing next.

Choose BEA Home Directory page - select the Create a new BEA Home option, and enter an appropriate directory your happy with in the BEA Home Directory field. I've chosen "c:\oracle\WlsStandalone". Click Next:


Choose Install Type page - select Custom then next:


Choose Product and Components page - unselect the following options:

(as per Duncan's post referenced above)
  • Web 2.0 HTTP Pub-Sub Server
  • WebLogic Web Server Plugins
  • UDDI and Xquery Support
  • Server Examples
  • Workshop (including Workshop for WebLogic and Workshop Runtime Framework)


(I suspect that the WebLogic Web Server Plugins option is required for production purposes if you use WLS clustering)

JDK Selection page - select one of the JDKs. By default I pick the JRockit option:


Choose Product Installation Directories page - leave the defaults:


Install Windows Service page – as per Duncan's post he suggests not installing the node manager because of a classpath issue.


I suspect WLS users interested in clustering will want the node manager option, so best log an SR with Oracle Support to see how to configure it with a JDev production install.

Choose Shortcut Location page – leave defaults:


Installation Summary page – just press next:


The installer will now install the appropriate files onto your computer. Note if you're virus scanner is running this is where it will cause performance problems.

Once completed you'll see this page. Unselect Run Quickstart and then select the Done button.


(This section concludes step 6 in Duncan's notes)

Configuring ADF to run on the new server

(This section encompasses steps 7 to 10 in Duncan's post)

The JDev 11g installer has additional libraries that are required to run an ADF application. These must be installed in to the WLS server and are installed from the JDev 11g installer.

As per the OTN post here and here, there appears to be a catch in configuring the WLS server for running JDeveloper ADF applications. You need to install the ADF runtime libraries *and* JDeveloper on the WLS box. The following instructions will hopefully setup your server to avoid this problem.

Download the studio edition Windows JDeveloper 11g installer from http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html

Remember to turn your virus scanner off.

Run the JDeveloper 11g installation exe.

Skip the Welcome page.

Choose BEA Home Directory page – select the Use an existing BEA Home option and select the directory you previously installed WLS (e.g. c:\oracle\WlsStandalone):


Choose Products and Components page – it's important in this option to pick both the JDeveloper Studio option *and* the Application Development Framework Runtime. This seems counter intuitive as it would be expected the Runtime libraries are enough, but as per the OTN posts above, it appears we need both:


For the rest of the wizard accept the defaults.

(JDK Selection page – I'm unsure at this page if we wish to pick the Sun JDK that displays by default as an option or pick the pre-installed WLS JRocket SDK (which you browse for)? I assume as WLS is already installed and configured it will use JRocket, and the choice on this screen is for the JDeveloper IDE JDK version which we probably want to leave as the default Sun JDK).

(This section concludes step 10 in Duncan's notes)

Running the post installer Configuration Wizard

(This section encompasses steps 11 to 23 in Duncan's post)

Under your Windows start menu (I'm using Vista), there should be a new program group Oracle WebLogic. Select Oracle WebLogic -> WebLogic Server 10gR3 -> Tools -> Configuration Wizard:


The Configuration Wizard should then appear with the Welcome page. Select Create a new WebLogic domain then next:


Select Domain Source page – select Generate a domain configured automatically to support the following products, and in addition select the Application Development Framework option:


Configure Administrator Username and Password page – enter a user name and password for the default WebLogic Server administrator:


Configure Server Start Mode and JDK page – as Duncan's original post, if the server is being configured for production purposes, select the Production Mode option. In addition select the JDK for the Domain to use. If you picked JRocket previously for the WLS install this should be your choice here:


Customize Environment and Services Settings page – selecting No on this page bypasses the ability to setup the WLS machines and servers which isn't the point of this post. As such select Yes to customize the environment.


Configure RDBMS Security Store Database page – I've no idea what this page does but Duncan says skip it so we will, leaving the I don't want to change anything here option selected:


Configure the Administration Server page – each WLS domain includes 1 administration server by default referred to as the AdminServer. The AdminServer's job is to configure and maintain the other server instances under WLS. While it's possible to install JDev apps into the AdminServer, it's not ideal as the AdminServer is really for administration only. As such we wish to create a separate server to install our applications.

This page allows you to configure that separate server. You can override these settings but I'll run with the default:


Note that Duncan overrides the Listen port with 81, but we'll keep 7001.

Configure Managed Servers page – here we configure the new server. You can keep the default settings, but you'll need to change the port number to something different from the AdminServer, say 7002. In my example I also rename the new server to ADFServer:


Configure Clusters page – this post assumes no clusters, so skip this page:


Configure Machines page – the machine represents the hardware that the server runs on. We create the following entries:


Assign Servers to Machines page – on this page we assign our ADFServer to the ADFMachine. I'm currently unsure if it's wise to assign the AdminServer to the same machine, or leave it as is, so I'll leave as is for the moment:


Review WebLogic Domain page – usual summary page. Ignore and press next ;-):


Create WebLogic Domain page – enter the name of the domain and accept the default directory. I'll take the domain name adf_domain, then click Create:


At this point your additional server and machine are correctly installed and configured, but not running. The following steps show you under the WLS console to check where the new domain, server and machine are located.

(This section concludes step 23 in Duncan's notes)

Running the WLS console and sharing the ADF libraries with the new server

(This section encompasses steps 24 to 32 in Duncan's post)

Within the Oracle WebLogic Windows group, you'll have the new sub group User Projects -> adf_domain with entries for starting and stopping the AdminServer. You can click the Start Admin Server for WebLogic option, or alternatively as Duncan suggests, you can run the following script via a command prompt:

<wls_home_dir>\user_projects\domains\<your domain name>\bin\startWebLogic.cmd

....where wls_home_dir is where you installed WLS (e.g. c:\oracle\WlsStandalone), and your domain name is the domain name you configured in the Create WebLogic Domain page of the Configuration Wizard (e.g. adf_domain).

If you selected the Production Mode installation option back on the Configure Server Start Mode and JDK page within the Configuration Wizard, you'll be prompted for the administrator username and password you entered on the Configure Administrator Username and Password page.

Once successfully running within the command prompt window you should see the message <Server started in RUNNING mode>. Wait until you see that message.

Login to the WebLogic AdminServer console by clicking on the Oracle WebLogic -> User Projects -> adf_domain -> Admin Server Console option under you Windows start menu:


This will launch your browser opening the console at the following URL:

http://localhost:<port>/console

....where <port> is what you configured for the AdminServer on the Configure the Administration Server page of the Configuration Wizard. The login screen again requires your WLS admin username and password:


Once logged into the console, the Domain Structure portlet on the left side of the screen shows your new domain, in my case adf_domain:


Within the Domain Structure portlet click the Deployments node. Under the Summary of Deployments page you'll see the 3 new ADF Runtime Libraries installed:


Currently the libraries are only configured for the ADFServer. Optionally we may share them with the AdminServer.

If you're running your WLS server in production mode, first select the Lock and Edit option top left of your screen. This is unnecessary if your server is in deployment mode.

For each library, select the library, followed by the Targets tab, and select the AdminServer. Press save for each.

If running under production mode, you need to press the Activate Changes button top left of the console to make the changes permanent. This steps is unnecessary if your WLS server is running in deployment mode.

(This section concludes step 32 in Duncan's notes)

Starting the additional WLS server

(This section encompasses steps 33 and 34 in Duncan's post)

To start the ADFServer, via the command line execute the following command:

<wls_home_dir>\user_projects\domains\(your domain name)\bin\startManagedWeblogic.cmd <your server name> http://localhost:<port>

....where your server name is the name of new server you created in the Configure Managed Servers page of the Configuration Wizard (e.g. ADFServer), and the port is that you configured for the AdminServer (not the new server).

Again you'll need to enter the administrator username and password, and wait for the message <Server started in RUNNING mode>.

Returning to the console, selecting the Servers node you should see the additional server running:


To shut down both the new server and the AdminServer, simply Ctrl-C them in the command prompts, they will gracefully shut down.

(This section concludes step 34 in Duncan's notes)

Inspecting the WLS domain/server/machine setup

(This section is not included in Duncan's post)

As we saw in the previous step, in the Domain Structure portlet selecting the Environment node Servers reveals the Summary of Servers page, with a status for each:


Again in the Domain Structure portlet selecting the Environment -> Machine node reveals the Summary of Machines page, listing the new machine you just created, in my case ADFMachine:


If you select the ADFMachine link, this displays the Settings for ADFMachine page. In turn select the Configuration tab followed by the Serves tab, you'll see the ADFServer is installed for the machine:

8 comments:

Unknown said...

Hi Chris

Since McAfee is such a Java Killer (and I know it by my experience) which in your opinion would be a good virus scan to use?
I have tried 3 or 4 diferent and neither work well with Java.

Sorry for my relief, I just don't know what to do. For now, I just stop virus scan when I use JDeveloper. :(

Thanks in advance

Chris Muir said...

Hi Paulo

I'm currently using AVG and it doesn't seem as instrusive though I wont recommend it, it's just free.

Turning your virus scanner off is the easiest solution as you suggest, unless frustratingly your current enterprise refuse as it compromises their security policy. I'm thinking I might ask Oracle to write something so we can wave it in front of network admins.

Sorry I couldn't be more help.

Regards,

CM.

Chris Noonan said...

Great work, Chris!

Appreciate the effort with the screenshots.
You're a life-saver.

-Chris

Gerard Davison said...

Just a quick note on the AV front. Most AV tools will allow you to ignore certain file types for real time protection. We run with the .jar and .class file type excluded and this means that most of the performance hit goes away.

Of course this opens the window for some viruses. Hopefully your nightly full scans should catch these.

Gerard

Chris Muir said...

Thanks Gerard.

Adding such an exclusion is a solution, though it still requires negotiation with the network security admins who don't always care about the developer's pain.

IMHO McAfee seems to have an overly complex trusted and untrusted process exclusion list, to make things more confusing, plus a network agent that from experience is buggy and changes every release. At *every* site I've done Java work with McAfee installed, McAfee has been a complete pain in the butt. I can't say this of any other AV vendor's products.

CM.

Unknown said...

Hi all

Gerard, thanks for your comment.

It helped a lot. :)

Dizzy said...

i use jDev 11g for development and Panda Global Protection 2009 for AV... doesn't seem to have any issues.

Chris Muir said...

For future readers, updates to JDev 11g since this article was written may have rendered the instructions incorrect.

You're encouraged to consult the updated Oracle JDev documentation here.