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 153799 - java.util.concurrent.ExecutionException: java.lang.NullPointerException
Summary: java.util.concurrent.ExecutionException: java.lang.NullPointerException
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Plugin Manager (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: dlipin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-24 18:15 UTC by Michel Graciano
Modified: 2009-02-19 20:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NBMs and update.xml example files (164.81 KB, application/x-gzip)
2008-11-24 18:32 UTC, Michel Graciano
Details
A non broken UC... (116.56 KB, text/plain)
2008-11-24 19:40 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2008-11-24 18:15:09 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-8-generic, i386
User comments: 
STACKTRACE: (first 10 lines)
java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
        at java.util.concurrent.FutureTask.get(FutureTask.java:83)
        at org.netbeans.modules.autoupdate.services.InstallSupportImpl.doDownload(InstallSupportImpl.java:193)
        at org.netbeans.api.autoupdate.InstallSupport.doDownload(InstallSupport.java:95)
        at org.netbeans.modules.autoupdate.ui.wizards.InstallStep.tryPerformDownload(InstallStep.java:317)
        at org.netbeans.modules.autoupdate.ui.wizards.InstallStep.handleDownload(InstallStep.java:218)
        at org.netbeans.modules.autoupdate.ui.wizards.InstallStep.doDownloadAndVerificationAndInstall(InstallStep.java:191)
        at org.netbeans.modules.autoupdate.ui.wizards.InstallStep.access$200(InstallStep.java:106)
        at org.netbeans.modules.autoupdate.ui.wizards.InstallStep$.run(InstallStep.java:183)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
Comment 1 Michel Graciano 2008-11-24 18:32:31 UTC
Created attachment 74096 [details]
NBMs and update.xml example files
Comment 2 Michel Graciano 2008-11-24 18:39:35 UTC
I created a private UC to manage the plugins we usually use in our environment. My idea is to use a file:// update
center like:
file:////home/hmichel/updates_nb/updates.xml
where updates.xml is attached in this issue. I just uploaded public plugins, but I can reproduce it here with these
ones. The problem happens when I try to get more than one plugin. The basic use case is install all of them. If I try to
get just one of these, no exception is thrown.
Steps to reproduce:
1-Open the IDE and create a new UC point to updates.xml file attached;
2-Reload catalog and try to install all the plugins for this UC
3-A exception should be thrown.

For stable release, just a small icon on right bottom corner is shown. I did something wrong or there is any workaround?
Comment 3 Michel Graciano 2008-11-24 19:40:42 UTC
Created attachment 74098 [details]
A non broken UC...
Comment 4 Michel Graciano 2008-11-24 20:06:53 UTC
The last UC xml uploaded solve the problem but I have no idea why. The first one I edited by hand, the last I create by
ant task at my suite module.
Comment 5 dlipin 2008-11-25 16:19:38 UTC
Michel,

I`m not yet familiar with the module system, but if you validate the updates.xml from the first attachment (e.g. with 
help of NetBeans IDE), you`ll see that it does not follow the current DTD
http://www.netbeans.org/dtds/autoupdate-catalog-2_5.dtd

I can also think of the Issue 142205 - maybe it is related.


Comment 6 Michel Graciano 2008-11-25 17:07:56 UTC
You can just remove 'OpenIDE-Module-Build-Version="080305"' and will see that the problem continues... even here.
Comment 7 dlipin 2008-11-25 18:19:53 UTC
Another problematic code that I see that distribution attribute equals to empty string (distribution="") for 
br.com.michaelnascimento.hints and net.java.dev.thinnb modules

Jirka, could you please suggest on how we should handle such modules? 
Should we just hide it from the Plugins dialog? or something else? 
At which point we should filter out such modules?
Thanks in advance, Dmitry.
Comment 8 Jiri Rechtacek 2008-11-26 10:01:59 UTC
I guess it's worthless fixing this. The attached catalog updates.xml contains invalid values (empty distribution
attribute) and Autoupdate cannot work with that correctly. But all 'officially' subscribed Update Centers are regularly
tested to catch problem like this and problematic content must be fixed on server side.
hmichel, please fix br.com.michaelnascimento.hints and net.java.dev.thinnb and then it will work for you.
Comment 9 dlipin 2008-11-26 10:10:10 UTC
Just to note: having empty "distribution" attribution is valid from DTD point of view.
Comment 10 Michel Graciano 2008-11-26 11:10:32 UTC
I don't agree with you about the issue resolution. IMO the DTD should be changed to validate this or, the autoupdate
module should advise about the problem. How could users know that this is the problem? The tool should say it to me. I
will wait your comment until reopen it.

Regards
Comment 11 Jiri Rechtacek 2008-11-26 12:54:19 UTC
> ------- Additional comments from hmichel@netbeans.org Wed Nov 26 11:10:32 +0000 2008 -------
> I don't agree with you about the issue resolution. IMO the DTD should be changed to validate this or
Right. I agree.
> , the autoupdate
> module should advise about the problem. How could users know that this is the problem? The tool should say it to me. I
I see what you say but consider that the intention of Autoupdate/Plugin Manager is not testing 3rd parties setup. I
would be better make a UC test tool to catching such problems.
> will wait your comment until reopen it.
Please don't.
Anyway. in that case ifsomeone will fix it, add try&catch that statement and use report
err.log (Level.INFO, <localized message of the problem>);
throw new OperationException (OperationException.ERROR_TYPE.INSTALL,  <localized message of the problem>);
Comment 12 dlipin 2008-11-26 13:24:46 UTC
Proposed fix InstallSupportImpl, line 668):

if(source==null) {
    final String errorString = "Source URL for " + toUpdateImpl.getCodeName () + " is null, most likely distribution 
attribute is set to the empty string in the UC catalog.\n" +
                    "See also http://www.netbeans.org/issues/show_bug.cgi?id=153799 for more details";
    err.log (Level.INFO, errorString );
    throw new OperationException (OperationException.ERROR_TYPE.INSTALL, errorString);
}

OK ? 
Comment 13 Jiri Rechtacek 2008-11-26 13:28:31 UTC
Looks good. IMHO the best would be using NbBundle for the error message rather than hardcoded message. Thanks
Comment 14 dlipin 2008-11-26 13:43:54 UTC
reopen to fix..
Comment 15 dlipin 2008-11-26 13:48:23 UTC
Jirka, thanks for suggestion! Fixed.
http://hg.netbeans.org/core-main/rev/b60d1779a782
Comment 16 Michel Graciano 2008-11-26 15:08:04 UTC
Much better now. BTW, I am not talking about just UC provided by NB, if you don't want to take care about it, this kind
of thing _never_ should be public. And we can't forget NB Platform application which uses UC for updates and so on.
Beside that, I think now we have a good patch.

Thanks.
Comment 17 Quality Engineering 2008-11-27 05:32:33 UTC
Integrated into 'main-golden', will be available in build *200811270201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b60d1779a782
User: Dmitry Lipin <dlipin@netbeans.org>
Log: Issue #153799 java.util.concurrent.ExecutionException: java.lang.NullPointerException
Comment 18 kaa 2008-12-18 14:09:04 UTC
Product Version: NetBeans IDE Dev (Build 200812180001)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)

No exceptions were thrown:
I Used locale UC with xml file described above.