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.
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.
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.
*** Bug 235651 has been marked as a duplicate of this bug. ***
Could you please provide a simple test case illustrating this problem? Thanks.
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.
>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?
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"/>
Still no autodeploy in 7.4RC1.
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)
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.
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