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.
Create new WebApplication (tomcat or glassfish) invoke run project invoke view servlet on index.jsp NPE is thrown and no code is open in the ditor
Created attachment 71853 [details] stacktrace
Created attachment 71854 [details] logfile
Reproduced.
Jindro, is this a recent regression? Did this work on Oct 9? I suspect this could be related to the fix of issue 149330. Also cc'ing Jarda.
The NPE is caused by more strict enforcing of the API contract. Some CloneableEditorSupport.Env.getTime() implementation returns null which was never allowed. So the bug belongs to the Env provider. On the other hand, this is an incompatible change in behaviour in openide.text. However it is needed to prevent data loss while editing. What could potentially be done is to print huge warning inspite of generating NPE, but still this needs fix in the Env provider.
Reproducible in #200810150101 but cannot reproduce in #200810090201.
Taking over upon request from pjiricka
Fixed in trunk, http://hg.netbeans.org/main/rev/c9e40f248252
Thanks many times, Tomasz! Petre P and Jarda, can you please review Tomasz's fix? My comments on the patch: I see that the default implementation in DataEditorSupport is: public Date getTime() { // #32777 - refresh file object and return always the actual time getFileImpl().refresh(false); return getFileImpl ().lastModified (); } which quite matches Tomasz's approach. One question I have is - when will this method be called, and how often? I believe that the call of getServlet() can be quite slow, so I am not sure if something could get slower by this fix. Allowing to return null from getTime() would make the implementation faster. One scenario that should be verified by QE: 1. run the page 2. open the servlet 3. modify the page and re-run it -> will the servlet be correctly reloaded in the editor?
Patch is OK, thanks for creating it so quickly. PS: Slowness should not be problem, moreover definitely not P1 problem.
Shouldn't be there the refreshing file as well ? --- a/web.core/src/org/netbeans/modules/web/core/jsploader/ServletEditor.java Wed Oct 15 10:24:14 2008 -0700 +++ b/web.core/src/org/netbeans/modules/web/core/jsploader/ServletEditor.java Wed Oct 15 19:33:13 2008 +0200 @@ -511,6 +511,7 @@ public Date getTime () { DataObject servlet = getServlet(); if (servlet != null) + servlet.getPrimaryFile().refresh(false); return servlet.getPrimaryFile().lastModified(); else return new Date(System.currentTimeMillis());
I believe the getServlet() method does refresh internally, but I am not sure.
Verified in: Hudson > trunk > #4068 by QE.
Integrated into 'main-golden', will be available in build *200810160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c9e40f248252 User: Tomasz Slota <tslota@netbeans.org> Log: #150220: View servlet action doesn't work
Tomasz, can you please push the fix in release65 clone and send the e-mail to reviewers? Thanks
Fix integrated into the HR branch http://hg.netbeans.org/release65/rev/ea0091e07925
verified in m1. NetBeans IDE 6.5 RC1 (Build 200810171318)