This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 199710 - Maven Enterprise Applications fail to Run
Summary: Maven Enterprise Applications fail to Run
Status: RESOLVED WORKSFORME
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-26 20:32 UTC by tim_sa
Modified: 2011-09-29 10:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tim_sa 2011-06-26 20:32:29 UTC
Maven Enterprise Applications seem to have an issue where the EAR pom is not generated correctly causing an Exception when you try and run the application.

I did see this bug (http://netbeans.org/bugzilla/show_bug.cgi?id=176007) where they mention the same stack trace however that has been marked as fixed and was opened over 2 years ago.

I'm running NetBeans 7.1 and GlassFish 3.1 (build 43).

stack trace: 

SEVERE: Exception while deploying the app [com.acme_forBugs-ear_ear_1.0-SNAPSHOT]
SEVERE: Expected to find an expanded directory for submodule forBugs-ejb-1.0-SNAPSHOT.jar but found a JAR.  If this is a directory deployment be sure to expand all submodules.
java.lang.IllegalArgumentException: Expected to find an expanded directory for submodule forBugs-ejb-1.0-SNAPSHOT.jar but found a JAR.  If this is a directory deployment be sure to expand all submodules.
	at org.glassfish.javaee.full.deployment.EarHandler.getClassLoader(EarHandler.java:354)
	at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:214)
	at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:197)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:346)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
	at java.lang.Thread.run(Thread.java:662)

SEVERE: Exception while deploying the app [com.acme_forBugs-ear_ear_1.0-SNAPSHOT] : Expected to find an expanded directory for submodule forBugs-ejb-1.0-SNAPSHOT.jar but found a JAR.  If this is a directory deployment be sure to expand all submodules.



To Reproduce:
- Create a new Enterprise Application
- Set GlassFish as the server for modules
- Build all modules
- Run EAR (main) project

workAround:

changing the maven-ear-plugin in the EAR pom file to match the following seems to resolve the issue

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.4.2</version>
                <configuration>
                    <version>6</version>
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <modules>
                        <webModule>
                            <groupId>com.acme</groupId>
                            <artifactId>MyEnterpriseApp-web</artifactId>
                            <unpack>true</unpack>
                            <!--<contextRoot></contextRoot>-->
                        </webModule>
                        <ejbModule>
                            <groupId>com.acme</groupId>
                            <artifactId>MyEnterpriseApp-ejb</artifactId>
                            <unpack>true</unpack>
                        </ejbModule>
                    </modules>
                </configuration>
            </plugin>


However its not perfect as even though the "Display Browser on Run" selection is checked the browser doesn't display
Comment 1 Martin Janicek 2011-09-29 08:31:06 UTC
I'm trying to reproduce, but everything works for me (I'm also using GF 3.1, Nb 7.1).

My steps are:

1. New project (Maven ---> Enterprise application)
2. In third setting step I'm selecting Java EE 6, creating both web and ejb module
3. Four modules was created (ejb, war, ear and maven parent)
4. On Ear project right clicking "Show and Resolve problems"
5. Setting up the Glassfish server for each module
5. Building war module
6. Building ejb module
7. Building ear module
8. Adding one Session bean (no methods in it) into the Ejb module
9. Run EAR module - glassfish server selected (proceed just fine with no exception occurs)

Can you give me some more information or your project sources ?
Comment 2 tim_sa 2011-09-29 10:17:44 UTC
I can no longer reproduce (using Build 201109260601)

Agree with assessment.