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 232119 - Webstart and update center problems
Summary: Webstart and update center problems
Status: RESOLVED DUPLICATE of bug 35036
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-02 01:06 UTC by pjdm
Modified: 2013-07-08 10:32 UTC (History)
1 user (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 pjdm 2013-07-02 01:06:11 UTC
The steps below use an update center in a webstarted platform application. I couldn't find anything stating that this combination is or isn't supported. We have an application that is started using webstart, and we'd like to let users selectively add functionality by adding modules from different update centers. 

A definitive statement on whether this is supported would be appreciated.

Summary: a simple (empty) module isn't updated from a webstarted application; by adding a dialog box to the module, a NullPointerException is thrown in autoupdate services.

Steps to reproduce:

- Start a Tomcat instance.

- Create a new Platform Application project called base. Right-click on the project,
Properties -> Libraries; in the platform module include "Auto Update Services"
and "Auto Update UI".

- Add a new module called basemodule to the base project.

- Right-click on the project, JNLP -> Build.

- Copy base/dist/base.war to $CATALINA_HOME/webapps and allow Tomcat to deploy it.

- Create a new Module Suite project called addon. Add a module called module1.

- Right-click on the addon project, Package as -> NBMs.

- Copy the contents of addon/build/updates to $CATALINA_HOME/webapps/static.
(Create the static directory if it doesn't exist.)

- In a web browser, go to http://localhost:8080/static/updates.xml to ensure
that the update center is readable.

- Run the base application from webstart:
  javaws http://localhost:8080/base/master.jnlp

- In the application use Tools -> Plugins -> Settings to add the update
center "http://localhost:8080/static/updates.xml". The module1 plugin should immediately
become available.

- Install the module1 plugin.

- Back in NetBeans, right-click on module1 Properties -> API Versioning
and change the Specification Version from "1.0" to "1.1".

- Right-click on the addon project, Package as NBMs.

- Replace the contents of $CATALINA_HOME/webapps/static with the contents
of addon/build/updates.

- In the running application, use Tools -> Plugins -> Updates and select
"Check for Updates" (note that version 1.1 is available), then Update.
After the dialog boxes, restart now.

- Since the app is webstarted, it won't restart, so use javaws to run the
app again.

- Tools -> Plugins -> Installed will show version 1.0 still installed. Updates
will show version 1.1 still available.

- In module1, use the New Action wizard to create an always enabled action. Use the defaults,
with "Some action" for the label.

- In the actions actionPerformed() method, add the statement

        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("Addon action"));

This requires adding a dependency on Dialogs API and adding imports.

- Update module1's API version to 1.3.

- Right-click on the addon project, Package as NBMs.

- Replace the contents of $CATALINA_HOME/webapps/static with the contents
of addon/build/updates.

- In the running application, use Tools -> Plugins -> Updates and select
"Check for Updates" (note that version 1.3 is available). An error indicator
has appeared in the application's status bar. Close the Plugins dialog and look at the error.

java.lang.NullPointerException
	at org.netbeans.modules.autoupdate.services.ModuleUpdateElementImpl.findInstallationCluster(ModuleUpdateElementImpl.java:312)
	at org.netbeans.modules.autoupdate.services.ModuleUpdateElementImpl.getInstallationCluster(ModuleUpdateElementImpl.java:289)
	at org.netbeans.modules.autoupdate.services.UpdateManagerImpl$Cache.createMaps(UpdateManagerImpl.java:346)
	at org.netbeans.modules.autoupdate.services.UpdateManagerImpl$Cache.getAvailableEagers(UpdateManagerImpl.java:275)
	at org.netbeans.modules.autoupdate.services.UpdateManagerImpl.getAvailableEagers(UpdateManagerImpl.java:108)
	at org.netbeans.modules.autoupdate.services.OperationContainerImpl.listAllWithPossibleEager(OperationContainerImpl.java:235)
	at org.netbeans.api.autoupdate.OperationContainer.listAll(OperationContainer.java:346)
	at org.netbeans.modules.autoupdate.ui.UpdateTableModel.getDownloadSize(UpdateTableModel.java:219)
	at org.netbeans.modules.autoupdate.ui.UnitTab$8.run(UnitTab.java:386)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
Comment 1 Jiri Rechtacek 2013-07-03 08:55:31 UTC
http://hg.netbeans.org/core-main/rev/341f0537cb84
Comment 2 pjdm 2013-07-03 09:29:53 UTC
Does this also fix the part of the problem where the newer module doesn't throw an exception, but doesn't get installed?
Comment 3 Quality Engineering 2013-07-04 02:21:26 UTC
Integrated into 'main-silver', will be available in build *201307032300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/341f0537cb84
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #232119: NullPointerException at org.netbeans.modules.autoupdate.services.ModuleUpdateElementImpl.findInstallationCluster
Comment 4 pjdm 2013-07-05 11:48:39 UTC
Tested with trunk-nightly-201307042300.

Module v1.1 does not get installed over v1.0. After restarting the application, v10 is still the installed version and v1.1 is still available.
Comment 5 Jiri Rechtacek 2013-07-07 13:23:53 UTC
(In reply to comment #2)
> Does this also fix the part of the problem where the newer module doesn't throw
> an exception, but doesn't get installed?

Well, using Autoupdate Services in JNLP-based applications is not supported. You cannot mix AU and JNLP. The platform in JNLP mode does not use clusters in the usual way at all. You need to either provide all desired modules over JNLP (you could in principle offer a servlet-based .jnlp which lets users customize what they get), or offer a regular AU-based build.

*** This bug has been marked as a duplicate of bug 35036 ***
Comment 6 pjdm 2013-07-08 10:32:51 UTC
Fair enough. Is "JNLP implies no autoupdate" documented somewhere that I could have discovered (apart from bug reports)?

Should autoupdate provide an informative message when used in a webstarted application, rather than just silently not working?