uCosminexus Application Server, Application Development Guide

[Contents][Glossary][Index][Back][Next]

Appendix J.6 Migrating EAR projects

To migrate the EAR project to WTP, create a project in WTP, and then migrate the resources of the EAR project. The procedure for migration is as follows:

Organization of this subsection
(1) Creating an enterprise application project
(2) Migrating the resources of the EAR project

(1) Creating an enterprise application project

Create an enterprise application project in WTP. For details on the procedure for creating the enterprise application project, see 4.4.4 Creating an enterprise application project.

When migrating an EAR project to the enterprise application project of WTP, specify the project name in the project name of the EAR project.

Create the corresponding module project as shown in the following table.

Table J-14 Correspondence of module projects to be created

Item Module projects to be created
If only WAR project is embedded in the EAR project Dynamic Web module project
If only EJB-JAR project is embedded in the EAR project EJB module project
If WAR project and EJB-JAR project are embedded in the EAR project Dynamic Web module project and EJB module project

(2) Migrating the resources of the EAR project

Migrate the resources of the EAR project. For details on the resources that can be migrated, see Appendix J.2(1) Migrating the resources of an EAR project (archive format) and Appendix J.2(2) Migrating the resources of an EAR project (exploded archive format).

To migrate the resources of the EAR project, copy the resources to be migrated in the enterprise application project created in WTP. However, since you cannot migrate application.xml to the project created in WTP, you must copy only the definition. How to copy the resources, and how to migrate application.xml is as follows:

(a) Copying resources

You can use the import functionality of WTP to copy resources. To import:

  1. In the Project Explorer view of WTP, choose the project created in WTP.
  2. From the Eclipse menu bar, choose File - Import.
    The Import dialog box appears.
  3. In the Import dialog box, choose General - File System, and then click the Next button.
    The File System page of the Import dialog box will appear.
  4. In From following directory, specify the project location directory to be migrated.
    You can specify the project location directory from the Browse button as well.
    The folders and files of the specified directory will appear. In the left pane, the folders and files of the directory specified in From following directory will appear in a tree format. In the right pane, the files of the folder selected in the left pane will appear.
  5. Select the resources to be migrated.
    • When migrating all resources of the folder
      In the left pane, select the checkbox of the folder.
    • When migrating only some resources of the folder
      In the right pane, select the checkbox of the files to be migrated.
  6. If Create complete folder structure is selected in Options, specify Create selected folders only.
  7. Click the Finish button.
    The selected resources will be copied.
  8. Migrate the library.
    Execute steps 1 to 3, and then from the Import dialog box, display the File System page.
  9. In From following directory, specify EAR-project-location-directory-to-be-migrated\EAR-root-folder.
    You can specify the directory from the Browse button as well.
    The folders and files of the directory specified in the selection pane of Import will appear.
  10. Select the resources to be migrated.
    In the right pane, select the checkbox of the library to be migrated.
  11. In Options, specify Create selected folders only.
  12. Click the Finish button.
    The selected resources will be copied.

Caution
  • For details on the resources to be migrated, see Appendix J.2 Resources to be migrated.
  • You can also copy the files using the Windows Explorer. However if you use Explorer, the folders and files copied in views such as the Project Explorer view, will not be displayed. To display the copied folders and files, in the Project Explorer view, select the project, and then in the context menu, select Update.
(b) How to migrate application.xml

If you create an enterprise application project, an application.xml template will be created. In the created application.xml file, copy the definition contents of the application.xml file that was used in the environment prior to migration. For details on creating the enterprise application project, see 4.4.4 Creating an enterprise application project.

Following is an example of application.xml created automatically in WTP:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
  <display-name>HelloEAR</display-name>
  <module>
    <web>
      <web-uri>HelloWeb.war</web-uri>
      <context-root>HelloWeb</context-root>
    </web>
  </module>
  <module>
    <ejb>HelloEJB.jar</ejb>
  </module>
</application>

application.xml is created automatically based on the information set up when creating the enterprise application project. The various tags of application.xml are as follows: