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 235653 - Autodeploy of J2EE application with EJB and web apps fails
Summary: Autodeploy of J2EE application with EJB and web apps fails
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
: 235651 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-08 15:03 UTC by ajeh
Modified: 2016-07-07 08:55 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 ajeh 2013-09-08 15:03:56 UTC
Product Version = NetBeans IDE 7.3.1 (Build 201306052037)
Operating System = Linux version 2.6.35.14-96.PhenomX4full.fc14.x86_64 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

Auto-deployment of the Web JSP app with EJB beans is not working. It does not copy the EJB classes into WAR hierarchy.

The workaround is to clean build the whole application, then run application, it will fail with 'package <EJB package name> does not exist' error.
Then then copy the EJB package directory under WEB-INF/classes and run application again.
Comment 1 ajeh 2013-09-08 22:28:39 UTC
Just one clarification: that is only happening while there is a JSP page and EJB bean in the project.
As soon as I added the very 1st servlet to the project, I no longer had to copy over the classes. With the servlets present it was sufficient to Clean/build and run once.
Once those two steps completed, I could access the JSP page's or servlet's URLs from another browser and they would work.
However if I only did Clean/build and tried to access the pages from another browser, they would not work until I did Run once.
Comment 2 David Konecny 2013-09-09 23:53:28 UTC
*** Bug 235651 has been marked as a duplicate of this bug. ***
Comment 3 David Konecny 2013-09-10 00:16:59 UTC
Could you please provide a simple test case illustrating this problem? Thanks.
Comment 4 ajeh 2013-09-10 00:24:02 UTC
The test case is indeed very simple and I essentially described it below.

Create a new Jave EE/Enterprise Application project.
Add 1 EJB and 1 JSP page.
Create code to instantiate a bean from JSP.

This application will not autodeploy, i.e. I would have to do clean/build and then run once in order for the JSP page to be accessible.
It will not debug after clean/build too - to debug I have to run it once, then debug.
Comment 5 David Konecny 2013-09-10 03:13:07 UTC
>It does not copy the EJB classes into WAR hierarchy.

In Enterprise Application case EJB classes are not copied into WAR - they are packaged as an EJB module. Similarly Web project is packaged as WAR and stored in EAR too.

It sounds to me that in your case you either want to define your EJB classes directly in your Web Project without the need for EAR. That would be easiest solution. Or you can keep your EJBs in separate JAR and add that proejct directly to Web Application compilation classpath (and tick 'Package' box) and deploy directly the Web App again without EAR. I have not tested that but it should work.


> Create code to instantiate a bean from JSP.

How do you inject EJB into your JSP?
Comment 6 ajeh 2013-09-10 12:45:56 UTC
This is not really my project - it is as it was auto-generated by NetBeans.
It simply did not build/run until one servlet was added, unless class files were copied. Since adding a servlet copying is no longer required.

Instantiation of the bean is standard:

<%@page import="package.beanclass" %>
<jsp:useBean id="bean" scope="session" class="package.beanclass"/>
Comment 7 ajeh 2013-09-21 13:28:14 UTC
Still no autodeploy in 7.4RC1.
Comment 8 ajeh 2013-09-21 13:29:44 UTC
ant -f /home/username/NetBeansProjects/Builder/Builder-war -Dbrowser.context=/home/username/NetBeansProjects/Builder/Builder-war -DforceRedeploy=false -Ddirectory.deployment.supported=true -Dnb.wait.for.caches=true -Dnb.internal.action.name=run run
init:
deps-module-jar:
Builder-ejb.init:
Builder-ejb.deps-jar:
Builder-ejb.compile:
Builder-ejb.library-inclusion-in-archive:
Builder-ejb.dist:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
In-place deployment at /home/username/NetBeansProjects/Builder/Builder-war/build/web
GlassFish Server 4.0, deploy, null, false
/home/username/NetBeansProjects/Builder/Builder-war/nbproject/build-impl.xml:1051: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 2 seconds)
Comment 9 ajeh 2013-09-22 14:29:00 UTC
The problems with autodeploy are pretty serious. The projects just don't want to autodeploy and instead run old code. I can be re-running the project after code changes on both JSF and bean side and still see the same bug I was trying to fix. However if I Clean/built and Deployed, the bug would appear to be fixed. Very annoying.
Comment 10 Martin Balin 2016-07-07 08:55:02 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