title: Netbeans/Glassfish - Expected to find an expanded directory but found a JAR
body: <p>I'm trying to deploy a Netbeans/Glassfish project on my local PC. It's currently running in production</p>
  
  <p>The project appears to be structured as an Enterprise application based on docs found at this url:</p>
  
  <p><a href="https://netbeans.org/kb/docs/javaee/maven-entapp.html#intro" rel="noreferrer">https://netbeans.org/kb/docs/javaee/maven-entapp.html#intro</a></p>
  
  <p>The project has the following 5 modules:</p>
  
  <pre><code>WI-EAR
  WI-EJB
  WI-Enterprise
  WI-ENT-web
  WE-Web
  </code></pre>
  
  <p>According to the above referenced tutorial, the project that is used to run and deploy from Netbeans is the "-EAR" project.  </p>
  
  <p>When I right-click the WI-EAR project node and choose Build with Dependencies, per the tutorial, I get this result: </p>
  
  <pre><code>Reactor Summary:
  
  WI-EJB ............................................ SUCCESS [0.723s]
  WI-Enterprise ..................................... SUCCESS [0.004s]
  Wi-LIB ............................................ SUCCESS [0.288s]
  WI-ENT-web ........................................ SUCCESS [3.012s]
  WI-EAR ............................................ SUCCESS [1.520s]
  ------------------------------------------------------------------------
  BUILD SUCCESS
  </code></pre>
  
  <p>I can see the created .ear file in the "target" directory, under the name "WI-EAR". </p>
  
  <p>So far so good. Next, again per the tutorial, I right-click the EAR project node in the Projects window and choose Run.</p>
  
  <p>At this point, however, the GlassFish console displays the following error:</p>
  
  <pre><code>SEVERE: Exception while deploying the app
  java.lang.IllegalArgumentException: Expected to find an expanded directory for submodule WI-EJB-1.0-SNAPSHOT.jar but found a JAR.  If this is a directory deployment be sure to expand all submodules.
  </code></pre>
  
  <p>By clicking on the "WE-EAR.ear" file within Netbeans, I can see that it in fact does contain "WI-EJB-1.0-SNAPSHOT.jar", as opposed to an expanded directory. How can I resolve this problem? </p>