Community
Participate
Working Groups
When I try to set a Source Attachment on a class file through the "Change Attached Source..." link on the edit page, it fails with the following error. Attempted to beginRule: R/, does not match outer scope rule: P/platform-main In this case, it's a class whose source is defined inside an External Jar. I can select the jar, but it then provides the above error immediately. "platform-main" is the project in which the jar file is included and the .project & .classpath files are both writable. The workaround is to attach the source through "Configure Build Path..." and editing the source attachment in the libraries tab. !ENTRY org.eclipse.jdt.ui 4 10001 2008-08-10 12:28:14.768 !MESSAGE Internal Error !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:403) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275) at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:977) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:1012) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:987) at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1195) at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor$SourceAttachmentForm.applySourceAttachment(ClassFileEditor.java:303) at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor$2.widgetSelected(ClassFileEditor.java:286) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1158) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3401) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3033) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) Caused by: java.lang.IllegalArgumentException: Attempted to beginRule: R/, does not match outer scope rule: P/platform-main at org.eclipse.core.runtime.Assert.isLegal(Assert.java:64) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:122) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:232) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:58) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:230) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1747) at org.eclipse.core.internal.resources.File.setContents(File.java:364) at org.eclipse.jdt.internal.core.JavaProject.setSharedProperty(JavaProject.java:2885) at org.eclipse.jdt.internal.core.JavaProject.writeFileEntries(JavaProject.java:2651) at org.eclipse.jdt.internal.core.JavaModelManager$7.run(JavaModelManager.java:1188) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelManager$PerProjectInfo.writeAndCacheClasspath(JavaModelManager.java:1182) at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(SetClasspathOperation.java:61) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:709) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:775) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2815) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2846) at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport.updateProjectClasspath(BuildPathSupport.java:277) at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport.modifyClasspathEntry(BuildPathSupport.java:186) at org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock$1.run(SourceAttachmentBlock.java:587) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Root exception: java.lang.IllegalArgumentException: Attempted to beginRule: R/, does not match outer scope rule: P/platform-main at org.eclipse.core.runtime.Assert.isLegal(Assert.java:64) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:122) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:232) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:58) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:230) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1747) at org.eclipse.core.internal.resources.File.setContents(File.java:364) at org.eclipse.jdt.internal.core.JavaProject.setSharedProperty(JavaProject.java:2885) at org.eclipse.jdt.internal.core.JavaProject.writeFileEntries(JavaProject.java:2651) at org.eclipse.jdt.internal.core.JavaModelManager$7.run(JavaModelManager.java:1188) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelManager$PerProjectInfo.writeAndCacheClasspath(JavaModelManager.java:1182) at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(SetClasspathOperation.java:61) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:709) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:775) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2815) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2846) at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport.updateProjectClasspath(BuildPathSupport.java:277) at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport.modifyClasspathEntry(BuildPathSupport.java:186) at org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock$1.run(SourceAttachmentBlock.java:587) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
*** Bug 243693 has been marked as a duplicate of this bug. ***
I cannot reproduce the problem. What is the Eclipse build id? Do you have more accurate steps? An example project that shows the problem would be great.
*** Bug 246659 has been marked as a duplicate of this bug. ***
One possibility is that a plugin that is not part of the Eclipse SDK is using a PessimisticResourceRuleFactory.
*** Bug 246685 has been marked as a duplicate of this bug. ***
*** Bug 243633 has been marked as a duplicate of this bug. ***
Created attachment 112106 [details] My config.txt This is my configuration details. I'll add more comments to the bug if necedssary
I've uploaded my configuration details (with the preferences removed). I'm using the JEE version ganymede with the following non-eclipse.org plugins: com.hudson.velocityweb (1.0.8) "Velocity Web Edit" [Starting] com.perforce.p4api (2008.1.159134) "Perforce Client API" [Active] dk.kamstruplinnet.projecttransfer (1.0.6) "Multi Project Import/Export plugin" [Starting] The perforce plugin doesn't refer to PessimisticResourceRuleFactory, neither do the others (at least through grepping). http://www.perforce.com/downloads/http/p4-wsad/install/ The multi-project transfer plugin is available from here http://eclipse-tools.sourceforge.net/updates/ The velocity plugin is probably not it, because other developers have reported the problem and none of them use it http://velocitywebedit.sourceforge.net/
The only non SDK plugin I have is Perforce. I've removed it and the beginRule errors disappear.
I have got perforce plug-in too ... kar
I've filed a bug with Perforce just so that they know what's going on. I'm using an older version of the plugin, so I'm going to upgrade and see if it helps http://www.perforce.com/perforce/doc.current/user/p4wsadnotes.txt
Upgrading to the latest perforce plugin (P4WSAD 2008.1.162483) made this go away. Can the other cc'd people try to upgrade their plugin and see if it helps?
Hi guys ... i have got already installed the last perforce plugin installed from http://www.perforce.com/downloads/http/p4-wsad/install/ it says version 2008.1.162483 java.lang.IllegalArgumentException: Attempted to beginRule: R/, does not match outer scope rule: P/EnginePlugin at org.eclipse.core.runtime.Assert.isLegal(Assert.java:64) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:122) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:232) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:58) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:230) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:117) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1747) at org.eclipse.core.internal.resources.File.setContents(File.java:364) at org.eclipse.jdt.internal.core.JavaProject.setSharedProperty(JavaProject.java:2885) at org.eclipse.jdt.internal.core.JavaProject.writeFileEntries(JavaProject.java:2651) at org.eclipse.jdt.internal.core.JavaModelManager$7.run(JavaModelManager.java:1188) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelManager$PerProjectInfo.writeAndCacheClasspath(JavaModelManager.java:1182) at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(SetClasspathOperation.java:61) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:709) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:775) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2815) at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2846) at org.eclipse.pde.internal.core.ClasspathComputer.setClasspath(ClasspathComputer.java:38) at org.eclipse.pde.internal.ui.editor.plugin.ExecutionEnvironmentSection$2.linkActivated(ExecutionEnvironmentSection.java:155) at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleActivate(AbstractHyperlink.java:228) at org.eclipse.ui.forms.widgets.AbstractHyperlink.handleMouseUp(AbstractHyperlink.java:316) at org.eclipse.ui.forms.widgets.AbstractHyperlink.access$2(AbstractHyperlink.java:300) at org.eclipse.ui.forms.widgets.AbstractHyperlink$4.handleEvent(AbstractHyperlink.java:119) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) ----------- eclipse.buildId=I20080617-2000 java.version=1.6.0_07 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86
*** Bug 246637 has been marked as a duplicate of this bug. ***
Thanks for investigating this. So it looks like the Perforce plugin is causing grief. However I thing we should behave correctly in the presence of such plugin. I'll investigate a fix.
Created attachment 112433 [details] Proposed fix and regression test (Note to verify that the fix is in, one can remove the fix and run the test, it should show the same trace as reported in this bug in the console)
Fix and test released for 3.5M2
*** Bug 247178 has been marked as a duplicate of this bug. ***
Verified for 3.5M2 using I20080914-2000
*** Bug 248560 has been marked as a duplicate of this bug. ***
Might be a good candidate for 3.4.2.
Philippe, +1 for 3.4.2 ? (fix is trivial, this is a regression comparing to 3.3.x, and there is no workaround but disable the Perforce plugin)
+1 for 3.4.2
Fix and test released for 3.4.2
*** Bug 254630 has been marked as a duplicate of this bug. ***
*** Bug 258746 has been marked as a duplicate of this bug. ***
Verified for 3.4.2 running ClasspathTests v_894_R34x
(In reply to comment #4) > One possibility is that a plugin that is not part of the Eclipse SDK is using a > PessimisticResourceRuleFactory. > Hi, Isn't the PessimisticResourceRuleFactory the default one returned by RepositoryProvider.getRuleFactory ? I work on the Perforce Plugin and was just wondering if it is wrong to use the base implementation of that method or should it be overriden with a custom rule factory?
(In reply to comment #28) > (In reply to comment #4) > > One possibility is that a plugin that is not part of the Eclipse SDK is using a > > PessimisticResourceRuleFactory. > > > > Hi, > Isn't the PessimisticResourceRuleFactory the default one returned by > RepositoryProvider.getRuleFactory ? > > I work on the Perforce Plugin and was just wondering if it is wrong to use the > base implementation of that method or should it be overriden with a custom rule > factory? > Look @ the CVS Implementation for a custom one. I think this should work fine (and I just sent a similiar patch to egit) private static final ResourceRuleFactory RESOURCE_RULE_FACTORY = new ResourceRuleFactory() {}; @Override public IResourceRuleFactory getRuleFactory() { return RESOURCE_RULE_FACTORY; }
(In reply to comment #29) > (In reply to comment #28) > > (In reply to comment #4) > > > One possibility is that a plugin that is not part of the Eclipse SDK is using a > > > PessimisticResourceRuleFactory. > > > > > > > Hi, > > Isn't the PessimisticResourceRuleFactory the default one returned by > > RepositoryProvider.getRuleFactory ? > > > > I work on the Perforce Plugin and was just wondering if it is wrong to use the > > base implementation of that method or should it be overriden with a custom rule > > factory? > > > > Look @ the CVS Implementation for a custom one. I think this should work fine > (and I just sent a similiar patch to egit) > > private static final ResourceRuleFactory RESOURCE_RULE_FACTORY = new > ResourceRuleFactory() {}; > > @Override > public IResourceRuleFactory getRuleFactory() { > return RESOURCE_RULE_FACTORY; > } > Thanks, looking into fixing this on the Perforce plugin end so users can avoid this on pre-3.4.2 builds.