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 208749 - Module system caches use absolute paths
Summary: Module system caches use absolute paths
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.2
Hardware: Other Linux
: P2 normal with 1 vote (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
: 209937 227219 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-22 13:15 UTC by Jaroslav Tulach
Modified: 2013-08-10 08:02 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test and elimination of the absolute paths from localeVariants (7.09 KB, patch)
2012-02-22 13:16 UTC, Jaroslav Tulach
Details | Diff
A NetBeans IDE installation can be moved to different folder and still previous caches work (33.16 KB, patch)
2012-02-23 14:58 UTC, Jaroslav Tulach
Details | Diff
sample code for comment 7 (25.09 KB, application/zip)
2013-02-28 09:20 UTC, mdobacz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2012-02-22 13:15:30 UTC
In order to allow an installer to create the module system caches for shared installation, it is useful to eliminate the absolute paths that are stored in there.

Right now the absolute paths seem to be used in
all-locales.dat, all-layers.dat and all-resources.dat
Comment 1 Jaroslav Tulach 2012-02-22 13:16:41 UTC
Created attachment 116024 [details]
Test and elimination of the absolute paths from localeVariants
Comment 2 Jaroslav Tulach 2012-02-23 14:58:15 UTC
Created attachment 116063 [details]
A NetBeans IDE installation can be moved to different folder and still previous caches work
Comment 3 Jaroslav Tulach 2012-02-27 12:56:06 UTC
ergonomics#d102329cd227
Comment 4 Quality Engineering 2012-03-01 10:59:01 UTC
Integrated into 'main-golden', will be available in build *201203010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d102329cd227
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208749: Absolute paths are eliminated from NetBeans caches
Comment 5 Jaroslav Tulach 2012-03-22 16:44:47 UTC
*** Bug 209937 has been marked as a duplicate of this bug. ***
Comment 6 mdobacz 2012-11-27 09:22:47 UTC
(In reply to comment #2)
> Created attachment 116063 [details]
> A NetBeans IDE installation can be moved to different folder and still previous
> caches work

Should this be fixed for other NetBeans Platform-based applications (other than the NetBeans IDE) as of NBP RELEASE73-BETA2 (maven) ?

I can indeed move the IDE, but we see our own application falling appart (our functionality missing, numerous ClassNotFoundException's in log, e.g. for all our actions) when we move the unpacked application to another folder after the profile has been created.

Grep shows absolute path to installation appears in binary cache files all-files.dat, all-layers.dat, all-manifests.dat, all-resources.dat and localeVariants (though the context in which they appear is unknown to me).

Removing var/cache solves the problem. Moving back to previous location also solves the problem.

We tried platform RELEASE72, RELEASE721 and RELEASE73-BETA2, but no luck with either.
Comment 7 mdobacz 2013-02-28 09:19:39 UTC
This does not seem to be completely fixed for NB Platform 7.3 applications other than perhaps NB IDE. The Product field says "platform", so I assume it should work for all platform applications - hence the reopen.

I'm attaching a simple application written for another bug report - its function is completely irrelevant here. 

Steps to reproduce problem:

1) Ensure ~/.iconchange folder does not exist
2) Unpack, build with maven, unzip application/target/iconchange-app-1.0-SNAPSHOT.zip to somewhere, cd to there
3) cd iconchange/bin
4) ./iconchage
5) application will open, there will be 2 top comps on left and a greenish action button in the toolbar, what it does is irrelevant
6) close the application, you should now have its profile at ~/.iconchange
7) cd ../..
8) mv iconchange ic
9) cd ic/bin
10) ./iconchage

Application will open but top components will no longer be open and the action will have disappeared. Renaming the folder back to "iconchange" solves the problem.

Attachment will follow.
Comment 8 mdobacz 2013-02-28 09:20:27 UTC
Created attachment 132000 [details]
sample code for comment 7
Comment 9 Jaroslav Tulach 2013-04-12 12:19:30 UTC
To debug and see what goes wrong, please breakpoint to method's org.netbeans.Stamps.produceRelativePath last line:
  doWritePath("abs", path, out); // NOI18N

When the breakpoint is hit, the caches are going to contain absolute path.
Comment 10 Jaroslav Tulach 2013-04-12 12:26:20 UTC
At the moment of hitting the brkpoint the System.getProperty("netbeans.home") is:

"/home/jarda/tmp/208749/relocateApp/ic/ic/platform"

while the netbeans.dirs contain:

"./ic/bin/../platform"
"./ic/bin/../iconchange"

means the platform cluster is there twice. It should not - at least in case of NetBeans IDE, platform cluster is not listed in netbeans.dirs.
Comment 11 Jaroslav Tulach 2013-04-12 13:15:38 UTC
I believe this is flaw of launcher. When I check (for example in org.netbeans.MainImpl's append_jars_to_cp), all the paths are absolute. However in case of here in provided application they are relative.

Can the application launcher be updated to use absolute, normalized paths as well?
Comment 12 Jiri Rechtacek 2013-04-15 12:40:32 UTC
http://hg.netbeans.org/core-main/rev/0a3aa741beb4
Comment 13 Quality Engineering 2013-04-18 02:20:51 UTC
Integrated into 'main-golden', will be available in build *201304172301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0a3aa741beb4
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #208749 - Module system caches use absolute paths
Comment 14 Jaroslav Tulach 2013-06-03 12:14:15 UTC
*** Bug 227219 has been marked as a duplicate of this bug. ***
Comment 15 mdobacz 2013-08-10 08:02:54 UTC
Moving the installation worked for me using the latest dev build of NBP, thanks!

Is any reasonable workaround possible when still using NBP 7.3.1 ?