Previous Next vertical dots separating previous/next from contents/index/pdf

Configuring Standard Project Dependencies

There are three kinds of project dependencies:

  1. All projects (web services, dynamic web, utility and EJB projects) must be added to an EAR project in order to deploy together either to a server or to an archive. Can be set automatically at project creation.
  2. If a utility or EJB project is added to an EAR that already contains a web services project(s) or dynamic web project(s), the new utility/EJB project must be made available to each web project (web service project and dynamic web project) to ensure that the utility/EJB project is available to the web project at build time. Can be set automatically at project creation.
  3. If utility or EJB projects have dependencies on other utility or EJB projects, the projects must have those dependencies set explicitly. Note that you must not create circular dependencies.

The normal process creates dependencies automatically if you:

OR

You may need to configure these dependencies explicitly if:

Step 1: Adding Projects to an EAR

You may need to configure this dependency explicitly if projects compile correctly locally but do not deploy correctly to the server because not all projects are in the EAR. All of the projects associated with an EAR must be added to the EAR, including EJB projects, utility projects, dynamic web projects and web service projects.

To add a project to an EAR project:

  1. Right click on the EAR project name in the Package Explorer view and choose Properties from the context menu. From the Properties dialog, click on J2EE Module Dependencies in the bar at the left. In the sample below, there are three projects, one already added to the ear and two that are not added.

  2. Click in the box beside the name of each project to be added to the EAR project. Click OK to add the projects to the EAR.

Note that adding a utility or EJB project to an EAR does not make the project available to web projects in the same EAR. To add a utility or EJB project to the web projects in the EAR, follow the process described below for every project in the EAR that has a dependency on that project.

Step 2: Adding Utility and EJB Projects to Web Projects

Since EJB and utility projects contain code that is used by web service projects or dynamic web projects, the usual option is to have EJB and utility projects available to all projects within an EAR. In practical terms, this means that

However utility and EJB projects are not available at build time unless the project dependencies are configured correctly.

To specify that utility and EJB projects are available to all projects in an EAR, the simplest method is to check the Add dependencies from all WebLogic Web modules in EAR to this module checkbox on the third screen of the creation wizard (the default setting) when creating a utility or EJB project. This is the default setting.

If the project dependencies for utility/EJB projects are not set at project creation, you can make a utility or EJB project available to the web services project and dynamic web projects in your EAR. For each web project:

  1. Right click on the web services or dynamic web project name in the Package Explorer view and choose Properties from the popup menu. From the Properties dialog box, click on J2EE Module Dependencies in the bar at the left. Be sure that the J2EE Modules tab is selected. In the sample below, there is a new utility project which is not added to the current project.

  2. Click in the box beside the name of each project to be added. Click OK to add the utility or EJB project(s) to the web project.

Note that the References to EJB JARs with EJB Client JARs box has no effect in Workshop for WebLogic projects.

Step 3: Making Utility and EJB Projects Available to Other Utility/EJB Projects

Utility and EJB projects may have dependencies on each other. If this is the case,

  1. Right click on the utility or EJB project name in the Package Explorer view and choose Properties from the popup menu. From the Properties dialog box, click on J2EE Module Dependencies in the bar at the left. Be sure that the J2EE Modules tab is selected. In the sample below, there is a utility project which is not added to the current project.
  2. Click in the box beside the the name of each project to be added. Click OK to add the utility or EJB project(s) to the current utility or EJB project.

Note that the References to EJB JARs with EJB Client JARs box has no effect in Workshop for WebLogic projects.

Note that you should not create circular dependencies among EJB and utility projects.

Related Topics

Applications and Projects

Understanding the Build Process

Deploying an Application for Testing

 

Skip navigation bar   Back to Top