Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 187624 - web-fragment.xml must stay under WEB-INF/lib in EAR app
web-fragment.xml must stay under WEB-INF/lib in EAR app
Product: javaee
Classification: Unclassified
Component: EAR
All All
: P2 (vote)
: 7.0
Assigned To: David Konecny
Depends on:
  Show dependency treegraph
Reported: 2010-06-16 01:26 UTC by David Konecny
Modified: 2010-07-09 23:38 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2010-06-16 01:26:48 UTC
While discussing issue 187548 Vince pointed out following problem:

The Servlet 3.0 spec section 8.2.1 says: "Only jar files that are packaged in WEB-INF/lib are scanned for META-INF/web-fragment.xml"

This is a problem when a web project is packaged into an EAR. In such a case all jars from WAR/WEB-INF/lib are moved to EAR/lib folder and that breaks above rule - none of web-fragment.xml presented in Web application will not be found.

Short term workaround:
Open Web project's project.xml and search for record representing a jar containing web-fragment.xml. It will look something like:

  <library dirs="200">

Change '200' to '300' (it does not make much logic because dirs attribute is currently used for something else then it was originally designed for; reason is backward compatibility of project files). After this change jar will be kept under WEB-INF/lib folder.

Long term solution:
There is a logic in place in <copyfiles> Ant task to not copy jar file in case jar contains a file with suffix TLD. This can be easily extended to include also check for META-INF/web-fragment.xml. The fix is localized to Ant task implementation.

Because workaround is available I'm filing this as P2. If NB 69 was not release this should be release notes candidate but it is too late for that. The problem should be fixed in Patch1.
Comment 1 David Konecny 2010-06-16 01:52:11 UTC
Comment 2 rbalada 2010-06-16 08:57:38 UTC
Please verify bugfix for this bug, so it can be included in release691 repository.

Comment 3 rbalada 2010-06-21 16:01:16 UTC
Please verify bugfix for this bug, so it can be integrated into release691 repository.

Comment 4 David Konecny 2010-06-21 22:10:12 UTC
I filed it and fixed and verified it but somebody else should perhaps verify it as well.
Comment 5 Petr Jiricka 2010-06-22 01:04:13 UTC
Martin, would you please verify this? Thanks.
Comment 6 Martin Schovanek 2010-06-22 12:23:48 UTC
Verified in the trunk build by QE.
Comment 7 rbalada 2010-06-22 13:23:34 UTC
main #0ac426471a9f transplanted to release691 #980964401841

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