Bug 130571 - [Contributions] 3.2M5A Problem Associating Team Provider with Project
Summary: [Contributions] 3.2M5A Problem Associating Team Provider with Project
Status: CLOSED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 1.5 M6   Edit
Assignee: John Lanuti CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
: 130893 133300 133685 135728 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-06 11:23 EST by Mark Phippard CLA
Modified: 2007-01-03 11:44 EST (History)
16 users (show)

See Also:


Attachments
Subclipse plugin.xml (45.29 KB, text/plain)
2006-03-06 11:24 EST, Mark Phippard CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Phippard CLA 2006-03-06 11:23:28 EST
I have no idea where this bug belongs, so it might need to be reclassified.

With plain 3.2 M5 or M5A and the latest version of Subclipse (0.9.108) everything works fine.

With 3.2M5A and then install WTP 1.5 and its requisites, it stops working.  When right-clicking on existing projects in workspace, the Team menu only has the Apply Patch option.  When checking out a new project, the same happens.

Eclipse clearly knows the project is under source control as the decorators are still there, and the Share Project option is disabled, but the rest of the menu options are not there.  If you drop into the folders and files, the options are all there.

There is nothing in the error log.

This would seem to point to WTP, except I would assume that an unrelated plugin should not be able to affect the relationship between other plugins.  In my example, I am using plain Java projects.

The CVS plugin does not appear to be suffering from the same problems.
Comment 1 Mark Phippard CLA 2006-03-06 11:24:48 EST
Created attachment 35764 [details]
Subclipse plugin.xml

Here is the plugin.xml for the Subclipse UI plugin.  Perhaps you can spot incorrect or outdated techniques for attaching our menu options.
Comment 2 Mark Phippard CLA 2006-03-06 12:46:46 EST
Subclipse has a method which is using Internal Eclipse classes (because we could find no other way).  This would have been compiled against Eclipse 3.0.  Could this be the cause of the problem?  I have no reason to believe so, other than I know that using internal code is always dangerous.

	/**
	 * Return the resource type (FILE, FOLDER, PROJECT) of the resource specified by an absolute filesystem path
	 * @param a resource path relative to workspace root as returned by pathForLocation()
	 * @return IResource.FILE, IResource.FOLDER, IResource.PROJECT or IResource.ROOT or 0 if it could not be determined
	 */
	public static int getResourceType(IPath aResourcePath)
	{
		if (aResourcePath == null) return 0;
		//TODO This code is using eclipse internal classes !		
		ResourceInfo resourceInfo = ((Workspace) ResourcesPlugin.getWorkspace()).getResourceInfo(aResourcePath, true, false);
		return (resourceInfo != null) ? resourceInfo.getType() : 0;
	}
Comment 3 John Arthorne CLA 2006-03-06 13:50:14 EST
Hmm, I don't see the problem at first glance.  In what view are you selecting resources - Package Explorer, Navigator, or other view?

The API equivalent of the internal code in comment #2 is somehting like:

IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(resourcePath);
return r == null ? 0 : r.getType();
Comment 4 John Arthorne CLA 2006-03-06 13:50:36 EST
Michael, CCing you because it may be related to resource mapping work.
Comment 5 Mark Phippard CLA 2006-03-06 14:03:24 EST
Thanks for the API code.  I will make that change if nothing else.

I saw this problem in all views I checked, which were the Package Explorer and Navigator.

OK, here is another weird symptom.  If the Resource or Java perspective is the active perspective when I restart, I see this problem.  If I change to the J2EE Perspective from WTP, I then can see the menu in all views.  Again, these are just Java Projects.

I know the person who reported this to me is on the CC list.  Maybe he can comment if he observes this same behavior.  I was under the impression he was working from WTP, but maybe not?

Finally, once the menu is enabled, I notice there are two Disconnect ... options and one of them is disabled.  Perhaps another clue, perhaps not?


Comment 6 Michael Valenta CLA 2006-03-06 14:05:53 EST
Are there any errors in your log file?
Comment 7 Mark Phippard CLA 2006-03-06 14:11:06 EST
I do not have any when I create the problem, so let's say No.

