RAD not adding an EAR project to a WAS instance

17,165

Solution 1

A couple of potential solutions:

  1. Uninstall your application, stop the server, reinstall your application, start the server.

  2. right click on the EAR and check "Deployment Assembly" and make sure your modules are being exported. if so, it is a good idea to remove them and re add them.

  3. Check "Project References" and make sure they are checked.

Solution 2

In my case the solution was:

1-Make sure the web project had already run Maven so as to have the .war inside Target.

2-Right click on ear project, go to Properties > Deployment Assembly.

3-Click “Add” button, choose Archives from Workspaces. Click Add, and choose your war.

4-The War now is at Deployment Assembly list.

5-Start server.

Solution 3

To add the project back to the server,

  1. Right click on your jar project and go to properties, click Java EE module dependencies. Select the project jar checkboxes under Available Java EE modules. This will get the project back.
  2. Now right click on your was server and try add/remove project. It will appear in the left panel for selection.
Share:
17,165
Victor
Author by

Victor

Java developer, working on enterprise systems

Updated on June 04, 2022

Comments

  • Victor
    Victor almost 2 years

    In my RAD workspace, I have an EAR project. Now I have a WAS 6.1 instance which i created from inside RAD. When I right click the WAS 6.1 instance and do 'Add Remove projects' and select the EAR, I get error:

    Cannot add an EAR project to the server unless it contains a Web, EJB, or Connector module.
    

    Now this is not true because in my EAR project there is META-INF/application.xml and it has the contents:

    <?xml version="1.0" encoding="UTF-8"?>
    <application id="Application_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>
        someEAR</display-name>
        <module id="EjbModule_1291759813449">
            <ejb>someEJB.jar</ejb>
        </module>
        <module>
            <web>
                <web-uri>someWeb.war</web-uri>
                <context-root>someWeb</context-root>
            </web>
        </module>
    </application>
    

    So clearly it has a <web> and <ejb> module. Why is RAD complaining?

  • Victor
    Victor over 11 years
    Thanks. I understand #2 since it is related to application.xml. But why recommend #3?
  • Akhil Nambiar
    Akhil Nambiar over 6 years
    #2 helped me . Thanks!