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 58047 - project - resolved broken reference doesn't update build-impl.xml and private.properties
Summary: project - resolved broken reference doesn't update build-impl.xml and private...
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 4.x
Hardware: All All
: P1 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords:
Depends on:
Blocks: 58078 58079
  Show dependency tree
 
Reported: 2005-04-19 16:04 UTC by zikmund
Modified: 2006-03-24 12:44 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
diff (690 bytes, text/plain)
2005-04-20 03:26 UTC, Pavel Buzek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zikmund 2005-04-19 16:04:48 UTC
Build 20050419-1108

1) Have 4.0 WebApp which uses project/external JAR or library (as broken references)
2) Project's context menu | Resolve Reference Problems
3) Resolve all reference problems
4) ERROR:
build-impl.xml doesn't contain resolved references, i.e. those JAR files will
not be part of WAR file.
Comment 1 zikmund 2005-04-19 17:44:03 UTC
Similar problem arises when moving project using a library from Library manager
from another computer. See these steps:

1) Have WebApp which uses a library from Library Manager
  Note: see that nbproject/private/private.properties contains file references
like: libs.MyStruts.classpath.libfile.1
2) Move it to different computer
3) Start IDE on new computer
4) Open WebApp project
5) Resolve broken reference (i.e. create library in Library Manager)
  Note: see that nbproject/private/private.properties still DOESN'T contain file
references like: libs.MyStruts.classpath.libfile.1
6) Clean and Build
7) ERROR:
build fails with error (because of missing library files references)

library-inclusion-in-archive:
D:\NetBeans\...\Web Application2\nbproject\build-impl.xml:378: Warning: Could
not find file D:\NetBeans\...\Web
Application2\${libs.MyStruts.classpath.libfile.9} to copy.


Workaround for both test cases is: open project's properties and press OK.
Comment 2 zikmund 2005-04-19 18:26:53 UTC
More information about 4.0 application scenario:

I1) Have 4.0 WebApp which uses Java Project, external JAR file and library from
Library Manager (which is not in 4.1 Library Manager)
I2) Open 4.0 WebApp in 4.1
I3) Project's context menu | Resolve Reference Problems
I4) Upgrade dialog appears -> Upgrade
  Note: nbproject/private/private.properties
    - doesn't contain library files references: libs.Struts.classpath.libfile.1
    - contains old references to JavaProject JAR and external JAR
I5) Resolve references = browse external JAR, browse Java Project, create
library in Library Manager
Note:
  nbproject/private/private.properties
    - still doesn't contain library files references (it's ERROR)
    - contains new references to JavaProject JAR and external JAR (it's OK)
  nbproject/build-impl.xml
    - stays unchanged (it's ERROR)
I6) Resolve Missing Server problem
I7) Clean and build
ERROR:
  - ant target succeess,
  - but created WAR file doesn't contain any JAR (nor external nor from Java
project nor from library)

I8) Open project's Properties -> press OK.
Note:
  nbproject/private/private.properties
    - contains additional javac.debug=true and javadoc.preview=true
      (is it error that it is not added in step I5?)
    - contains additional library files references (it's OK)
  nbproject/build-impl.xml - additional content:
    - target library-inclusion-in-manifest contains all JAR files references
(basename and copy)
    - target library-inclusion-in-archive contains all JAR files copy
Comment 3 Vince Kraemer 2005-04-20 00:21:23 UTC
Is this also an issue for other J2EE projects like EJB or Ent App?
Comment 4 Pavel Buzek 2005-04-20 02:40:07 UTC
I added call to WPP after the references are resolved, this should refresh the
references in private properties correctly. If works in the example I got from
Karel (I create a fake Struts library with 2 jar file for testing).

I agree this is a candidate for merge into release41 if my fix works in all
cases Karel has. Radko and/or Marku, please review. Thanks.


I can see the same problem in ejb project. I will see if the same fix can be
applied there.
Comment 5 Pavel Buzek 2005-04-20 03:26:08 UTC
Created attachment 21745 [details]
diff
Comment 6 zikmund 2005-04-20 11:12:52 UTC
Verified by QE in trunk build 20050420-0434.
Comment 7 Radko Najman 2005-04-20 13:27:09 UTC
I reviewed the proposed fix and agree with it.
Comment 8 Marek Fukala 2005-04-20 14:07:27 UTC
I reviewed the fix and it seems to be OK to me.
Comment 9 zikmund 2005-04-20 15:24:36 UTC
BTW: the fix is still not ideal (see issue 58103 for remaining problems).
Although I agree that this solution is good enough for 4.1.
Comment 10 zikmund 2005-04-22 12:36:01 UTC
Pavle, could you please integrate the fix into release41 branch? Thanks.
Comment 11 Pavel Buzek 2005-04-22 16:28:06 UTC
merged to release41

Checking in src/org/netbeans/modules/web/project/ui/WebPhysicalViewProvider.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/WebPhysicalViewProvider.java,v
 <--  WebPhysicalViewProvider.java
new revision: 1.26.2.2; previous revision: 1.26.2.1
done
Comment 12 zikmund 2005-04-29 12:01:07 UTC
Reopening - the fix in release41 branch doesn't work. The commit place is
different from trunk commit.
Comment 13 zikmund 2005-04-29 12:02:15 UTC
BTW: Fixes of issue 58078 and issue 58079 are OK.
Comment 14 Andrei Badea 2005-04-29 12:07:45 UTC
In the release41 branch, the call to WebProjectProperties.save() was introduced
in the BrokenServerAction.checkMissingServer() instead of the
BrokenLinksAction.run() method. I will fix it.
Comment 15 Andrei Badea 2005-04-29 12:10:58 UTC
Integrated the correct fix in release41:

Checking in WebPhysicalViewProvider.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/WebPhysicalViewProvider.java,v
 <--  WebPhysicalViewProvider.java
new revision: 1.26.2.3; previous revision: 1.26.2.2
done
Comment 16 zikmund 2005-04-29 13:41:47 UTC
Verified in custom release41 build.
Comment 17 zikmund 2005-04-29 15:11:34 UTC
Verified in 200504291131 release41 build.
Comment 18 zikmund 2005-04-29 15:15:33 UTC
Verified in 200504291131 release41 build.