The person who reported it to me reported seeing this in his log:

"!MESSAGE Could not instantiate provider org.tigris.subversion.subclipse.core.svnnature for project com.robco.Acme.
org.eclipse.team.core.TeamException: Could not instantiate provider org.tigris.subversion.subclipse.core.svnnature for project com.robco.Acme. "

But we were looking at this after the fact, so maybe this came at a different time.  I get the same problem as he does and I do not see this message.

Comment 8 John Arthorne CLA 2006-03-06 14:11:47 EST
Another question for the originator is what build of WTP is being used.  WTP 1.5 is reported, but that won't be available until June 2006.  It's possible he's using a build of WTP that just doesn't work against 3.2 M5a.
Comment 9 Mark Phippard CLA 2006-03-06 14:14:12 EST
I think we are both using what they are calling 1.5 on the download page.  My reported version for JST is 1.0.1.v200602280450--tToQFPPrF and for WST is 1.0.1.v200603022200-0fxbsWqriW.

I download this AM from:

http://download.eclipse.org/webtools/downloads/drops/S-1.5M5-200603022222/
Comment 10 Rob Williams CLA 2006-03-06 14:16:01 EST
1.5M5 is what they are calling it, and the download page for it shows M5a as the eclipse build to use.
Comment 11 Mark Phippard CLA 2006-03-06 16:09:10 EST
FWIW, Rob confirms that he sees the same thing that I do in comment #5.  Basically, if yopu switch to the J2EE Perspective the menu options are restored and you can then go back to the other views/perspective and they are still there.
Comment 12 Mark Phippard CLA 2006-03-10 08:37:30 EST
Also see Bug 130893 which has been opened in WTP for this problem.  Perhaps some from Eclipse Platform could help them figure this out?  It seems like there is some more info being gathered.
Comment 13 Wendell Beckwith CLA 2006-03-10 08:39:16 EST
*** Bug 130893 has been marked as a duplicate of this bug. ***
Comment 14 John Arthorne CLA 2006-03-10 11:39:01 EST
Here's an update: from the plugin.xml Mark attached, it doesn't look like a subversion plugin.  Some possible causes:

 - WTP is messing with the subversion persistent property (unlikely)
 - There's a bug in the UI mechanism for building context menus for popupMenu extensions
 - There's a bug in core.resources involving failure to access persistent properties.

Further investigation is needed to narrow it down, and I don't currently have time.  One thing someone with both subversion and wtp could try is switching the subversion popupMenus IResource object contributions to the new resource mapping mechanism now used by CVS. This would narrow down the possible source of the bug.  I.e., changing this in the subversion plugin.xml

      <objectContribution
            objectClass="org.eclipse.core.resources.IResource"
            adaptable="true"
            id="org.tigris.subversion.subclipse.ui.ResourceContributions">
         <filter
               name="projectPersistentProperty"
               value="org.eclipse.team.core.repository=org.tigris.subversion.subclipse.core.svnnature">
         </filter>

To:


       <objectContribution
            objectClass="org.eclipse.core.resources.mapping.ResourceMapping"
            adaptable="true"
            id="org.tigris.subversion.subclipse.ui.ResourceContributions">
		 <enablement>
           <adapt type="org.eclipse.core.resources.mapping.ResourceMapping">
              <test property="org.eclipse.core.resources.projectPersistentProperty" args="org.eclipse.team.core.repository,org.tigris.subversion.subclipse.core.svnnature" />
           </adapt>
         </enablement>
Comment 15 Mark Phippard CLA 2006-03-10 12:26:38 EST
Subclipse is currently supporting Eclipse 3.0.  If I make this change, will it work back to Eclipse 3.0?

Thanks
Comment 16 John Arthorne CLA 2006-03-10 13:22:24 EST
I was just suggesting that as a debugging measure to help track down the cause of the problem (whether the bug is in the <filter> mechanism for popupMenus).  But yes, if you moved to this it would only work on 3.2.
Comment 17 Brock Janiczak CLA 2006-03-10 17:08:38 EST
I can confirm that addig the changing the object contribution does fix the problem.  Removing the filter also works.
Comment 18 Wendell Beckwith CLA 2006-03-10 21:01:38 EST
I can also confirm that removing the filter or adding the enablement allows the menu tiems to work after you execute eclipse with a "-clean" option.

