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 181635 - Registration JavaDB while installing NetBeans
Summary: Registration JavaDB while installing NetBeans
Status: RESOLVED FIXED
Alias: None
Product: installer
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: dlipin
URL:
Keywords:
Depends on:
Blocks: 152889 178802
  Show dependency tree
 
Reported: 2010-03-08 09:00 UTC by Jiri Rechtacek
Modified: 2010-03-17 13:02 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
a proposed implementation in IDE side (10.48 KB, patch)
2010-03-12 12:52 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Rechtacek 2010-03-08 09:00:36 UTC
NetBeans users on Mac complain problems running JavaDB on theirs configuration. Once they install the "All" distro of NetBeans (that ships with v3, which includes javadb) they can't start javadb.
We need a JavDB registration like recommends issue 179249.
Draft of main class:
org.netbeans.modules.derby.DerbyRegistration.main() where cluster path and JavaDB home expected
JavaDB home is
1) JavaDB home if available in JDK i.e. $JDK_HOME/db
2) JavaDB in co-bundled Glassfish
3) or null if no JavaDB available

Is it possible? Does it make sense?
Thanks
Comment 1 dlipin 2010-03-09 07:14:25 UTC
How does Mac OS differ from other platforms in this way?
I.e. is this issue reproducible only on Mac and why, if so?

Isn`t it fixed in http://hg.netbeans.org/core-main/rev/ed84ff1edba1?
If not why it can`t be fixed on the derby plugin`s side?
Comment 2 Jiri Rechtacek 2010-03-09 07:31:48 UTC
Quoted from off-line thread:
> How does Mac OS differ from other platforms in this way?
> I.e. is this issue reproducible only on Mac and why, if so?
JDK on MacOS doesn't contain Derby on default place.

> Isn`t it fixed in http://hg.netbeans.org/core-main/rev/ed84ff1edba1?
No, it didn't solve this problem. That change helps non-java users (PHP/Ruby/CND) to use JavaDB. But the JavaDB registration problem left as same as before. 

> If not why it can`t be fixed on the derby plugin`s side?
Derby support doesn't know anything about possible registration JavaDB in Glassfish. Other problem is a bad performance if Derby side seeks for user's installation JavaDB and Glassfish (issue 152889, issue 179838)
Comment 3 dlipin 2010-03-09 07:36:59 UTC
BTW, is DerbyRegistration class already in *main repositories?
I don`t see it in
http://hg.netbeans.org/core-main/file/tip/derby/src/org/netbeans/modules/derby/

What should be in classpath to run this class?

Is it OK if both 1) and 2) will invoke registration during installation?
In other words, if GlassFish v3 is installed and, say, we are on Windows, both $JDK/db and $Glassfish/javadb will be registered using DerbyRegistration.main()?
It will make installation logic simpler due to less conditions.

Which file(s) are created when running DerbyRegistration.main() ? I need that info since those files should be removed during uninstallation (we remove certain files during uninstallation rather than delete whole NB directory recursively).
Comment 4 Jiri Rechtacek 2010-03-09 07:50:48 UTC
> BTW, is DerbyRegistration class already in *main repositories?
> I don`t see it in
> http://hg.netbeans.org/core-main/file/tip/derby/src/org/netbeans/modules/derby/
No, there is no such file. I'll create it.

> What should be in classpath to run this class?
Will be documented.

> Is it OK if both 1) and 2) will invoke registration during installation?
> In other words, if GlassFish v3 is installed and, say, we are on Windows, both
> $JDK/db and $Glassfish/javadb will be registered using
> DerbyRegistration.main()?
JDK installation has precedence (at least, in the previous releases Derby support in IDE uses Derby from JDK if any, if not then use Derby from GF). For sure, I'm going to consult with Vince K. from GF team.

> It will make installation logic simpler due to less conditions.
No problem, our registration logic can handle it.

> Which file(s) are created when running DerbyRegistration.main() ? I need that
> info since those files should be removed during uninstallation (we remove
> certain files during uninstallation rather than delete whole NB directory
> recursively).
Will be documented.

I prepare a patch and attach here for review.
Thanks.
Comment 5 Jiri Rechtacek 2010-03-10 08:46:13 UTC
Assigned to myself unless I attach mu side for review.
Comment 6 Jiri Rechtacek 2010-03-12 12:52:26 UTC
Created attachment 95110 [details]
a proposed implementation in IDE side
Comment 7 Jiri Rechtacek 2010-03-12 13:01:24 UTC
Dima, please review the DerbyRegistration file. Installer can call it multiple times. The only first invocation will be stored.

The invocation looks like: org.netbeans.modules.derby.DerbyRegistration <cluster> <derby_installation_path> i.e. DerbyRegistration ./nb /tmp/glassfish/javadb/

DerbyRegistration creates <IDE_home>/<cluster>/config/JavaDB/registration_instance and <IDE_home>/<cluster>/config/JavaDB/.nbattrs which should be removed during uninstallation.

Any comments? If not, I'm going to push it early the next week. Thank you
Comment 8 dlipin 2010-03-15 13:23:45 UTC
Patch looks fine for me.

BTW, I don`t have $JDK_HOME/db on Windows as JavaDB is installed by default at %PROGAMFILES\Sun\JavaDB. So the very first point ("JavaDB home if available in JDK i.e. $JDK_HOME/db") does not work well on Windows...
Comment 9 Jiri Rechtacek 2010-03-15 14:27:01 UTC
Dima, thanks for review - IDE side was integrated in core-main/rev/220460279b38
I have realized Windows JDK installer installs Derby %PROGAMFILES\Sun\JavaDB, instead of $JDK_HOME/db too. So, +1 to register Derby by NBI rather then finding generic location in IDE. Please, let me know when done NBI side of this. Thanks
Comment 10 Quality Engineering 2010-03-16 05:19:09 UTC
Integrated into 'main-golden', will be available in build *201003160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/220460279b38
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #181635: IDE side of registration JavaDB while installing NetBeans
Comment 11 dlipin 2010-03-16 21:52:28 UTC
main #89736d6ef9c6
Comment 12 dlipin 2010-03-17 12:58:51 UTC
BTW, does JavaDB auto-registration still works in pure IDE?
If not then that would be the regression for those who use distributions other than installer - zips, Linux/Solaris native packages, etc.