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 136024 - Cannot run servlet when web app is in an ear
Summary: Cannot run servlet when web app is in an ear
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: EAR (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-28 18:27 UTC by Petr Dvorak
Modified: 2016-07-07 08:56 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 Petr Dvorak 2008-05-28 18:27:11 UTC
NB: 200805280004
OS: Ubuntu 8.04
JDK: 1.6.0_10

1. create two Enterprise Applications (EA1 and EA2), both with a Web Application Module.
2. EA1 contains a web service with an operation
3. EA2 contains a web service client and a servlet calling web service.
4. Deploy both enterprise applications on Glassfish
5. Try to run the servlet from the IDE (only a single file)
-> an exception is thrown (not NB exception, just normal application exception)

If you run whole enterprise application, browser opens on a "http://localhost:8080/EA2-war/".
If you type the servlet name manually (so that you have "http://localhost:8080/EA2-war/NewServlet"), servlet is
displayed correctly.

I would expect that if you run the servlet file in the IDE, it will be displayed in the browser. If this is not a bug,
it could be at least an enhancement...
Comment 1 Petr Dvorak 2008-05-28 18:28:58 UTC
This exception is thrown:

Deployment error:
The module has not been deployed.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:174)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:461)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: The module has not been deployed.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:168)
        ... 16 more
BUILD FAILED (total time: 1 second)

Note: This exception is not thrown when you do the same steps with a Web Application instead of an Enterprise
Application with a web module...
Comment 2 Vince Kraemer 2008-06-02 04:55:32 UTC
This doesn't work the way you expect on any server that supports ear files.
Comment 3 Petr Dvorak 2008-06-02 08:40:05 UTC
vkraemer: You are right...
Comment 4 Petr Hejl 2008-08-27 15:20:47 UTC
It is impossible for web app to determine whether it is part of EAR afaik.

Due to this run is trying to deploy war, which fails due to already used context. Complete ant log is:

Trying to create reference for application in target server  failed; The context root [EnterpriseApplication1-war] in
application [EnterpriseApplication1-war] is already in use by another application on this instance [server].
Deployment error:
The module has not been deployed.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:190)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:486)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: The module has not been deployed.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:184)
        ... 16 more
BUILD FAILED (total time: 1 second)
Comment 5 Martin Balin 2016-07-07 08:56:33 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss