Bug 202419 - Can not clean and build an application with a library (e.g. JSTL)
Can not clean and build an application with a library (e.g. JSTL)
Status: NEW
Product: serverplugins
Classification: Unclassified
Component: GlassFish
7.1
PC Windows 7 x64
: P4 (vote)
: 7.4
Assigned To: Vince Kraemer
issues@serverplugins
:
: 202724 204320 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-21 12:58 UTC by Petr Jiricka
Modified: 2013-01-04 14:20 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2011-09-21 12:58:18 UTC
1. Create a EE 6 web application with GlassFish 3.1.1 target
2. Add JSTL from the Library Manager to the project libraries
3. Use JSTL in index.jsp, e.g.  <c:out value="here"/>
4. Deploy the application
5. Clean and build

The following error appears in the output window:

init:
undeploy-clean:
Undeploying ...
Initializing...
deps-clean:
do-clean:
Deleting directory C:\Users\pjiricka\Documents\NetBeansProjects\WebApplication5\build
C:\Users\pjiricka\Documents\NetBeansProjects\WebApplication5\nbproject\build-impl.xml:1054: Unable to delete file C:\Users\pjiricka\Documents\NetBeansProjects\WebApplication5\build\web\WEB-INF\lib\jstl.jar
BUILD FAILED (total time: 2 seconds)
Comment 1 Petr Jiricka 2011-09-23 12:09:06 UTC
Different steps to reproduce:

1. Create a EE 6 web application with GlassFish 3.1.1 target
2. Add JSTL from the Library Manager to the project libraries
3. Deploy the application
4. Shut down GlassFish and NetBeans
5. Start GlassFish from the command line and access the application URL through a web browser
6. In the command prompt, switch to the project root directory and run 'ant clean'
= > This fails with the same error as above. And also:

1. Create a EE 6 web application with GlassFish 3.1.1 target
2. Add JSTL from the Library Manager to the project libraries
3. Deploy the application
4. Shut down GlassFish from the Services window
5. Clean and build the project
=> Now the clean succeeds.

