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.
Summary: | Exception on the first run of a Java application | ||
---|---|---|---|
Product: | ide | Reporter: | Petr Jiricka <pjiricka> |
Component: | Extbrowser | Assignee: | Denis Anisimov <ads> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dkonecny |
Priority: | P3 | ||
Version: | 7.2 | ||
Hardware: | PC | ||
OS: | Mac OS X | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Exception in output window |
The workaround is to go system options dialog and cancel it - after that the browser is called. After debugging this, what happens is the following: - In the getFactories method, getConfigFolder returns Services/Browsers, i.e. non-null - It has 10 children as expected - When iterating over the children, HtmlBrowser.Factory fact is correctly initialized - BUT then, the lookupItem method returns null BTW, why is this call in every iteration of the loop? Lookup.getDefault ().lookupAll(HtmlBrowser.Factory.class); Wouldn't it be enough to do it just once? Making the following change as suggested by Denis off-line, helps, and fixes the problem: --- a/web.browser.api/src/org/netbeans/modules/web/browser/api/WebBrowsers.java +++ b/web.browser.api/src/org/netbeans/modules/web/browser/api/WebBrowsers.java @@ -185,6 +185,7 @@ } private List<WebBrowserFactoryDescriptor> getFactories() { + IDESettings.getWWWBrowser(); List<WebBrowserFactoryDescriptor> browsers = new ArrayList<WebBrowserFactoryDescriptor>(); FileObject servicesBrowsers = getConfigFolder(); if (servicesBrowsers == null) { Sorry, in the meantime I fixed it differently as suddenly I bumped into the same problem. Denis's suggestion would work as well. My fixes forces items out of the lookup - there must be some optimalization in lookup to not create items unless somebody does something with them. 84d36ee633ae Integrated into 'main-golden', will be available in build *201209031048* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/84d36ee633ae User: David Konecny <dkonecny@netbeans.org> Log: #209616 - Exception on the first run of a Java application |
Created attachment 116764 [details] Exception in output window Easel build #134, Mac OS X 10.7.3, JDK "1.6.0_29" When running a Java web application for the first time, I am getting the attached exception in the output window. My web browser in IDE options is set to System Default, and my system default browser is Chrome.