I'm trying to deploy a Netbeans/Glassfish project on my local PC. It's currently running in production
The project appears to be structured as an Enterprise application based on docs found at this url:
https://netbeans.org/kb/docs/javaee/maven-entapp.html#intro
The project has the following 5 modules:
WI-EAR
WI-EJB
WI-Enterprise
WI-ENT-web
WE-Web
According to the above referenced tutorial, the project that is used to run and deploy from Netbeans is the "-EAR" project.
When I right-click the WI-EAR project node and choose Build with Dependencies, per the tutorial, I get this result:
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
I can see the created .ear file in the "target" directory, under the name "WI-EAR".
So far so good. Next, again per the tutorial, I right-click the EAR project node in the Projects window and choose Run.
At this point, however, the GlassFish console displays the following error:
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.
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?
Had to change the EAR's pom.xml to include the modules section below - note the "unpack" command.
ALSO
Under the dependencies section, make sure to declare the types - in my case the problem was that there wasn't an "ejb" type specified.