With that be said is this a platform issue that broke previously working plugins or a subclipse issue where it needs to use the 3.2 way of doing things?
Comment 19 John Arthorne CLA 2006-03-13 09:42:07 EST
This suggests to me a problem with the <filter> mechanism in the popupMenus extension point. This is not a Subclipse problem - the old filter mechanism should continue to work.
Comment 20 John Arthorne CLA 2006-03-13 09:45:12 EST
I think this is Doug...
Comment 21 John Arthorne CLA 2006-03-13 09:47:39 EST
Bug summary: Subclipse plugin has an popupMenus object contribution on IResource.  It uses a <filter> tag on a project persistent property.  When WTP is installed, object contributions from Subclipse on projects (IProject) stop working.  When the <enablement> mechanism is used instead, but still using a property persistent property, the contributions work. 
Comment 22 Douglas Pollock CLA 2006-03-13 10:14:20 EST
John: I don't think that the test given in comment #14 is sufficient to indicate a problem in the filter mechanism itself.  Not to mention, that code hasn't been touched in a very long time.  But, we're probably the best people to be looking at this.
Comment 23 Michael Valenta CLA 2006-03-21 11:27:13 EST
The problem is that the org.eclipse.jst.j2ee.ui plugin is defining an IActionFilter for IProject. This action filter replaces the filter provided by the IDE (i.e. the adaptable mechanism only supports a one-to-one mapping). The Subclipse menus don't show up initially because the J2EE plugin isn't loaded and the adapter mechanism doesn't load plugins during menu filter checking. Two Disconnects show up in the J2EE perspective because the filter returns true as the default behavior for any property that the J2EE filter doesn't know about (so the CVS disconnect is also appearing).

The J2EE plugin should not be defining an IActionFilter on IProject. I've taken a look at the code and it appears that the filter is only interested in IFacetedProjects. However, I noticed that another plugin (org.eclipse.wst.common.project.facet.ui) already defines an action filter for facted projects. Either, the offending filter should be removed or it must target something other than IProject or IFacetedProject.

If the only use of the IActionFilter is menu enablement, you may want to consider switching to the use of Core/Expressions for menu enablement. This was introduced in 3.2 to overcome some of the limitations of IActionFilters.
Comment 24 Michael Valenta CLA 2006-03-28 16:24:53 EST
*** Bug 133685 has been marked as a duplicate of this bug. ***
Comment 25 John Lanuti CLA 2006-03-29 11:56:56 EST
The J2EEUI plugin no longer defines an IActionFilter.  This is released for the 033006 WTP 1.5 M6 build.
Comment 26 Michael Valenta CLA 2006-04-10 08:33:03 EDT
*** Bug 135728 has been marked as a duplicate of this bug. ***
Comment 27 Venkatesh Prasad Ranganath CLA 2006-04-14 12:37:48 EDT
(In reply to comment #25)
> The J2EEUI plugin no longer defines an IActionFilter.  This is released for the
> 033006 WTP 1.5 M6 build.

Is this release available for public download?  If so, at what location?  If not, when will it be available?

Thank you,

 - Venkatesh
Comment 28 Lawrence Mandel CLA 2006-04-14 16:46:46 EDT
M6 was declared today. See http://download.eclipse.org/webtools/downloads/drops/S-1.5M6-200604140226/
Comment 29 Mark Phippard CLA 2006-06-26 16:13:37 EDT
I have gotten a couple of emails asking that I verify the bug is fixed.  I assume that means it wants me to take the "Mark Bug as Verified" option.  Anyway, that is what I am doing.

I can verify that this bug is fixed.
Comment 30 John Lanuti CLA 2006-06-29 14:13:19 EDT
OK
Comment 31 John Lanuti CLA 2007-01-03 11:44:49 EST
*** Bug 133300 has been marked as a duplicate of this bug. ***