These scenarios show that the problem is on the side of the GlassFish runtime, which holds a lock on the jar file. Vince, could you please discuss this with whoever is responsible for this area on the runtime side? Thanks.
Comment 2 Vince Kraemer 2011-09-23 14:54:14 UTC
(In reply to comment #1)
> Different steps to reproduce:
> 
> 1. Create a EE 6 web application with GlassFish 3.1.1 target
> 2. Add JSTL from the Library Manager to the project libraries
> 3. Deploy the application
> 4. Shut down GlassFish and NetBeans
> 5. Start GlassFish from the command line and access the application URL through
> a web browser
> 6. In the command prompt, switch to the project root directory and run 'ant
> clean'
> = > This fails with the same error as above. 

Actually, this should fail... since you haven't undeployed the app and the server is still live...

> And also:
> 
> 1. Create a EE 6 web application with GlassFish 3.1.1 target
> 2. Add JSTL from the Library Manager to the project libraries
> 3. Deploy the application
> 4. Shut down GlassFish from the Services window
> 5. Clean and build the project
> => Now the clean succeeds.
> 
> These scenarios show that the problem is on the side of the GlassFish runtime,
> which holds a lock on the jar file. Vince, could you please discuss this with
> whoever is responsible for this area on the runtime side? Thanks.

I will raise the issue again.

There isn't a plugin change that will address this... so this issue is invalid (using a strict definition).

I am going to drop it to p3 and leave it open to keep it monitored.
Comment 3 Vince Kraemer 2011-09-23 15:00:01 UTC
Why are we packaging jstl.jar in the app when it targets glassfish?


$ find . -name '*jstl*.jar'
./glassfish/modules/javax.servlet.jsp.jstl.jar
./glassfish/modules/jstl-connector.jar
./glassfish/modules/jstl-impl.jar
Comment 4 Vince Kraemer 2011-09-23 17:35:50 UTC
filed gf issue http://java.net/jira/browse/GLASSFISH-17339
Comment 5 Vince Kraemer 2011-09-23 18:05:28 UTC
moving to p4.

this issue should not be counted in the stop ship criteria for NB... since there is nothing that folks in the NB team can do about it...
Comment 6 Petr Jiricka 2011-09-23 20:53:45 UTC
Thanks a lot for filing the GlassFish bug; I agree with downgrading this to P4.

Regarding the question about packaging JSTL, I think the reason is that there is no API that would allow the plugin to specify whether the server contains JSTL.
Comment 7 Vince Kraemer 2011-09-27 13:00:37 UTC
*** Bug 202724 has been marked as a duplicate of this bug. ***
Comment 8 Vince Kraemer 2011-10-27 19:21:51 UTC
*** Bug 204320 has been marked as a duplicate of this bug. ***
Comment 9 Petr Jiricka 2011-12-09 09:01:19 UTC
This bug is supposedly fixed on the GlassFish side in promoted build 13: http://dlc.sun.com.edgesuite.net/glassfish/3.1.2/promoted/

Can someone who has a Windows machine please check whether using the new GF build fixes this? Thanks.
Comment 10 bht 2011-12-12 08:05:02 UTC
I understand that this is a GF issue that shows up in a development environment.

Do I took the testcase from issue and re-tested it under NetBeans. This time I get a different error where it seems that the servlet API cannot be found. I installed glassfish-3.1.2-b13-windows-ml.exe and registered it with NetBeans.

init:
undeploy-clean:
deps-clean:
do-clean:
Deleting directory C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build
check-clean:
clean:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Created dir: C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\web\WEB-INF\classes
Copying 1 file to C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\web
library-inclusion-in-archive:
Copying 1 file to C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\web\WEB-INF\lib
Copying 1 file to C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\web\WEB-INF\lib
Copying 1 file to C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\web\WEB-INF\lib
library-inclusion-in-manifest:
Created dir: C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\empty
Compiling 2 source files to C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\build\web\WEB-INF\classes
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:35: package javax.servlet does not exist
import javax.servlet.*;
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:36: package javax.servlet.annotation does not exist
import javax.servlet.annotation.WebServlet;
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:37: package javax.servlet.http does not exist
import javax.servlet.http.*;
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:47: cannot find symbol
symbol: class HttpServlet
    extends HttpServlet {
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:45: cannot find symbol
symbol: class WebServlet
@WebServlet(name="Servlet", urlPatterns={"/servlet"})
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:58: cannot find symbol
symbol  : class HttpServletRequest
location: class servlet.stateless.Servlet2Stateless
    public void service(HttpServletRequest req, HttpServletResponse resp)
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:58: cannot find symbol
symbol  : class HttpServletResponse
location: class servlet.stateless.Servlet2Stateless
    public void service(HttpServletRequest req, HttpServletResponse resp)
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:59: cannot find symbol
symbol  : class ServletException
location: class servlet.stateless.Servlet2Stateless
            throws ServletException, IOException {
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:89: cannot find symbol
symbol  : class ServletException
location: class servlet.stateless.Servlet2Stateless
            throw new ServletException(ex);
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\src\java\servlet\stateless\Servlet2Stateless.java:57: method does not override or implement a method from a supertype
    @Override
10 errors
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\nbproject\build-impl.xml:543: The following error occurred while executing this line:
C:\bt\java\GlassFish\V3\issues\_closed\GlassFishDoesNotReleaseJarFile\ServletStateless\nbproject\build-impl.xml:297: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 3 seconds)
Comment 11 Jiri Skrivanek 2011-12-12 13:03:17 UTC
It seems to be fixed in GlassFish 3.1.2 build 13. Tested on Windows XP.
Comment 12 Petr Jiricka 2012-03-21 10:27:38 UTC
I must say this still does not work for me using an application that contains a web service and packages a separate copy of Jersey. I am using GF 3.1.2 final, NetBeans build from March 21st (Build EaselCSS-144-on-20120321) and:
Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

The output window says:

ant -f C:\\easel_demo\\SampleDBrest\\build.xml -DforceRedeploy=false clean
init:
undeploy-clean:
Undeploying ...
deps-clean:
do-clean:
Deleting directory C:\easel_demo\SampleDBrest\build
C:\easel_demo\SampleDBrest\nbproject\build-impl.xml:1092: Unable to delete file C:\easel_demo\SampleDBrest\build\web\WEB-INF\lib\jersey-gf-server.jar
BUILD FAILED (total time: 2 seconds)
Comment 13 Petr Jiricka 2012-03-21 10:50:43 UTC
The workaround is to shut down GlassFish, after that the Clean operation succeeds.
Comment 14 bht 2012-03-21 17:05:45 UTC
I have had seemingly random failures as well, but failed to reproduce them.

At the same time, I found one case in my app that reproduces, but that seems to be caused by a web framework not GlassFish. See https://issues.apache.org/jira/browse/WICKET-4458

After all I have to say that NetBeans integration is quite good and ahead of other IDE's "disintegrated" approach. Only due to this integration do I actually get into the finer details while otherwise I would have to spend more time getting incompatible plugins to work.

I have just seen this with Java Web Start where NetBeans again does it out of the box where Eclipse is a 100% failure. Now I am spending time to hand-code a build script for that environment, basically reverse-engineering what NetBeans provides so it fits within one of the myriad of "standard" corporate "build environments".

Why not just take a NetBeans-generated build script, extend it if necessary and run it on a build server?
Comment 15 Vince Kraemer 2012-03-21 23:02:28 UTC
(In reply to comment #12)
> I must say this still does not work for me using an application that contains a
> web service and packages a separate copy of Jersey. I am using GF 3.1.2 final,
> NetBeans build from March 21st (Build EaselCSS-144-on-20120321) and:
> Java: 1.7.0_02; Java HotSpot(TM) Client VM 22.0-b10
> System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
> 
> The output window says:
> 
> ant -f C:\\easel_demo\\SampleDBrest\\build.xml -DforceRedeploy=false clean
> init:
> undeploy-clean:
> Undeploying ...
> deps-clean:
> do-clean:
> Deleting directory C:\easel_demo\SampleDBrest\build
> C:\easel_demo\SampleDBrest\nbproject\build-impl.xml:1092: Unable to delete file
> C:\easel_demo\SampleDBrest\build\web\WEB-INF\lib\jersey-gf-server.jar
> BUILD FAILED (total time: 2 seconds)

It looks like the root cause of http://java.net/jira/browse/GLASSFISH-17339 was a bug in the JSTL library or one of its dependencies.  That may be the root cause of what you are seeing in this case (since you are talking about using a different library).
Comment 16 TomasKraus 2013-01-04 14:20:04 UTC
I'll check this again in next release cycle.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo