There are three kinds of project dependencies:
- 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.
- 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.
- 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:
- Create an EAR project first and then as new projects are created, click the Add project to an EAR option in the project creation wizard to add the projects to the EAR
OR
- Create your projects and then create a EAR project and from the project creation wizard, add projects to the EAR.
You may need to configure these dependencies explicitly if:
- A project was imported (rather than created) in your workspace
- A project was not added to the EAR at creation time
- Projects do not compile correctly because a utility or EJB project is not available at build/run time
- The IDE does not recognize references to the utility project or EJB project objects when editing source files
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:
- 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.
- 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
- Utility projects are compiled into libraries that are stored in the APP-INF/lib folder of the EAR, to be shared by all projects in the EAR. These libraries are then inserted on the build path for each of the web projects.
- EJBs are loaded at runtime and available for all web projects/modules in the enterprise application.
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:
- 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.
- 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,
- 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.

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