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 25781 - File netbeans/beans/TimerBean.Jar does not exist when installed from NBM
Summary: File netbeans/beans/TimerBean.Jar does not exist when installed from NBM
Status: RESOLVED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Tomas Pavek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-18 15:22 UTC by rbalada
Modified: 2002-07-24 05:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rbalada 2002-07-18 15:22:36 UTC
NetBeans 3.4 RC1 displays warning dialog that file
"${netbeans.home}/beans/TimerBean.jar does not
exist" after installation of usersguide from NBM.

steps to reproduce:
 - compile NetBeans from release34 branch
(Platform + autoupdate)
    by command `ant -Dmodules=autoupdate`.
 - run the IDE
 - in Tool - Options create new Update (centre) type
 - edit URL of new Update type and put there
  
http://www.netbeans.org/updates/alpha/release34_alpha_daily.xml
 - connect to the new update centre and download
usersguide.nbm
    (documentation)
 - restart the IDE

I found, that I don't miss the TimerBean.jar, but
it's in different location (userdir vs.
netbeans.home) than it's expected to be.

See
usersguide/src/org/netbeans/modules/userguide/UGModule.java:103

The NBM was installed to userdir by default. This
problem could be resolved by setting userguide.nbm
to be system-wide module (I don't know if it's
feasible).
Comment 1 rbalada 2002-07-19 09:52:01 UTC
I asked Ales Kemr about details how to set NBM to be global as default
state and I was told that the module must have bin or lib directory
(system-wide directories). Strange logic, but usually working.
Simple quick solution could be to create directory bin or lib and to
touch some file like ".ignoreme" during "netbeans" target run.
Comment 2 Jesse Glick 2002-07-19 15:35:19 UTC
tpavek's code in UGModule.java 1.20 should have checked for
netbeans.user as well as netbeans.home.
Comment 3 Jesse Glick 2002-07-22 10:03:42 UTC
Tomas could you perhaps fix this? I am at OSCON and doubt I would have
time to fix, test, and merge it before RC1. Basically in
UGModule.createTimerBeanFS:

File timerBeanJarFile = new File(homedir+"/beans", "TimerBean.jar");

I suggest to add after that line:

if (!timerBeanJarFile.exists()) {
    timerBeanJarFile = new File(System.getProperty("netbeans.user",
"dummy") + "/beans", "TimerBean.jar");
}
if (!timerBeanJarFile.exists()) {
    return null;
}

Actually slightly more accurate is to prefer the netbeans.user version
to the netbeans.home version in case both exist, just in case the user
installed a local NBM to override an older global version.

Also appending "/beans" to the filename is a poor idea; it might work
on Windows but I would not expect it to work on all non-Unix
platforms. Use:

new File(new File(homeOrUserDir, "beans"), "TimerBean.jar")
Comment 4 Marek Grummich 2002-07-22 11:46:56 UTC
Set target milestone to TBD
Comment 5 Marek Grummich 2002-07-22 11:50:01 UTC
Set target milestone to TBD
Comment 6 Tomas Pavek 2002-07-22 15:56:19 UTC
Okay, done for trunk. Should work now.
BTW should not be the TimerBean removed completely - as the only
example that used it (ClockFrame) was removed too (because "... we
have too many examples")?

Diff:
http://usersguide.netbeans.org/source/browse/usersguide/src/org/netbeans/modules/usersguide/UGModule.java.diff?r1=1.21&r2=1.22


Jesse, could you review it?

Comment 7 Tomas Pavek 2002-07-22 18:08:33 UTC
Removing dependency on issue 18312 - the same problem would appear if
the Timer bean stayed in form module.
Comment 8 Jesse Glick 2002-07-22 18:52:00 UTC
Diff looks OK to me. As I say, technically correct is to use userdir's
TB.jar in preference to global TB.jar but this is really trivial.

I agree that if the Clock example was removed anyway, the
TimerBean.jar is pretty useless and could just be removed. Do you have
time to prepare a patch for that too? Would consist of (1) commenting
out createTimerBeanFS, (2) commenting out mount in UG's layer.xml, (3)
commenting out 'release' target in UG's build.xml.
Comment 9 Tomas Pavek 2002-07-23 09:10:34 UTC
> As I say, technically correct is to use userdir's
> TB.jar in preference to global TB.jar ...

Right, but this would require to remove one (the last 
remaining) "timerbean" hack from the form editor. I've 
just discovered it is still there, however it could be 
most probably removed (it's for importing from some very 
old version), but as it does no harm, I'd let it be - it's 
a bit late now for such change (RC1 comes tomorrow). The 
same reason for removing the timerbean completely... We 
woud have to test also e.g. importing from earlier 
versions where the ClockFrame was present. So I will just 
apply the patch from trunk and will do the complete 
removal for 4.0.
Comment 10 Tomas Pavek 2002-07-23 18:35:54 UTC
Integrated in release34.
Comment 11 Jesse Glick 2002-07-24 05:51:39 UTC
OK, don't know what this TB hack is, but you would know better...