<?xml version="1.0" encoding="utf-8"?> | |
<!--Arbortext, Inc., 1988-2006, v.4002--> | |
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" | |
"task.dtd"> | |
<task id="tjcircleb" xml:lang="en-us"> | |
<title outputclass="id_title">Correcting cyclical dependencies after an EAR | |
is imported</title> | |
<shortdesc outputclass="id_shortdesc">You can resolve cyclical dependencies | |
after an EAR is imported.</shortdesc> | |
<prolog><metadata> | |
<keywords><indexterm>dependencies<indexterm>correcting cyclical</indexterm></indexterm> | |
<indexterm>EAR files<indexterm>correcting cyclical dependencies</indexterm></indexterm> | |
<indexterm>projects<indexterm>correcting cyclical dependencies</indexterm></indexterm> | |
</keywords> | |
</metadata></prolog> | |
<taskbody outputclass="id_taskbody"> | |
<context outputclass="id_context"><p outputclass="anchor_topictop"></p> <p>A | |
cyclical dependency between two or more modules in an enterprise application | |
most commonly occurs when projects are imported from outside the workbench. | |
When a cycle exists between two or more modules in an enterprise application, | |
the <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> builder | |
cannot accurately compute the build order of the projects. Full builds fail | |
under these conditions, or require several invocations.</p><p>Therefore, the | |
best practice is to organize your projects or modules into components. This | |
allows your module dependencies to function as a tree instead of a cycle diagram. | |
This practice has the added benefit of producing a better factored and layered | |
application.</p><p>To reorganize your project to correct cyclical dependencies, | |
complete the following steps:</p></context> | |
<steps outputclass="id_steps"> | |
<step><cmd>Identify all the classes within the JAR files that have cyclical | |
dependencies and move those classes into a common <tm tmclass="special" tmowner="Sun Microsystems, Inc." | |
tmtype="tm" trademark="Java">Java</tm> project or JAR file.</cmd></step> | |
<step><cmd>Use the enterprise application editor to map utility JAR files | |
to the common projects.</cmd></step> | |
<step><cmd>For each module of the JAR in the application, use the JAR dependency | |
editor or properties page to set dependencies only to the JAR files that are | |
truly required.</cmd></step> | |
</steps> | |
<postreq outputclass="id_postreq"><p outputclass="anchor_topicbottom"></p></postreq> | |
</taskbody> | |
</task> |