This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 216539 - DTViewRoot refresh task executed when it shouldn't be.
Summary: DTViewRoot refresh task executed when it shouldn't be.
Status: VERIFIED FIXED
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Cameron Bateman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-25 00:18 EST by Cameron Bateman CLA
Modified: 2008-04-08 13:15 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Bateman CLA 2008-01-25 00:18:31 EST
Found by Neil Hauge.  Results in logged NPE below.  This task should only run against JSF view files (JSPs and later on XHTMLs) and only when a design time component tree is requested.

java.lang.NullPointerException
    at
org.eclipse.jst.jsf.designtime.internal.view.XMLComponentTreeConstructionStrategy.createComponentTree(XMLComponentTreeConstructionStrategy.java:46)
    at
org.eclipse.jst.jsf.designtime.internal.view.DefaultDTUIViewRoot$RefreshTreeJob.run(DefaultDTUIViewRoot.java:138)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Amy Wu CLA 2008-01-25 17:07:42 EST
I came across this error when I was editting in the WSDL editor and the JSF Component Tree view was up.  Is this the same issue or should I open another bug?

!ENTRY org.eclipse.ui.workbench 4 2 2008-01-25 16:38:12.421
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jst.jsf.designtime.internal.view.AbstractDTViewHandler.getWebContentPath(AbstractDTViewHandler.java:77)
	at org.eclipse.jst.jsf.designtime.internal.view.AbstractDTViewHandler.getViewId(AbstractDTViewHandler.java:63)
	at org.eclipse.jst.jsf.designtime.context.DTFacesContext.getViewRoot(DTFacesContext.java:102)
	at org.eclipse.jst.jsf.ui.internal.component.DTJSFViewModel.init(DTJSFViewModel.java:72)
	at org.eclipse.jst.jsf.ui.internal.component.ComponentTreeView$ComponentPage.createControl(ComponentTreeView.java:235)
	at org.eclipse.jst.jsf.ui.internal.component.ComponentTreeView.doCreatePage(ComponentTreeView.java:164)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:399)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:741)
	at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)
Comment 2 Cameron Bateman CLA 2008-01-25 17:30:17 EST
Interesting.  The issue is caused by the same root cause: the view is updating it's page for a document it shouldn't (it should only react if a JSF source file editor is activated) and it is not ensure the project has a JSF facet when it does so.

Does the project you found this in have a dynamic web facet?  Does the problem occur if the Component Tree View is not open?


(In reply to comment #1)
> I came across this error when I was editting in the WSDL editor and the JSF
> Component Tree view was up.  Is this the same issue or should I open another
> bug?

Comment 3 Amy Wu CLA 2008-01-25 19:43:17 EST
(In reply to comment #2)
> Does the project you found this in have a dynamic web facet?  Does the problem
> occur if the Component Tree View is not open?

No, it was just a general/simple project. And no, I haven't seen it happen after I closed the view.
Comment 4 Neil Hauge CLA 2008-01-28 15:51:01 EST
A little more info on this.  When I created my test JPA Project, I noticed that the JSF Component Tree view was open.  I didn't have a JSF facet in the project as it was strictly a JPA project.  When I close this view the errors do stop occurring.

I just created a new workspace and I see that the JSF Component Tree view is visible in the default Java perspective (prior to any project creation).  So this is part of what makes the bug visible to someone who is not using the JSF functionality.
Comment 5 Cameron Bateman CLA 2008-01-28 16:35:13 EST
Neil, thanks for your diligence in characterizing the bug.  I hadn't realized that I had included a perspective extension with the view (it was generated by the wizard when I did my original prototype).  The view was never meant to be seen unless a user or adopter enables it.  Per https://bugs.eclipse.org/bugs/show_bug.cgi?id=216708, I have removed the perspective extension, so the view should stop appearing in new workspaces.  This change will appear in this week's I-build.

I have also added new logic to address the resulting problem of the update job running when it's not supposed to.  This should be in either this or next week's I-build.

(In reply to comment #4)
> A little more info on this.  When I created my test JPA Project, I noticed that
> the JSF Component Tree view was open.  I didn't have a JSF facet in the project
> as it was strictly a JPA project.  When I close this view the errors do stop
> occurring.
> I just created a new workspace and I see that the JSF Component Tree view is
> visible in the default Java perspective (prior to any project creation).  So
> this is part of what makes the bug visible to someone who is not using the JSF
> functionality.

Comment 6 Cameron Bateman CLA 2008-04-03 14:39:27 EDT
Fixed.
Comment 7 Cameron Bateman CLA 2008-04-08 13:15:43 EDT
Verfied in M6.